org.sblim.slp.internal

Class ServiceLocationHeader

Implemented Interfaces:
Cloneable, ServiceLocationMessage
Known Direct Subclasses:
SLPHeaderV2

public abstract class ServiceLocationHeader
extends java.lang.Object
implements ServiceLocationMessage, Cloneable

ServiceLocationHeader.java (C) Copyright IBM Corp. 2005, 2006 THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. You can obtain a current copy of the Common Public License from http://www.opensource.org/licenses/cpl1.0.php

Field Summary

static int
ATTRRPLY
static int
ATTRRQST
static int
DAADVERT
static int
SAADVERT
static int
SRVACK
static int
SRVDEREG
static int
SRVREG
static int
SRVRPLY
static int
SRVRQST
static int
SRVTYPERPLY
static int
SRVTYPERQST

Constructor Summary

ServiceLocationHeader()

Method Summary

void
addPreviousResponder(InetAddress pInetAddress)
Object
clone()
static String
getBytesString(byte[] pBuffer, String pEncoding)
short
getErrorCode()
Getter for errorCode
int
getFunctionCode()
Getter for functionCode
ServiceLocationHeader
getHeader()
int
getInt(DataInputStream pStream)
protected int
getInt24(DataInputStream pStream)
static int
getInteger(DataInputStream pStream)
int
getLength()
Getter for length
Locale
getLocale()
Getter for locale
int
getNumberOfBytes()
Getter for numberOfBytes
int
getNumberOfReplies()
Getter for numberOfReplies
int
getPacketLength()
Getter for packetLength
byte[]
getPayload()
Getter for payload
Vector
getPreviousResponse()
Getter for previousResponse
Vector
getScopes()
Getter for scopes
byte[]
getString(StringBuffer pBuffer, DataInputStream pStream)
static byte[]
getStringField(StringBuffer pBuffer, DataInputStream pStream, String pString)
static short
getUniqueXID()
int
getVersion()
Getter for version
short
getXid()
Getter for xid
void
incrementNumberOfBytes(int pIncrement)
boolean
isFresh()
Getter for fresh
boolean
isMCast()
Getter for mCast
boolean
isOverflow()
Getter for overflow
ServiceLocationMessage
makeErrorReply(Exception pException)
abstract void
parseHeader(int pFunctionCode, DataInputStream pStream)
abstract ServiceLocationMessage
parseMsg(DataInputStream pStream)
abstract void
parseOptions(DataInputStream pStream)
void
putInt(int pValue, ByteArrayOutputStream pStream)
protected void
putInt24(int pValue, ByteArrayOutputStream pStream)
static void
putInteger(int pValue, ByteArrayOutputStream pStream)
byte[]
putString(String pValue, ByteArrayOutputStream pStream)
static byte[]
putStringField(String pString, ByteArrayOutputStream pStream, String pEncoding)
abstract void
serialize(ByteArrayOutputStream pStream, boolean pUsingMCast, boolean pUsingStreams)
protected byte[]
serializeCommaSeparatedList(Vector pList, ByteArrayOutputStream pStream)
void
setErrorCode(short pErrorCode)
Setter for errorCode
void
setFresh(boolean pFresh)
Setter for fresh
void
setFunctionCode(int pFunctionCode)
Setter for functionCode
void
setLength(int pLength)
Setter for length
void
setLocale(Locale pLocale)
Setter for locale
void
setMCast(boolean pCast)
Setter for mCast
void
setNumberOfBytes(int pNumberOfBytes)
Setter for numberOfBytes
void
setNumberOfReplies(int pNumberOfReplies)
Setter for numberOfReplies
void
setOverflow(boolean pOverflow)
Setter for overflow
void
setPacketLength(int pPacketLength)
Setter for packetLength
void
setPayload(byte[] pPayload)
Setter for payload
void
setPreviousResponse(Vector pPreviousResponse)
Setter for previousResponse
void
setScopes(Vector pScopes)
Setter for scopes
void
setVersion(int pVersion)
Setter for version
void
setXid(short pXid)
Setter for xid
String
toString()

Field Details

ATTRRPLY

public static final int ATTRRPLY
Field Value:
7

ATTRRQST

public static final int ATTRRQST
Field Value:
6

DAADVERT

public static final int DAADVERT
Field Value:
8

SAADVERT

public static final int SAADVERT
Field Value:
11

SRVACK

public static final int SRVACK
Field Value:
5

SRVDEREG

public static final int SRVDEREG
Field Value:
4

SRVREG

public static final int SRVREG
Field Value:
3

SRVRPLY

public static final int SRVRPLY
Field Value:
2

SRVRQST

public static final int SRVRQST
Field Value:
1

SRVTYPERPLY

public static final int SRVTYPERPLY
Field Value:
10

SRVTYPERQST

public static final int SRVTYPERQST
Field Value:
9

Constructor Details

ServiceLocationHeader

public ServiceLocationHeader()

Method Details

addPreviousResponder

public void addPreviousResponder(InetAddress pInetAddress)

clone

public Object clone()
            throws CloneNotSupportedException

getBytesString

public static String getBytesString(byte[] pBuffer,
                                    String pEncoding)

getErrorCode

public short getErrorCode()
Getter for errorCode
Specified by:
getErrorCode in interface ServiceLocationMessage
Returns:
Returns the errorCode.

getFunctionCode

public int getFunctionCode()
Getter for functionCode
Returns:
Returns the functionCode.

getHeader

public ServiceLocationHeader getHeader()
Specified by:
getHeader in interface ServiceLocationMessage

getInt

public int getInt(DataInputStream pStream)
            throws ServiceLocationException,
                   IOException

getInt24

protected int getInt24(DataInputStream pStream)
            throws ServiceLocationException,
                   IOException

getInteger

public static int getInteger(DataInputStream pStream)
            throws ServiceLocationException,
                   IOException

getLength

public int getLength()
Getter for length
Returns:
Returns the length.

getLocale

public Locale getLocale()
Getter for locale
Returns:
Returns the locale.

getNumberOfBytes

public int getNumberOfBytes()
Getter for numberOfBytes
Returns:
Returns the numberOfBytes.

getNumberOfReplies

public int getNumberOfReplies()
Getter for numberOfReplies
Returns:
Returns the numberOfReplies.

getPacketLength

public int getPacketLength()
Getter for packetLength
Returns:
Returns the packetLength.

getPayload

public byte[] getPayload()
Getter for payload
Returns:
Returns the payload.

getPreviousResponse

public Vector getPreviousResponse()
Getter for previousResponse
Returns:
Returns the previousResponse.

getScopes

public Vector getScopes()
Getter for scopes
Returns:
Returns the scopes.

getString

public byte[] getString(StringBuffer pBuffer,
                        DataInputStream pStream)
            throws ServiceLocationException,
                   IOException

getStringField

public static byte[] getStringField(StringBuffer pBuffer,
                                    DataInputStream pStream,
                                    String pString)
            throws ServiceLocationException,
                   IOException

getUniqueXID

public static short getUniqueXID()

getVersion

public int getVersion()
Getter for version
Returns:
Returns the version.

getXid

public short getXid()
Getter for xid
Returns:
Returns the xid.

incrementNumberOfBytes

public void incrementNumberOfBytes(int pIncrement)

isFresh

public boolean isFresh()
Getter for fresh
Returns:
Returns the fresh.

isMCast

public boolean isMCast()
Getter for mCast
Returns:
Returns the mCast.

isOverflow

public boolean isOverflow()
Getter for overflow
Returns:
Returns the overflow.

makeErrorReply

public ServiceLocationMessage makeErrorReply(Exception pException)

parseHeader

public abstract void parseHeader(int pFunctionCode,
                                 DataInputStream pStream)
            throws ServiceLocationException,
                   IOException,
                   IllegalArgumentException

parseMsg

public abstract ServiceLocationMessage parseMsg(DataInputStream pStream)
            throws ServiceLocationException,
                   IOException,
                   IllegalArgumentException

parseOptions

public abstract void parseOptions(DataInputStream pStream)
            throws ServiceLocationException,
                   IOException,
                   IllegalArgumentException

putInt

public void putInt(int pValue,
                   ByteArrayOutputStream pStream)

putInt24

protected void putInt24(int pValue,
                        ByteArrayOutputStream pStream)

putInteger

public static void putInteger(int pValue,
                              ByteArrayOutputStream pStream)

putString

public byte[] putString(String pValue,
                        ByteArrayOutputStream pStream)

putStringField

public static byte[] putStringField(String pString,
                                    ByteArrayOutputStream pStream,
                                    String pEncoding)

serialize

public abstract void serialize(ByteArrayOutputStream pStream,
                               boolean pUsingMCast,
                               boolean pUsingStreams)
            throws ServiceLocationException

serializeCommaSeparatedList

protected byte[] serializeCommaSeparatedList(Vector pList,
                                             ByteArrayOutputStream pStream)

setErrorCode

public void setErrorCode(short pErrorCode)
Setter for errorCode
Parameters:
pErrorCode - The errorCode to set.

setFresh

public void setFresh(boolean pFresh)
Setter for fresh
Parameters:
pFresh - The fresh to set.

setFunctionCode

public void setFunctionCode(int pFunctionCode)
Setter for functionCode
Parameters:
pFunctionCode - The functionCode to set.

setLength

public void setLength(int pLength)
Setter for length
Parameters:
pLength - The length to set.

setLocale

public void setLocale(Locale pLocale)
Setter for locale
Parameters:
pLocale - The locale to set.

setMCast

public void setMCast(boolean pCast)
Setter for mCast
Parameters:
pCast - The mCast to set.

setNumberOfBytes

public void setNumberOfBytes(int pNumberOfBytes)
Setter for numberOfBytes
Parameters:
pNumberOfBytes - The numberOfBytes to set.

setNumberOfReplies

public void setNumberOfReplies(int pNumberOfReplies)
Setter for numberOfReplies
Parameters:
pNumberOfReplies - The numberOfReplies to set.

setOverflow

public void setOverflow(boolean pOverflow)
Setter for overflow
Parameters:
pOverflow - The overflow to set.

setPacketLength

public void setPacketLength(int pPacketLength)
Setter for packetLength
Parameters:
pPacketLength - The packetLength to set.

setPayload

public void setPayload(byte[] pPayload)
Setter for payload
Parameters:
pPayload - The payload to set.

setPreviousResponse

public void setPreviousResponse(Vector pPreviousResponse)
Setter for previousResponse
Parameters:
pPreviousResponse - The previousResponse to set.

setScopes

public void setScopes(Vector pScopes)
Setter for scopes
Parameters:
pScopes - The scopes to set.

setVersion

public void setVersion(int pVersion)
Setter for version
Parameters:
pVersion - The version to set.

setXid

public void setXid(short pXid)
Setter for xid
Parameters:
pXid - The xid to set.

toString

public String toString()

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