|
JanosVM v0.6.0 Java API Documentation: Class JSIMessage
edu.utah.janosvm.kit.comm.jsi
|
Field Summary | |
static int |
CARRIER
|
static int |
CREATE_PROPERTY
|
static int |
DELETE_PROPERTY
|
static int |
ERROR
|
static int |
EXECUTE_PROPERTY
|
static int |
GET_PROPERTY
|
static int |
GET_SUITES
|
static int |
LIST_PROPERTIES
|
static int |
REPLY
|
static java.lang.String |
SET_DATA
The name of the attribute that contains the data to be used in a set. |
static int |
SET_PROPERTY
|
static int |
SHUTDOWN
|
static int |
WHAT_MAX
|
static int |
WHAT_NONE
|
Constructor Summary | |
JSIMessage()
Construct an empty message. |
Method Summary | |
JSIMessage |
add(JSIPair jp)
Add an identifier/value pair to the message. |
JSIMessage |
add(java.lang.String tag,
JSIPropertyInfo value)
Add an identifier/value pair to the message. |
JSIMessage |
add(java.lang.String tag,
JSIPropertyInfo[] value)
Add an identifier/value pair to the message. |
JSIMessage |
add(java.lang.String tag,
java.lang.String value)
Add an identifier/value pair to the message. |
void |
clear()
Clear the contents of a message so it can be reused. |
int |
count(java.lang.String tag)
Count the number of identifier/value pairs in the message. |
void |
error(java.lang.String why)
Clear the message and set it to be error reply with the given data. |
java.lang.String |
expect(java.lang.String tag)
Expect an identifier/value pair in the message. |
JSIPair |
expectPair(java.lang.String tag)
Expect an identifier/value pair in the message. |
byte[] |
flatten()
|
java.lang.String |
get(java.lang.String tag)
Get an identifier/value pair from the message. |
java.lang.String |
get(java.lang.String tag,
int instance,
java.lang.String defaultValue)
Get an identifier/value pair from the message. |
java.lang.String |
get(java.lang.String tag,
java.lang.String defaultValue)
Get an identifier/value pair from the message. |
java.util.Vector |
getIdentifiers()
|
JSIPair |
getPair(java.lang.String tag)
Get an identifier/value pair from the message. |
JSIPair |
getPair(java.lang.String tag,
int instance)
Get an identifier/value pair from the message. |
int |
getRemainingSpecifierCount()
|
int |
getSpecifierCount()
|
int |
getWhat()
|
static JSIMessage |
instantiate(byte[] msg)
Instantiate a flattened message. |
JSIPair |
popSpecifier()
Pop a specifier off the stack. |
void |
pushSpecifier(JSIPair jp)
Push a specifier onto the stack. |
void |
pushSpecifier(java.lang.String tag)
Push a specifier onto the stack. |
void |
pushSpecifier(java.lang.String tag,
java.lang.String value)
Push a specifier onto the stack. |
void |
remove(java.lang.String tag,
int instance)
Remove an identifier value pair from the message. |
void |
reply(JSIPropertyInfo[] result)
Clear the message and set it to be a valid reply with the given data. |
void |
reply(long result)
Clear the message and set it to be a valid reply with the given data. |
void |
reply(java.lang.String result)
Clear the message and set it to be a valid reply with the given data. |
void |
restoreSpecifier()
Restore the last specifier popped off the stack. |
void |
setWhat(int what)
|
java.lang.String |
toString()
|
void |
unflatten(byte[] buf)
Unmarshal the message in this.buffer. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int WHAT_NONE
public static final int ERROR
public static final int SHUTDOWN
public static final int CARRIER
public static final int REPLY
public static final int GET_SUITES
public static final int LIST_PROPERTIES
public static final int GET_PROPERTY
public static final int SET_PROPERTY
public static final int CREATE_PROPERTY
public static final int DELETE_PROPERTY
public static final int EXECUTE_PROPERTY
public static final int WHAT_MAX
public static final java.lang.String SET_DATA
Constructor Detail |
public JSIMessage()
Method Detail |
public void setWhat(int what)
what
- The message type.public int getWhat()
public void pushSpecifier(JSIPair jp)
jp
- The specifier to add.public void pushSpecifier(java.lang.String tag, java.lang.String value)
tag
- The specifier name.value
- The specifier value.public void pushSpecifier(java.lang.String tag)
tag
- The specifier name.public JSIPair popSpecifier()
public void restoreSpecifier()
public int getSpecifierCount()
public int getRemainingSpecifierCount()
public java.util.Vector getIdentifiers()
public JSIMessage add(JSIPair jp)
jp
- The pair to add.public JSIMessage add(java.lang.String tag, java.lang.String value)
tag
- The identifiervalue
- The valuepublic JSIMessage add(java.lang.String tag, JSIPropertyInfo value)
tag
- The identifiervalue
- The valuepublic JSIMessage add(java.lang.String tag, JSIPropertyInfo[] value)
tag
- The identifiervalue
- An array of JSIPropertyInfo's to add to the message.public void remove(java.lang.String tag, int instance)
tag
- The identifier to remove.instance
- The instance of the identifier to remove.public int count(java.lang.String tag)
tag
- The identifier to count.public java.lang.String get(java.lang.String tag, int instance, java.lang.String defaultValue)
tag
- The identifier to get.instance
- The instance of the identifier to get.defaultValue
- The value to return if the identifier isn't found.public java.lang.String get(java.lang.String tag)
tag
- The identifier to get.public java.lang.String get(java.lang.String tag, java.lang.String defaultValue)
tag
- The identifier to get.defaultValue
- The value to return if the identifier isn't found.public JSIPair getPair(java.lang.String tag, int instance)
tag
- The identifier to get.instance
- The instance of the identifier to get.public JSIPair getPair(java.lang.String tag)
tag
- The identifier to get.public java.lang.String expect(java.lang.String tag) throws MissingPairException
tag
- The identifier to get.public JSIPair expectPair(java.lang.String tag) throws MissingPairException
tag
- The identifier to get.public void clear()
public void reply(java.lang.String result)
result
- The string value to send back as the reply.public void reply(JSIPropertyInfo[] result)
result
- The property info array to send back as the reply.public void reply(long result)
result
- The integer value to send back as the reply.public void error(java.lang.String why)
why
- A brief explanation of the error.public byte[] flatten()
public void unflatten(byte[] buf) throws JSIEncodingException
public java.lang.String toString()
public static final JSIMessage instantiate(byte[] msg) throws JSIEncodingException
msg
- The byte array containing the flattened message.
|
JanosVM v0.6.0 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |