com.eyebolt.iplib
Class IPMessage

java.lang.Object
  |
  +--com.eyebolt.iplib.IPMessage

public class IPMessage
extends java.lang.Object

Message for transmission by ipmanager

Version:
0.01, 6 Jan 1997
Author:
John Gardner

Field Summary
(package private)  byte[] bytes
          content
static int CORRUPT
          Description of the Field
static int DISCONNECTED
          Description of the Field
(package private)  MessageHeader header
          header for this message
static int INVALID
          Description of the Field
(package private) static int nextMessageId
          Class variable message counter
static int NOTREADY
          Description of the Field
(package private)  boolean replyExpected
          If true, this message expects a reply
(package private)  int status
          status of message
static int TIMEOUT
          Description of the Field
static int VALID
          Description of the Field
 
Constructor Summary
  IPMessage()
          Construct a IPMessage
(package private) IPMessage(byte[] buf)
          Method for unflattening a message
 
Method Summary
 void dump(java.io.PrintStream out)
          Dump the contents of this message to an output stream.
 void flattenAt(byte[] buf)
          Serializes this message into a byte array
(package private)  MessageHeader getHeader()
          Gets the Header attribute of the IPMessage object
 int getLen()
          Gets the Len attribute of the IPMessage object
 int getMid()
          Gets the Mid attribute of the IPMessage object
 int getMsg(byte[] buf)
          Gets the content of the message as a byte array.
 byte[] getMsgBytes()
          Gets the content of the message as a byte array.
static int getNextMessageId()
          Get the next message id in the sequence.
(package private)  boolean getReplyExpected()
          Gets the ReplyExpected attribute of the IPMessage object
(package private)  int getResponseId()
          Fetch the message ResponseId
 int getStatus()
          Gets the Status attribute of the IPMessage object
 int getTotalLen()
          Gets the TotalLen attribute of the IPMessage object
 int moveMsg(IPMessage oldmsg)
          Deprecated. Not implemented in Java
 int putMsg(byte[] buf)
          Fill this message with the supplied byte array.
 int putMsg(byte[] buf, int len)
          Fill this message with the buffer supplied, up to the length provided.
 int reset()
          Description of the Method
(package private)  void setHeader(MessageHeader header)
          Sets the Header attribute of the IPMessage object
 void setMid(int newid)
          Sets the Mid attribute of the IPMessage object
(package private)  void setReplyExpected(boolean replyExpected)
          Sets the ReplyExpected attribute of the IPMessage object
 void setStatus(int newstat)
          Sets the Status attribute of the IPMessage object
 java.lang.String toString()
          Build a string describing the header values.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

NOTREADY

public static final int NOTREADY
Description of the Field

VALID

public static final int VALID
Description of the Field

INVALID

public static final int INVALID
Description of the Field

TIMEOUT

public static final int TIMEOUT
Description of the Field

CORRUPT

public static final int CORRUPT
Description of the Field

DISCONNECTED

public static final int DISCONNECTED
Description of the Field

header

MessageHeader header
header for this message

bytes

byte[] bytes
content

status

int status
status of message

replyExpected

boolean replyExpected
If true, this message expects a reply

nextMessageId

static int nextMessageId
Class variable message counter
Constructor Detail

IPMessage

public IPMessage()
Construct a IPMessage

IPMessage

IPMessage(byte[] buf)
Method for unflattening a message
Parameters:
buf - byte array containing the message
Method Detail

setStatus

public void setStatus(int newstat)
Sets the Status attribute of the IPMessage object
Parameters:
newstat - The new Status value

setMid

public void setMid(int newid)
Sets the Mid attribute of the IPMessage object
Parameters:
newid - The new Mid value

getMid

public int getMid()
Gets the Mid attribute of the IPMessage object
Returns:
The Mid value

getResponseId

int getResponseId()
Fetch the message ResponseId
Returns:
The ResponseId value

getStatus

public int getStatus()
Gets the Status attribute of the IPMessage object
Returns:
The Status value

getLen

public int getLen()
Gets the Len attribute of the IPMessage object
Returns:
The Len value

getTotalLen

public int getTotalLen()
Gets the TotalLen attribute of the IPMessage object
Returns:
The TotalLen value

getMsg

public int getMsg(byte[] buf)
Gets the content of the message as a byte array.
Parameters:
buf - Description of Parameter
Returns:
The Msg value

getMsgBytes

public byte[] getMsgBytes()
Gets the content of the message as a byte array.
Returns:
byte array of the contents of the message.

moveMsg

public int moveMsg(IPMessage oldmsg)
Deprecated. Not implemented in Java

This is a legacy method.
Parameters:
oldmsg - Description of Parameter
Returns:
Description of the Returned Value

putMsg

public int putMsg(byte[] buf)
Fill this message with the supplied byte array.
Parameters:
buf - Description of Parameter
Returns:
Description of the Returned Value

putMsg

public int putMsg(byte[] buf,
                  int len)
Fill this message with the buffer supplied, up to the length provided.
Parameters:
buf - buffer to insert in the message
len - # of bytes to use
Returns:
an error code, if an error occurs.

reset

public int reset()
Description of the Method
Returns:
Description of the Returned Value

flattenAt

public void flattenAt(byte[] buf)
Serializes this message into a byte array
Parameters:
buf - Description of Parameter

toString

public java.lang.String toString()
Build a string describing the header values.
Overrides:
toString in class java.lang.Object
Returns:
string of the header for this message

dump

public void dump(java.io.PrintStream out)
Dump the contents of this message to an output stream.
Parameters:
out - a PrintStream to send dump

getNextMessageId

public static int getNextMessageId()
Get the next message id in the sequence.
Returns:
a message id

setHeader

void setHeader(MessageHeader header)
Sets the Header attribute of the IPMessage object
Parameters:
newid - The new Header value

getHeader

MessageHeader getHeader()
Gets the Header attribute of the IPMessage object
Returns:
The Header value

setReplyExpected

void setReplyExpected(boolean replyExpected)
Sets the ReplyExpected attribute of the IPMessage object
Parameters:
replyExpected - if true, this message will expect a reply

getReplyExpected

boolean getReplyExpected()
Gets the ReplyExpected attribute of the IPMessage object
Returns:
The ReplyExpected value


Copyright © 2001 Eyebolt, Inc.