org.sblim.slp.internal.msg

Class MsgHeader

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, String pLangTag, boolean pOverflow, boolean pFresh, boolean pMCast, int pXID)
Ctor.
MsgHeader(MsgHeader pHdr)
Ctor.

Method Summary

boolean
fresh()
fresh
int
getFunctionID()
getFunctionID
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.

Field Details

FRESH

public static final int FRESH
FRESH
Field Value:
16384

MCAST

public static final int MCAST
MCAST
Field Value:
8192

OVERFLOW

public static final int OVERFLOW
OVERFLOW
Field Value:
32768

RAW_HDR_LEN

public static final int RAW_HDR_LEN
RAW_HDR_LEN
Field Value:
14

VERSION

public static final byte VERSION
VERSION
Field Value:
2

Constructor Details

MsgHeader

public MsgHeader(int pVersion,
                 int pFunctionID,
                 String pLangTag,
                 boolean pOverflow,
                 boolean pFresh,
                 boolean pMCast,
                 int pXID)
Ctor.
Parameters:
pVersion -
pFunctionID -
pLangTag -
pOverflow -
pFresh -
pMCast -
pXID -

MsgHeader

public MsgHeader(MsgHeader pHdr)
Ctor.
Parameters:
pHdr -

Method Details

fresh

public boolean fresh()
fresh
Returns:
boolean

getFunctionID

public int getFunctionID()
getFunctionID
Returns:
int

getLangTag

public String getLangTag()
getLangTag
Returns:
int

getSize

public int getSize()
getSize
Returns:
int

getVersion

public int getVersion()
getVersion
Returns:
int

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).

multicast

public boolean multicast()
multicast
Returns:
boolean

overflows

public boolean overflows()
overflows
Returns:
boolean

parse

public static MsgHeader parse(SLPInputStream pInStr)
            throws ServiceLocationException,
                   IOException
parse
Parameters:
pInStr -
Returns:
MsgHeader

serialize

public byte[] serialize(int pBodyLength,
                        boolean pOverflow,
                        boolean pSetMultiCastFlag,
                        boolean pKeepXID)
serialize
Parameters:
pBodyLength -
pOverflow -
pSetMultiCastFlag -
pKeepXID -
Returns:
byte[]

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 -

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