com.solers.slp
Class SLPMessage

java.lang.Object
  |
  +--com.solers.slp.SLPMessage
Direct Known Subclasses:
ServiceDeregistration, ServiceRegistration, UAMessage

abstract class SLPMessage
extends Object

SLPMessage is the base for all messages sent from the SLP client.

Author:
Patrick Callis

Field Summary
private  Locale _locale
           
private  byte _msgType
           
private  short _xid
           
static byte ATTRRPLY
           
static byte ATTRRQST
           
static byte DAADVERT
           
static byte SAADVERT
           
static byte SRVACK
           
static byte SRVDEREG
           
static byte SRVREG
           
static byte SRVRPLY
           
static byte SRVRQST
           
static byte SRVTYPERPLY
           
static byte SRVTYPERQST
           
 
Constructor Summary
(package private) SLPMessage(Locale locale, byte msgType)
           
 
Method Summary
protected abstract  int calcSize()
          Implemented by subclasses to return the size required by the body of the message.
(package private)  short getXid()
          Gets the XID this message was sent with.
(package private)  void setXid(short xid)
          Sets the XID that this message was sent with.
abstract  String toString()
           
protected abstract  void writeBody(DataOutput out)
          Implemented by subclasses to write the message body to a DataOutput.
private  boolean writeHeader(DataOutput out, int bodySize)
          Writes the standard SLP header to a DataOutput.
(package private)  boolean writeMessage(DataOutput out)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

_locale

private Locale _locale

_msgType

private byte _msgType

_xid

private short _xid

SRVRQST

public static final byte SRVRQST

SRVRPLY

public static final byte SRVRPLY

SRVREG

public static final byte SRVREG

SRVDEREG

public static final byte SRVDEREG

SRVACK

public static final byte SRVACK

ATTRRQST

public static final byte ATTRRQST

ATTRRPLY

public static final byte ATTRRPLY

DAADVERT

public static final byte DAADVERT

SRVTYPERQST

public static final byte SRVTYPERQST

SRVTYPERPLY

public static final byte SRVTYPERPLY

SAADVERT

public static final byte SAADVERT
Constructor Detail

SLPMessage

SLPMessage(Locale locale,
           byte msgType)
Method Detail

setXid

void setXid(short xid)
Sets the XID that this message was sent with.

getXid

short getXid()
Gets the XID this message was sent with.

writeMessage

boolean writeMessage(DataOutput out)
               throws IOException

calcSize

protected abstract int calcSize()
Implemented by subclasses to return the size required by the body of the message.

writeBody

protected abstract void writeBody(DataOutput out)
                           throws IOException
Implemented by subclasses to write the message body to a DataOutput. The number of bytes written should be equal to calcSize()

writeHeader

private boolean writeHeader(DataOutput out,
                            int bodySize)
                     throws IOException
Writes the standard SLP header to a DataOutput.

toString

public abstract String toString()
Overrides:
toString in class Object