org.kite9.framework.server
Class AbstractLocalServer

java.lang.Object
  extended by org.kite9.framework.server.AbstractLocalServer
All Implemented Interfaces:
ItemServer

public abstract class AbstractLocalServer
extends Object
implements ItemServer

Handles serving of a set of work items and returning a zip stream.

Author:
moffatr

Constructor Summary
AbstractLocalServer()
           
 
Method Summary
 void beginZipEntry(WorkItem workItem, String fileExtension, ZipOutputStream zos)
          Call this method for each item to add to the zip stream.
protected abstract  void processItem(WorkItem workItem, ZipOutputStream zos)
          Adds any files to the zip output stream that the request might need.
 ZipInputStream serve(WorkItem item)
           
 void serve(WorkItem workItem, OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLocalServer

public AbstractLocalServer()
Method Detail

serve

public ZipInputStream serve(WorkItem item)
                     throws IOException
Specified by:
serve in interface ItemServer
Throws:
IOException

serve

public void serve(WorkItem workItem,
                  OutputStream os)
           throws IOException
Specified by:
serve in interface ItemServer
Throws:
IOException

processItem

protected abstract void processItem(WorkItem workItem,
                                    ZipOutputStream zos)
                             throws IOException,
                                    Kite9ProcessingException
Adds any files to the zip output stream that the request might need.

Throws:
Kite9ProcessingException - an exception to be returned to the client
IOException - for any problem writing the stream

beginZipEntry

public void beginZipEntry(WorkItem workItem,
                          String fileExtension,
                          ZipOutputStream zos)
                   throws IOException
Call this method for each item to add to the zip stream.

Throws:
IOException


Copyright © 2011. All Rights Reserved.