|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectthinkmap.datasource.stream.StreamWriter
thinkmap.datasource.stream.BinaryStreamWriter
public class BinaryStreamWriter
This class implements the writing portion of the binary stream format for Thinkmap.
| Field Summary |
|---|
| Fields inherited from class thinkmap.datasource.stream.StreamWriter |
|---|
error, factory, format |
| Fields inherited from interface thinkmap.datasource.IEntityHandler |
|---|
ADD_REQUEST, ATTR_CACHE_REVISION, DELETE_REQUEST, EDGE, ENTITY_REQUEST, FLAG_NO_CACHE, FLAGS, FLAGS_DEFAULT, ID_REQUEST, LIST_ENTITIES_REQUEST, METADATA_REQUEST, NODE, NULL_REQUEST, QUERY_MAX_RESULTS, QUERY_STARTING_RESULT_NUMBER, QUERY_STRING, RELATED_REQUEST, RESERVED_ID_MAX, SINK, SOURCE, TOTAL_RESULTS, UNLIMITED_RESULTS, UPDATE_REQUEST |
| Constructor Summary | |
|---|---|
protected |
BinaryStreamWriter(IStreamFormat sf,
IStreamFactory isf)
|
| Method Summary | |
|---|---|
void |
_beginMessage(int messageType)
|
void |
_endMessage()
|
void |
attribute(String name,
Object value)
Send a message attribute. |
void |
beginEntity()
Begin an entity. |
void |
beginEntityMD(String parentType)
Begin entity metadata. |
void |
beginId(String type)
Begin an entity ID. |
void |
beginRelatedEntity(String relation,
boolean reciprical)
A related entity. |
void |
beginRelatedList(byte flag)
Begin the list of related entities. |
void |
endEntity()
End an entity. |
void |
endEntityMD()
End entity metadata. |
void |
endId()
End an entity ID. |
void |
endRelatedEntity()
End a related entity. |
void |
endRelatedList()
Mark the end of a related list. |
void |
error(Exception e)
Tell the entity source about an error. |
void |
fatalError(Exception e)
A fatal error occured. |
OutputStream |
getStream()
Get the OutputStream this writes to. |
void |
idKey(Object value)
Send an id key. |
void |
idKeyMD(Class type)
Describe an entity id's key. |
void |
property(String name,
Object value)
Send an entity's property. |
void |
propertyMD(String name,
Class type)
Describe an entity's property. |
protected void |
writeArray(Object obj)
|
protected void |
writeHeader()
|
protected void |
writeValue(Object obj)
|
| Methods inherited from class thinkmap.datasource.stream.StreamWriter |
|---|
beginMessage, endMessage, getError, getStreamFactory, getStreamFormat, setError |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface thinkmap.datasource.IEntityHandler |
|---|
beginMessage, endMessage |
| Constructor Detail |
|---|
protected BinaryStreamWriter(IStreamFormat sf,
IStreamFactory isf)
| Method Detail |
|---|
public OutputStream getStream()
StreamWriter
getStream in class StreamWriterpublic void _beginMessage(int messageType)
_beginMessage in class StreamWriter
public void attribute(String name,
Object value)
IEntityHandler
attribute in interface IEntityHandlername - The attribute's namevalue - The attribute's valuepublic void beginEntity()
IEntityHandler
beginEntity in interface IEntityHandlerpublic void endEntity()
IEntityHandler
endEntity in interface IEntityHandlerpublic void beginEntityMD(String parentType)
IEntityHandler
beginEntityMD in interface IEntityHandlerparentType - The parent type of this entity, eg NODE or EDGE.public void endEntityMD()
IEntityHandler
endEntityMD in interface IEntityHandler
public void property(String name,
Object value)
IEntityHandler
property in interface IEntityHandler
public void propertyMD(String name,
Class type)
IEntityHandler
propertyMD in interface IEntityHandlerpublic void beginId(String type)
IEntityHandler
beginId in interface IEntityHandlertype - The type of entity being sent.public void idKey(Object value)
IEntityHandler
idKey in interface IEntityHandlervalue - A key in an entity ID.public void idKeyMD(Class type)
IEntityHandler
idKeyMD in interface IEntityHandlertype - Describe an entity ID's key.public void endId()
IEntityHandler
endId in interface IEntityHandlerpublic void beginRelatedList(byte flag)
IEntityHandler
beginRelatedList in interface IEntityHandlerflag - one of: FLAGS_DEFAULT, FLAG_NO_CACHEpublic void endRelatedList()
IEntityHandler
endRelatedList in interface IEntityHandler
public void beginRelatedEntity(String relation,
boolean reciprical)
IEntityHandler
beginRelatedEntity in interface IEntityHandlerrelation - either SOURCE or SINK.reciprical - should this connection go both ways? SOURCE should
always be reciprocal, and SINK should be reciprocal for a
bidirectional edge.public void endRelatedEntity()
IEntityHandler
endRelatedEntity in interface IEntityHandlerpublic void _endMessage()
_endMessage in class StreamWriterpublic void error(Exception e)
IEntityHandler
error in interface IEntityHandlere - The cause.public void fatalError(Exception e)
IEntityHandler
fatalError in interface IEntityHandlere - The cause.
protected void writeHeader()
throws IOException
IOException
protected void writeValue(Object obj)
throws IOException
IOException
protected void writeArray(Object obj)
throws IOException
IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||