|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vrspace.util.Message
Generic Message class.
A message can be request, response or command.
Constructor expects request string in format "class id event value"
or "command arguments"
Request: request for a network object to change it's state. Object is
specified by class and id, event specifies it's field/method
(metod has set_ prefix, used if there is no public field with event name)
and value is passed to method or used to set field value
Response: response to a previous request/command. Prefixed with + (ok) or
- (error).
Command: request to the server rather to an object
Field Summary | |
protected java.lang.String[] |
arguments
|
protected java.lang.String |
className
|
protected java.lang.String |
eventName
|
protected java.lang.String |
eventValue
|
java.lang.Exception |
exception
|
protected boolean |
isResponse
|
protected long |
objectId
|
protected java.util.Vector |
path
|
protected java.lang.String |
request
|
protected boolean |
response
|
protected long |
time
|
Constructor Summary | |
protected |
Message()
Intended only for subclasses |
|
Message(java.lang.String line)
Creates new message defined by line |
Method Summary | |
java.lang.String[] |
getArguments()
Returns the command arguments |
java.lang.String |
getClassName()
Returns the target object class name, or command if message is command |
java.lang.String |
getEventName()
Returns target object field name |
java.lang.String |
getEventValue()
Returns the event value |
long |
getId()
Returns target object id or -1 if message is command |
java.lang.String |
getID()
Returns className and id of targeted object. |
java.lang.String[] |
getPath()
Returns the message path (list of servers it passed), null for local message |
java.lang.String |
getRequest()
Returns the request string used to create this message |
boolean |
getResponse()
returns true for ok or false for error |
long |
getTime()
Returns the message creation time, in milliseconds |
boolean |
isResponse()
Is this message a response |
void |
parseLine(java.lang.String line)
parses line and fills in message fields |
java.lang.String |
toString()
Returns the string representation of request, in the format expected by constructor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected long time
protected java.lang.String className
protected long objectId
protected java.lang.String eventName
protected java.lang.String eventValue
protected boolean response
protected boolean isResponse
public java.lang.Exception exception
protected java.lang.String[] arguments
protected java.util.Vector path
protected java.lang.String request
Constructor Detail |
protected Message()
public Message(java.lang.String line)
Method Detail |
public void parseLine(java.lang.String line)
public boolean isResponse()
public boolean getResponse()
public java.lang.String getClassName()
public java.lang.String[] getArguments()
public long getId()
public java.lang.String getID()
public java.lang.String getEventName()
public java.lang.String getEventValue()
public long getTime()
public java.lang.String getRequest()
public java.lang.String[] getPath()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |