Package org.sblim.slp.internal.msg
Class MsgHeader
- java.lang.Object
-
- org.sblim.slp.internal.msg.MsgHeader
-
- All Implemented Interfaces:
FunctionIDs
public class MsgHeader extends java.lang.Object implements FunctionIDs
MsgHeader
-
-
Field Summary
Fields Modifier and Type Field Description static int
FRESH
FRESHstatic int
MCAST
MCASTstatic int
OVERFLOW
OVERFLOWstatic int
RAW_HDR_LEN
RAW_HDR_LENstatic 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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
fresh()
freshint
getFunctionID()
getFunctionIDjava.lang.String
getLangTag()
getLangTagint
getSize()
getSizeint
getVersion()
getVersionint
getXID()
boolean
multicast()
multicastboolean
overflows()
overflowsstatic MsgHeader
parse(SLPInputStream pInStr)
parsebyte[]
serialize(int pBodyLength, boolean pOverflow, boolean pSetMultiCastFlag, boolean pKeepXID)
serializevoid
setXID(int pXID)
The response have to contain the same XID of the request.
-
-
-
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[]
-
-