|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tivoli.twg.libs.Command
Command is a base class for defining Director transport messages.
Constructor Summary | |
---|---|
Command(Command cmd)
Constructor for Command, copied from another command |
|
Command(long cmd)
Constructor for Command. |
|
Command(long cmd,
CommandCompleteListener ccl)
Constructor for Command. |
Method Summary | |
---|---|
void |
AddInputParm(byte[] data)
Add a copy of a provided buffer as an input parameter. |
void |
AddInputParm(byte[] data,
int start,
int length)
Add a copy of a provided buffer as an input parameter. |
void |
AddObjectAsInputParm(java.lang.Object obj)
Add a serialized object (compressed) as an input parameter |
void |
AddObjectAsOutputParm(java.lang.Object obj)
Add a serialized object (compressed) as an output parameter |
void |
AddOutputParm(byte[] data)
Add a copy of a provided buffer as an output parameter. |
void |
AddOutputParm(byte[] data,
int start,
int length)
Add a copy of a provided buffer as an output parameter. |
void |
addToDebugStrings(Vect msglist,
java.lang.Thread cur_thrd)
Generate a contribution to the list of debug strings to be used for presenting the current status of the object in the given thread. |
static byte[] |
AllocateBuffer(int len)
Allocate buffer (byte array) |
void |
AttachInputParm(byte[] data)
Attach a byte buffer as an input parameter |
void |
AttachOutputParm(byte[] data)
Attach a byte buffer as an output parameter |
long |
CmdId()
Return command ID |
long |
CommandCode()
Retrieve command code |
java.lang.String |
commandCodeDebugString()
Retrieve command code debug string |
void |
CommandComplete()
Callback method invoked when command is completed. |
static byte[] |
CompressObject(java.lang.Object obj)
Serialize and compress and object, if possible, using the shared deflater |
static void |
debugPrint(Command cmd)
|
static java.lang.Object |
DecompressObject(byte[] buf)
Decompress and extract object, if possible, using the shared inflater |
java.lang.String |
DestinationAddress()
Return destination address string. |
byte[] |
DetachInputParm(int index)
Detach input parameter with given index. |
byte[] |
DetachOutputParm(int index)
Detach output parameter with given index. |
static void |
FreeBuffer(byte[] buf)
Release buffer (no-op in java) |
void |
FreeInputsAfterSend()
Set command to free input parms as soon as command is sent |
byte |
getCmdType()
Get Command type |
java.lang.Object |
GetObjectFromInputParm(int index)
Get serialized object from input paramter. |
java.lang.Object |
GetObjectFromOutputParm(int index)
Get serialized object from output paramter. |
ServiceNode |
getSenderServiceNode()
Gets the sending ServiceNode for a Command |
static java.lang.String |
hexDump(java.lang.String indent,
byte[] data)
|
byte[] |
InputParm()
Return next input parameter (autoincrement index) |
byte[] |
InputParm(int index)
Return input parameter at given index, or null if not defined. |
int |
InputParmLength(int index)
Return length of input parameter with given index. |
boolean |
IsFlatInputBuffer(byte[] buf,
int off)
Test buffer for input packet |
boolean |
IsFlatOutputBuffer(byte[] buf,
int off)
Test buffer for output packet |
boolean |
IsPostponedReply()
Test if command has been postponed |
byte[] |
MakeFlatInputBuffer(int offset)
Build a flat input buffer, and return as a byte array. |
byte[] |
MakeFlatOutputBuffer(int offset)
Build a flat output buffer, and return as a byte array. |
int |
NumInputParms()
Retrieve number of input parameters |
int |
NumOutputParms()
Retrieve number of output parameters |
byte[] |
OutputParm()
Return next output parameter (autoincrement index) |
byte[] |
OutputParm(int index)
Return output parameter at given index, or null if not defined. |
int |
OutputParmLength(int index)
Return length of output parameter with given index. |
void |
PostponeReply()
Calling this method sets the "postpone reply" attribute to TRUE If set during the CommandReceived() method in ServiceNode, the reply for the command will not be sent until the user calls the SendPostponedReply() method. |
void |
ResetIndex()
Reset current index for autoincrementing InputParm and OutputParm methods. |
void |
ResetInput()
Reset command code and input parameters. |
void |
ResetOutput()
Reset return code and output parameters. |
java.lang.String |
ReturnAddress()
Retrieve return address string. |
long |
ReturnCode()
Retrieve return code |
static java.lang.String |
ReturnCodeToString(long rc)
|
java.lang.String |
RootDestinationAddress()
Return root of destination address (first step of address). |
java.lang.String |
RootReturnAddress()
Return root of return address (first step of address). |
boolean |
SessionHold()
Retrieve session hold flag |
byte |
SessionMode()
Retrieve command session mode (preferred or required) |
boolean |
SessionRelease()
Retrieve session release flag |
int |
SessionWaitTime()
Retrieve maximum time to wait for session |
void |
setCmdType(byte type)
Set Command type |
void |
setCmdTypeInput()
Sets the Command type as a COMMAND_TYPE_INPUT Command |
void |
setCmdTypeOutput()
Sets the Command type as a COMMAND_TYPE_OUTPUT Command |
void |
SetCommandCode(long cc)
Set command code |
void |
setCommandCodeDebugString(java.lang.String ccds)
Set command code debug string |
void |
setCommandCompleteListener(CommandCompleteListener ccl)
Set listener for command object |
void |
SetDestinationAddress(java.lang.String dest)
Set destination address string. |
void |
SetNewID()
Set new command ID for command |
void |
SetReturnAddress(java.lang.String addr)
Set return address string. |
void |
SetReturnCode(long rc)
Set return code |
void |
setSenderServiceNode(ServiceNode sn)
Sets the ServiceNode which is sending the Command |
void |
SetSessionHold(boolean b)
Set session hold flag |
void |
SetSessionMode(byte sm)
Set session mode |
void |
SetSessionRelease(boolean b)
Set session release flag |
void |
SetSessionWaitTime(int t)
Set maximum time to wait for session |
void |
SetTimeOut(int msec)
Set command time-out |
int |
TimeOut()
Return command time-out |
java.lang.String |
toString()
|
boolean |
UseFlatInputBuffer(byte[] buf,
int off)
|
boolean |
UseFlatOutputBuffer(byte[] buf,
int off)
Use a command packet from a byte array as an output buffer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long CMDRET_SEND_FAILED
public static final long CMDRET_SECURE_FAIL
public static final long CMDRET_SEND_TIMEOUT
public static final long CMDRET_SERVICEFAILED
public static final long CMDRET_ENCRYPT_FAIL
public static final long CMDRET_INVALID_DEST_ADDRESS
public static final long CMDRET_NO_LOCAL_SVCNODE_IMPL
public static final long CMDRET_CREATE_CMDPKT_FAILED
public static final long CMDRET_ENQUEUE_LOCAL_FAILED
public static final long CMDRET_SEND_BUFFER_FAILED
public static final byte ENQUEUE_FAILED_SECURITY
public static final byte ENQUEUE_FAILED_NO_DESTPATH
public static final byte ENQUEUE_FAILED_NO_SVC_NODE_HANDLE
public static final byte ENQUEUE_FAILED_NO_PROCESS_HANDLE
public static final byte ENQUEUE_FAILED_COPYDATA
public static final byte JNI_INITIALIZE_FAILED
public static final byte JNI_ENTRY_POINT_NOT_LOADED
public static final byte JNI_HANDLE_NULL
public static final byte JNI_BUFFER_NULL
public static final byte RMI_LOOKUP_ERROR
public static final byte ENQUEUE_GENERAL_FAILURE
public static final long CMD_SENDER_FLAG
public static final long CMDRET_SESS_DISABLED_LCL
public static final long CMDRET_SESS_DISABLED_RMT
public static final long CMDRET_SESS_UNAVAIL_LCL
public static final long CMDRET_SESS_UNAVAIL_RMT
public static final long CMDRET_SESS_WAIT_EXPIRED
public static final long CMDRET_SESS_WAITING
public static final long CMDRET_SESS_WAIT_DONE
public static final int DEFAULT_CMD_TIMEOUT
public static final byte SESSION_NONE
public static final byte SESSION_REQUIRED
public static final byte SESSION_PREFERRED
public static final byte COMMAND_TYPE_INPUT
public static final byte COMMAND_TYPE_OUTPUT
Constructor Detail |
public Command(long cmd, CommandCompleteListener ccl)
cmd
- - command code for Commandccl
- - command complete listenerpublic Command(long cmd)
cmd
- - command code for Commandpublic Command(Command cmd)
cmd
- - Command instance to copy into CommandMethod Detail |
public long CommandCode()
public void SetCommandCode(long cc)
cc
- - command code for Commandpublic long ReturnCode()
public void SetReturnCode(long rc)
rc
- - command code for Commandpublic byte SessionMode()
public void SetSessionMode(byte sm)
public boolean SessionHold()
public void SetSessionHold(boolean b)
public boolean SessionRelease()
public void SetSessionRelease(boolean b)
public int SessionWaitTime()
public void SetSessionWaitTime(int t)
public int NumInputParms()
public int NumOutputParms()
public void AttachInputParm(byte[] data)
data
- - byte array to be accessedpublic void AddInputParm(byte[] data, int start, int length)
data
- - byte array for inputstart
- - index of first character in arraylength
- - number of characters in array to copypublic void AddInputParm(byte[] data)
data
- - byte array for inputpublic static byte[] CompressObject(java.lang.Object obj) throws java.io.NotSerializableException
obj
- - Object to be serialized and compressed
java.io.NotSerializableException
- if object cannot be serializedpublic void AddObjectAsInputParm(java.lang.Object obj) throws java.io.NotSerializableException
obj
- - instance of a Serializable or Externalizable object
java.io.NotSerializableException
- if object cannot be serializedpublic void AttachOutputParm(byte[] data)
data
- - byte array to be accessedpublic void AddOutputParm(byte[] data, int start, int length)
data
- - byte array for outputstart
- - index of first character in arraylength
- - number of characters in array to copypublic void AddOutputParm(byte[] data)
data
- - byte array for outputpublic void AddObjectAsOutputParm(java.lang.Object obj) throws java.io.NotSerializableException
obj
- - instance of a Serializable or Externalizable object
java.io.NotSerializableException
- if object cannot be serializedpublic static java.lang.Object DecompressObject(byte[] buf) throws java.io.ObjectStreamException, java.lang.ClassNotFoundException
buf
- - Byte array containing data for object
java.io.ObjectStreamException
- if object extraction fails
java.lang.ClassNotFoundException
- if cannot find class for objectpublic byte[] InputParm(int index)
index
- - parameter index to request
public java.lang.Object GetObjectFromInputParm(int index) throws java.io.ObjectStreamException, java.lang.ClassNotFoundException
index
- - parameter index to request
java.io.ObjectStreamException
- if object extraction fails
java.lang.ClassNotFoundException
- if cannot find class for objectpublic byte[] OutputParm(int index)
index
- - parameter index to request
public java.lang.Object GetObjectFromOutputParm(int index) throws java.io.ObjectStreamException, java.lang.ClassNotFoundException
index
- - parameter index to request
java.io.ObjectStreamException
- if object extraction fails
java.lang.ClassNotFoundException
- if cannot find class for objectpublic int InputParmLength(int index)
index
- - parameter index to request
public int OutputParmLength(int index)
index
- - parameter index to request
public byte[] DetachInputParm(int index)
index
- - index of input parameter to detach
public byte[] DetachOutputParm(int index)
index
- - index of output parameter to detach
public java.lang.String DestinationAddress()
public void SetDestinationAddress(java.lang.String dest)
dest
- - destination address stringpublic java.lang.String ReturnAddress()
public void SetReturnAddress(java.lang.String addr)
addr
- - return address stringpublic java.lang.String RootDestinationAddress()
public java.lang.String RootReturnAddress()
public void ResetInput()
public void ResetOutput()
public void ResetIndex()
public byte[] InputParm()
public byte[] OutputParm()
public byte[] MakeFlatOutputBuffer(int offset)
offset
- - offset in byte array of start of output buffer
public byte[] MakeFlatInputBuffer(int offset)
offset
- - offset in byte array of start of output buffer
public boolean UseFlatOutputBuffer(byte[] buf, int off)
buf
- - byte array containing command packetoff
- - offset of start of command packet in buf
public boolean UseFlatInputBuffer(byte[] buf, int off)
public static void FreeBuffer(byte[] buf)
buf
- - byte arraypublic static byte[] AllocateBuffer(int len)
len
- - length of buffer, in bytes
public boolean IsFlatOutputBuffer(byte[] buf, int off)
buf
- - byte array containing packetoff
- - offset in byte array of packet
public boolean IsFlatInputBuffer(byte[] buf, int off)
buf
- - byte array containing packetoff
- - offset in byte array of packet
public void SetNewID()
public final long CmdId()
public void CommandComplete()
public final void SetTimeOut(int msec)
msec
- - timeout, in millisecondspublic final int TimeOut()
public final void setCmdType(byte type)
type
- - type of commandpublic final byte getCmdType()
public void setCmdTypeInput()
public void setCmdTypeOutput()
public final void setSenderServiceNode(ServiceNode sn)
sn
- - ServiceNode which is sending the Commandpublic final ServiceNode getSenderServiceNode()
public final void PostponeReply()
public final boolean IsPostponedReply()
public final void FreeInputsAfterSend()
public void setCommandCompleteListener(CommandCompleteListener ccl)
ccl
- - command complete listenerpublic static final java.lang.String hexDump(java.lang.String indent, byte[] data)
public static final java.lang.String ReturnCodeToString(long rc)
public static final void debugPrint(Command cmd)
public java.lang.String toString()
public void addToDebugStrings(Vect msglist, java.lang.Thread cur_thrd) throws java.lang.Exception
msglist
- - Vect of messages : new text lines should be added using addElement()cur_thrd
- - Thread which the print stack is being generated for (may not be current thread)
java.lang.Exception
- if any error occurspublic java.lang.String commandCodeDebugString()
public void setCommandCodeDebugString(java.lang.String ccds)
ccds
- - command code debug string for Command
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |