ilog.server.jcomp
Class MvMessage

java.lang.Object
  |
  +--ilog.server.jcomp.MvUserType
        |
        +--ilog.server.jcomp.MvMessage
All Implemented Interfaces:
Cloneable, ilog.server.jcomp.Streamable

public final class MvMessage
extends MvUserType

This class manages the server/component communication layer. The strange prototype of encoding/decoding methods are required to ensure consistency with the C++ side.


Field Summary
protected static String NULLSTRING
           
 
Method Summary
 boolean decodeBool()
          This function extracts the next data from the message, assuming it is an int, and returns the corresponding boolean.
 boolean decodeBoolAsChar()
          This function extracts the next data from the message, assuming it is a char ILSS * and returns the corresponding boolean.
 boolean decodeBoolAsUChar()
          This function extracts the next data from the message, assuming it is an unsigned int, and returnd the corresponding boolean.
 char decodeChar()
          This function extracts the next data from the message, assuming it is a .
 String decodeCString()
          This function extracts the next data from the message, assuming it is a C string.
 double decodeDouble()
          This function extracts the next data from the message, assuming it is a double.
 float decodeFloat()
          This function extracts the next data from the message, assuming it is a float.
 String decodeIlsString()
          This function extracts the next string from the message, assuming it is an IlsString.
 int decodeInt()
          This function extracts the next data in the message, assuming it is an int.
 long decodeLong()
          This function extracts the next data from the message, assuming it is a long
 MvMessage decodeMessage(MvMessage msg)
          This function extracts the next message from the message, assuming it is a message.
 short decodeShort()
          This function extracts the next data from the message, assuming it is a short.
 char decodeUChar()
          This function extracts the next data from the message, assuming it is an unsigned char.
 int decodeUInt()
          This function extracts the next data from the message, assuming it is an unsigned int.
 long decodeULong()
          This function extracts the next data from the message, assuming it is a long
 short decodeUShort()
          This function extracts the next data from the message, assuming it is an unsigned short.
protected  MvMessage encode(MvMessage msg)
           
 MvMessage encodeBool(boolean b)
          This function appends a boolean coded as an int.
 MvMessage encodeBoolAsChar(boolean b)
          This function appends a boolean coded as a char.
 MvMessage encodeBoolAsUChar(boolean b)
          This function appends a boolean coded as an unsigned int.
 MvMessage encodeChar(char c)
          This function appends a char in the message.
 MvMessage encodeCString(String s)
          This function appends a string to the message as if it were a C string.
 MvMessage encodeDouble(double d)
          This function appends a double to the message.
 MvMessage encodeFloat(float f)
          This function appends a float to the message.
 MvMessage encodeIlsString(String s)
          This function appends a string to the message as an IlsString.
 MvMessage encodeInt(int i)
          This function appends an int to the message.
 MvMessage encodeLong(long l)
          This function appends an int to the message as if it was a long.
 MvMessage encodeMessage(MvMessage msg)
          This function appends a message to the message.
 MvMessage encodeShort(short i)
          This function appends a short to the message.
 MvMessage encodeUChar(char c)
          This function appends a char in the message as if it was an unsigned char.
 MvMessage encodeUInt(int i)
          This function appends an int to the message as an unsigned int.
 MvMessage encodeULong(long l)
          This function appends an int to the message as if it was an unsigned long.
 MvMessage encodeUShort(short i)
          This function appends a short to the message as if it was an unsigned short
 boolean fail()
          This function returns true if the message failed.
static boolean isKeepNullString()
          This function returns the IlsString decoding behavior.
static void SetKeepNullString(boolean keepNullString)
          This function sets the IlsString decoding behavior.
 
Methods inherited from class ilog.server.jcomp.MvUserType
asAny, asBoolean, asChar, asDouble, asFloat, asHRef, asLong, asObjectRef, asRef, asString, asValue, clone, duplicate, equals, stream
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULLSTRING

protected static String NULLSTRING
Method Detail

SetKeepNullString

public static void SetKeepNullString(boolean keepNullString)
This function sets the IlsString decoding behavior. Default behavior is false, set it to true for backward compatibility.
Parameters:
keepNullString - if true, a null IlsString is decoded as "null", as "" otherwise.

isKeepNullString

public static boolean isKeepNullString()
This function returns the IlsString decoding behavior.
Returns:
true if a null IlsString decoded as "null", false if a null IlsString is decoded as "".

fail

public boolean fail()
This function returns true if the message failed.

encodeBool

public MvMessage encodeBool(boolean b)
This function appends a boolean coded as an int.
Parameters:
b - The boolean to be written.
Returns:
The message itself.

decodeBool

public boolean decodeBool()
                   throws CodingError
This function extracts the next data from the message, assuming it is an int, and returns the corresponding boolean.
Returns:
The boolean.
Throws:
CodingError - An error occurred during decoding.

encodeBoolAsChar

public MvMessage encodeBoolAsChar(boolean b)
This function appends a boolean coded as a char.
Parameters:
b - The boolean to be written.
Returns:
The message itself.

decodeBoolAsChar

public boolean decodeBoolAsChar()
                         throws CodingError
This function extracts the next data from the message, assuming it is a char ILSS * and returns the corresponding boolean.
Returns:
The boolean.
Throws:
CodingError - An error occurred during decoding.

encodeBoolAsUChar

public MvMessage encodeBoolAsUChar(boolean b)
This function appends a boolean coded as an unsigned int.
Parameters:
b - The boolean to be written.
Returns:
The message itself.

decodeBoolAsUChar

public boolean decodeBoolAsUChar()
                          throws CodingError
This function extracts the next data from the message, assuming it is an unsigned int, and returnd the corresponding boolean.
Returns:
The boolean.
Throws:
CodingError - An error occurred during decoding.

encodeChar

public MvMessage encodeChar(char c)
This function appends a char in the message.
Parameters:
c - The character to be written.
Returns:
The message itself.

decodeChar

public char decodeChar()
                throws CodingError
This function extracts the next data from the message, assuming it is a .
Returns:
The char.
Throws:
CodingError - An error occurred during decoding.

encodeUChar

public MvMessage encodeUChar(char c)
This function appends a char in the message as if it was an unsigned char.
Parameters:
c - The char to be written.
Returns:
The message itself.

decodeUChar

public char decodeUChar()
                 throws CodingError
This function extracts the next data from the message, assuming it is an unsigned char.
Returns:
The char.
Throws:
CodingError - An error occurred during decoding.

encodeShort

public MvMessage encodeShort(short i)
This function appends a short to the message.
Parameters:
i - The short to be written.
Returns:
The message itself.

decodeShort

public short decodeShort()
                  throws CodingError
This function extracts the next data from the message, assuming it is a short.
Returns:
The short integer.
Throws:
CodingError - An error occurred during decoding.

encodeUShort

public MvMessage encodeUShort(short i)
This function appends a short to the message as if it was an unsigned short
Parameters:
i - The short to be written.
Returns:
The message itself.

decodeUShort

public short decodeUShort()
                   throws CodingError
This function extracts the next data from the message, assuming it is an unsigned short.
Returns:
The short integer.
Throws:
CodingError - An error occurred during decoding.

encodeInt

public MvMessage encodeInt(int i)
This function appends an int to the message.
Parameters:
i - The int to be written.
Returns:
The message itself.

decodeInt

public int decodeInt()
              throws CodingError
This function extracts the next data in the message, assuming it is an int.
Returns:
The integer.
Throws:
CodingError - An error occurred during decoding.

encodeUInt

public MvMessage encodeUInt(int i)
This function appends an int to the message as an unsigned int.
Parameters:
i - The int to be written.
Returns:
The message itself.

decodeUInt

public int decodeUInt()
               throws CodingError
This function extracts the next data from the message, assuming it is an unsigned int.
Returns:
The integer.
Throws:
CodingError - An error occurred during decoding.

encodeLong

public MvMessage encodeLong(long l)
This function appends an int to the message as if it was a long.
Parameters:
l - The long to be written.
Returns:
The message itself.

decodeLong

public long decodeLong()
                throws CodingError
This function extracts the next data from the message, assuming it is a long
Returns:
The long.
Throws:
CodingError - An error occurred during decoding.

encodeULong

public MvMessage encodeULong(long l)
This function appends an int to the message as if it was an unsigned long.
Parameters:
l - The unsigned long to be written.
Returns:
The message itself.

decodeULong

public long decodeULong()
                 throws CodingError
This function extracts the next data from the message, assuming it is a long
Returns:
The long.
Throws:
CodingError - An error occurred during decoding.

encodeFloat

public MvMessage encodeFloat(float f)
This function appends a float to the message.
Parameters:
f - The float to be written.
Returns:
The message itself.

decodeFloat

public float decodeFloat()
                  throws CodingError
This function extracts the next data from the message, assuming it is a float.
Returns:
The float.
Throws:
CodingError - An error occurred during decoding.

encodeDouble

public MvMessage encodeDouble(double d)
This function appends a double to the message.
Parameters:
d - The double to be written.
Returns:
The message itself.

decodeDouble

public double decodeDouble()
                    throws CodingError
This function extracts the next data from the message, assuming it is a double.
Returns:
The double.
Throws:
CodingError - An error occurred during decoding.

encodeCString

public MvMessage encodeCString(String s)
This function appends a string to the message as if it were a C string.
Parameters:
s - The string to be written.
Returns:
The message itself.

decodeCString

public String decodeCString()
                     throws CodingError
This function extracts the next data from the message, assuming it is a C string.
Returns:
The string.
Throws:
CodingError - An error occurred during decoding.

encodeIlsString

public MvMessage encodeIlsString(String s)
This function appends a string to the message as an IlsString.
Parameters:
s - The string to be written.
Returns:
The message itself.

decodeIlsString

public String decodeIlsString()
                       throws CodingError
This function extracts the next string from the message, assuming it is an IlsString.
Returns:
The string.
Throws:
CodingError - An error occurred during decoding.

encodeMessage

public MvMessage encodeMessage(MvMessage msg)
This function appends a message to the message.
Parameters:
the - msg message to be appended
Returns:
The message itself.

decodeMessage

public MvMessage decodeMessage(MvMessage msg)
                        throws CodingError
This function extracts the next message from the message, assuming it is a message. param msg The message
Returns:
The extracted message.
Throws:
CodingError - An error occurred during decoding.

encode

protected MvMessage encode(MvMessage msg)
Description copied from class: MvUserType
To allow serialization, this function must be redefined for each user-defined type.
Overrides:
encode in class MvUserType
Following copied from class: ilog.server.jcomp.MvUserType
Parameters:
msg - The message to which the object is streamed.
See Also:
MvMessage