|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.PingOO.DLAI.lib.util.MessageFormatter
|
+--org.PingOO.DLAI.PPM.net.MasterMessageFormatter
Formats outgoing message so they conform the PingOO protocol and so they can be understood by the server. Also formats incoming messages by removing all parts that are must remain hidden from the upper classes.
MessageHashtable| Field Summary | |
private static java.lang.String |
ARRAY_TAG
Indicates a simple value. |
private byte[] |
byteBuffer
Byte buffer, used when reading lines. |
private static java.lang.String |
END_TAG
Indicates the end of the parameters list in the PingOO protocol. |
private static java.lang.String |
FILE_TAG
Indicates a file. |
private static java.lang.String |
HASH_KEY_TAG
Indicates a list of hastable keys. |
private static java.lang.String |
HASH_VALUE_TAG
Indicates a list of hashtable values. |
private static java.lang.String |
KEY_SEPARATORS
Separator for the inner keys. |
private static java.lang.String |
KEY_TAG
Separates the different the inner keys. |
private static java.lang.String |
LINE_TAG
Terminates the line. |
private static java.lang.String |
OBJECT_SEPARATORS
Separator for the objets lists. |
private static java.lang.String |
PARAM_TAG
Separates the type from the values. |
private static java.lang.String |
PORT_TAG
Separates the server's name from it's port. |
private static java.lang.String |
PROTOCOL_NAME_TAG
Stores the name of the pingoo protocol. |
private static java.lang.String |
PROTOCOL_TAG
Separates the protocol descriptor from th rest of the URL. |
private static java.lang.String |
REQUEST_ID_TAG
Indicates an id line. |
private static java.lang.String |
SIMPLE_TAG
Indicates a simple value. |
private static java.lang.String |
TYPE_CLOSE_TAG
Last separator for the type. |
private static java.lang.String |
TYPE_OPEN_TAG
First separator for the type. |
private static java.lang.String |
TYPE_SEPARATORS
Separators for the type. |
private static java.lang.String |
URL_TAG
Separates the parts of the URL. |
private static java.lang.String |
VALUE_TAG
Separates the type from the values. |
| Fields inherited from class org.PingOO.DLAI.lib.util.MessageFormatter |
ACCEPTED_NO_TAG,
ACCEPTED_TAG,
ACCEPTED_YES_TAG,
COMMENT_TAG |
| Constructor Summary | |
MasterMessageFormatter()
Creates a new message formatter. |
|
| Method Summary | |
private void |
parseHashtable(ValueHashtable hashtable,
java.lang.StringBuffer lastKey,
java.lang.StringBuffer keyLine,
java.lang.StringBuffer valueLine)
Takes a ValueHashtable and make the two needed line for the PingOO protocol. |
private void |
parseHashToken(ValueHashtable hashtable,
java.lang.String key,
java.lang.String value)
Correctly formats incoming (recursive) Hashtables. |
java.lang.String |
parseIn(MessageHashtable message,
java.lang.String server,
java.lang.String port)
Formats the outgoing message so it can be sent and unstertood by the server. |
MessageHashtable |
parseOut(byte[] data,
java.lang.String module,
java.lang.String function)
Formats an incoming message so it can be used and routed by the PingOO PPM. |
private java.lang.String |
readLine()
Get a line from a byte buffer. |
| Methods inherited from class org.PingOO.DLAI.lib.util.MessageFormatter |
parseIn,
parseIn |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final java.lang.String OBJECT_SEPARATORS
private static final java.lang.String TYPE_SEPARATORS
private static final java.lang.String KEY_SEPARATORS
private static final java.lang.String PROTOCOL_NAME_TAG
private static final java.lang.String REQUEST_ID_TAG
private static final java.lang.String SIMPLE_TAG
private static final java.lang.String ARRAY_TAG
private static final java.lang.String HASH_KEY_TAG
private static final java.lang.String HASH_VALUE_TAG
private static final java.lang.String FILE_TAG
private static final java.lang.String END_TAG
private static final java.lang.String VALUE_TAG
private static final java.lang.String PARAM_TAG
private static final java.lang.String URL_TAG
private static final java.lang.String PORT_TAG
private static final java.lang.String KEY_TAG
private static final java.lang.String PROTOCOL_TAG
private static final java.lang.String TYPE_OPEN_TAG
private static final java.lang.String TYPE_CLOSE_TAG
private static final java.lang.String LINE_TAG
private byte[] byteBuffer
| Constructor Detail |
public MasterMessageFormatter()
| Method Detail |
public final java.lang.String parseIn(MessageHashtable message,
java.lang.String server,
java.lang.String port)
throws java.lang.NullPointerException
message - A MessageHashtable containing the keys and objects needed to be sent to the server.server - The targeted server.port - The targeted port.null.
public final MessageHashtable parseOut(byte[] data,
java.lang.String module,
java.lang.String function)
throws java.lang.NullPointerException,
BadMessageException
data - The byte array containing the message.module - The name of the module wich requires this answer.function - The name of the function wich requires this answer.null.
private final java.lang.String readLine()
throws java.lang.NullPointerException
data - The buffer from which we want to get a line.null.
private final void parseHashToken(ValueHashtable hashtable,
java.lang.String key,
java.lang.String value)
hashtable - key - value -
private final void parseHashtable(ValueHashtable hashtable,
java.lang.StringBuffer lastKey,
java.lang.StringBuffer keyLine,
java.lang.StringBuffer valueLine)
hashtable - lastKey - keyLine - valueLine -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||