org.sblim.slp.internal.msg
Class MsgHeader

java.lang.Object
  extended by org.sblim.slp.internal.msg.MsgHeader
All Implemented Interfaces:
FunctionIDs

public class MsgHeader
extends java.lang.Object
implements FunctionIDs

MsgHeader


Field Summary
static int FRESH
          FRESH
static int MCAST
          MCAST
static int OVERFLOW
          OVERFLOW
static int RAW_HDR_LEN
          RAW_HDR_LEN
static byte VERSION
          VERSION
 
Fields inherited from interface org.sblim.slp.internal.msg.FunctionIDs
ATTR_RPLY, ATTR_RQST, DA_ADVERT, FIRST_ID, LAST_ID, SA_ADVERT, SRV_ACK, SRV_DEREG, SRV_REG, SRV_RPLY, SRV_RQST, SRV_TYPE_RPLY, SRV_TYPE_RQST
 
Constructor Summary
MsgHeader(int pVersion, int pFunctionID, java.lang.String pLangTag, boolean pOverflow, boolean pFresh, boolean pMCast, int pXID)
          Ctor.
MsgHeader(MsgHeader pHdr)
          Ctor.
 
Method Summary
 boolean fresh()
          fresh
 int getFunctionID()
          getFunctionID
 java.lang.String getLangTag()
          getLangTag
 int getSize()
          getSize
 int getVersion()
          getVersion
 int getXID()
           
 boolean multicast()
          multicast
 boolean overflows()
          overflows
static MsgHeader parse(SLPInputStream pInStr)
          parse
 byte[] serialize(int pBodyLength, boolean pOverflow, boolean pSetMultiCastFlag, boolean pKeepXID)
          serialize
 void setXID(int pXID)
          The response have to contain the same XID of the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final byte VERSION
VERSION

See Also:
Constant Field Values

RAW_HDR_LEN

public static final int RAW_HDR_LEN
RAW_HDR_LEN

See Also:
Constant Field Values

OVERFLOW

public static final int OVERFLOW
OVERFLOW

See Also:
Constant Field Values

FRESH

public static final int FRESH
FRESH

See Also:
Constant Field Values

MCAST

public static final int MCAST
MCAST

See Also:
Constant Field Values
Constructor Detail

MsgHeader

public MsgHeader(MsgHeader pHdr)
Ctor.

Parameters:
pHdr -

MsgHeader

public MsgHeader(int pVersion,
                 int pFunctionID,
                 java.lang.String pLangTag,
                 boolean pOverflow,
                 boolean pFresh,
                 boolean pMCast,
                 int pXID)
Ctor.

Parameters:
pVersion -
pFunctionID -
pLangTag -
pOverflow -
pFresh -
pMCast -
pXID -
Method Detail

parse

public static MsgHeader parse(SLPInputStream pInStr)
                       throws ServiceLocationException,
                              java.io.IOException
parse

Parameters:
pInStr -
Returns:
MsgHeader
Throws:
ServiceLocationException
java.io.IOException

getVersion

public int getVersion()
getVersion

Returns:
int

getFunctionID

public int getFunctionID()
getFunctionID

Returns:
int

getLangTag

public java.lang.String getLangTag()
getLangTag

Returns:
int

overflows

public boolean overflows()
overflows

Returns:
boolean

fresh

public boolean fresh()
fresh

Returns:
boolean

multicast

public boolean multicast()
multicast

Returns:
boolean

getXID

public int getXID()
Returns:
the XID which is parsed from the message. serialize() doesn't use this value, that serializes a new XID into the stream at every call (unless pKeepXID is setted).

setXID

public void setXID(int pXID)
The response have to contain the same XID of the request. So this setter can be useful.

Parameters:
pXID -

getSize

public int getSize()
getSize

Returns:
int

serialize

public byte[] serialize(int pBodyLength,
                        boolean pOverflow,
                        boolean pSetMultiCastFlag,
                        boolean pKeepXID)
serialize

Parameters:
pBodyLength -
pOverflow -
pSetMultiCastFlag -
pKeepXID -
Returns:
byte[]


Copyright © 2005, 2008 IBM Corporation. All Rights Reserved.