ch.interlis.iox
Interface IoxWriter


public interface IoxWriter

Interface to write a transfer file in object streaming mode. Usage:

  IoxWriter writer=...;
        writer.write(StartTransferEvent);
        ...
  while(more baskets){
                writer.write(StartBasketEvent);
                ...
                while(more objects){
                ...
                        writer.write(ObjectEvent);
                ...
                }
                ...
                writer.write(EndBasketEvent);
  }
        writer.write(EndTransferEvent);
 

Version:
$Revision: 1.0 $ $Date: 28.06.2006 $
Author:
ce

Method Summary
 void close()
          Frees any resources associated with this Writer.
 IomObject createIomObject(java.lang.String type, java.lang.String oid)
          creates a IomObject with the given type and oid.
 void flush()
          Writes any cached events to the underlying output mechanism.
 IoxFactoryCollection getFactory()
          gets the current factory collection.
 void setFactory(IoxFactoryCollection factory)
          sets the factory collection to be used.
 void write(IoxEvent event)
          writes the next event to this writer.
 

Method Detail

write

void write(IoxEvent event)
           throws IoxException
writes the next event to this writer. The flow of events that a writer expects, is
StartTransferEvent {StartBasketEvent {ObjectEvent} EndBasketEvent} EndTransferEvent

Parameters:
event -
Throws:
IoxException

close

void close()
           throws IoxException
Frees any resources associated with this Writer. This method closes the underlying output stream only, if it was opened by this writer.

Throws:
IoxException

flush

void flush()
           throws IoxException
Writes any cached events to the underlying output mechanism.

Throws:
IoxException

setFactory

void setFactory(IoxFactoryCollection factory)
                throws IoxException
sets the factory collection to be used. An implementation should intantiate with a default factory collection and not require a call to this function.

Throws:
IoxException

getFactory

IoxFactoryCollection getFactory()
                                throws IoxException
gets the current factory collection.

Throws:
IoxException

createIomObject

IomObject createIomObject(java.lang.String type,
                          java.lang.String oid)
                          throws IoxException
creates a IomObject with the given type and oid.

Parameters:
type - of object to create
oid - may be null
Returns:
null if factory don know how to create object for given type.
Throws:
IoxException