|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.etools.systems.dstore.core.util.XMLgenerator
This class is used to serialize data and send it either to a file or a socket.
When a DataStore tree needs to be transmitted, it's DataElements are converted to XML before sending. Only those elements which have changed and are thus out of synch with the DataStore on the other end of the socket are actually transferred.
When a byte stream or file needs to be transmitted, bytes are either send as is if binary transfer is requested or as unicode if binary transfer is not requested.
Field Summary | |
---|---|
static int |
BODY
|
static int |
CLOSE
|
static String |
Copyright
|
static int |
EMPTY
|
static int |
OPEN
|
Constructor Summary | |
---|---|
XMLgenerator(DataStore dataStore)
Constructor |
Method Summary | |
---|---|
StringBuffer |
document()
Returns the current serialized document |
void |
empty()
Clears the current serlized document |
void |
flushData()
Send all buffered data through the pipe. |
void |
generate(DataElement object,
byte[] bytes,
int size,
boolean isAppend,
boolean binary)
Generate an tags for a file transfer and send bytes over the pipe. |
void |
generate(DataElement object,
int depth)
Serializes and sends a DataStore tree through the pipe |
static StringBuffer |
prepareStringForXML(String input)
Converts special characters to appropriate representation in XML |
static StringBuffer |
prepareStringForXML(StringBuffer input)
Converts special characters to appropriate representation in XML |
void |
setBufferSize(int size)
Set the buffer size |
void |
setDataWriter(BufferedWriter writer)
Sets the data writer used for XML transfer |
void |
setFileWriter(PrintStream writer)
Sets the file writer used for file transfer |
void |
setGenerateBuffer(boolean flag)
Indicate whether the buffer attribute of each DataElement should be transferred |
void |
setIgnoreDeleted(boolean flag)
Indicate whether DataElements marked as deleted should be sent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String Copyright
public static final int EMPTY
public static final int OPEN
public static final int CLOSE
public static final int BODY
Constructor Detail |
public XMLgenerator(DataStore dataStore)
dataStore
- the associated DataStoreMethod Detail |
public void setIgnoreDeleted(boolean flag)
flag
- whether deleted elements should be sentpublic void setFileWriter(PrintStream writer)
writer
- the file writer used for file transferpublic void setDataWriter(BufferedWriter writer)
writer
- the data writer used for XML transferpublic void setBufferSize(int size)
size
- of the buffer used for transmitting packetspublic void setGenerateBuffer(boolean flag)
flag
- whether the buffer should be transferredpublic void flushData()
public StringBuffer document()
public void empty()
public static StringBuffer prepareStringForXML(StringBuffer input)
input
- buffer to convert
public static StringBuffer prepareStringForXML(String input)
input
- buffer to convert
public void generate(DataElement object, byte[] bytes, int size, boolean isAppend, boolean binary)
object
- the element representing the file transferbytes
- the bytes to sendsize
- the number of bytes to sendisAppend
- indicates whether bytes should be appended or not to a file on the other end of the pipebinary
- indicates whether the bytes should be sent as binary or textpublic void generate(DataElement object, int depth)
object
- the root of the DataStore tree to senddepth
- the depth of the tree to send
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |