|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.uc3m.it.pfc.pdp.PDPMessage
The PDPMessage class implements the mechanism to create, manage and parse all available PDP messages.
It provides mechanisms to create new messages from basic data types, convert it into byte arrays to adapt them to be sent through the network, and read an parse messages received from the network.
Field Summary | |
private boolean |
any
"Any" message flag field. |
private ServiceEntry[] |
entry
ServiceEntryList/PRList field form a PDP message |
private byte |
function_id
Function ID header field |
private static int |
MAXIMUN_MESSAGE_LENGTH
Maximun length in bytes for a PDP message |
private static byte |
MINIMUN_MESSAGE_LENGTH
Minimun length in bytes for a PDP message |
private boolean |
overflow
Overflow flag. |
protected static byte |
PDP_SERVICE_DEREGISTER
Identifier for PDP ServiceDeregister messages |
protected static byte |
PDP_SERVICE_REPLY
Identifier for PDP ServiceReply messages |
protected static byte |
PDP_SERVICE_REQUEST
Identifier for PDP ServiceRequest messages |
static byte |
PDP_VERSION
Version 1.0 |
private java.lang.String |
service_type
ServiceType field from a ServiceRequest message |
private int |
xid
XID header field. |
Constructor Summary | |
protected |
PDPMessage(byte[] data)
Constructor. |
protected |
PDPMessage(int xid,
java.lang.String service_type,
java.util.Vector pr_list,
boolean any)
Constructor. |
protected |
PDPMessage(int xid,
java.util.Vector entry)
Constructor. |
private |
PDPMessage(int xid,
java.util.Vector entry,
byte id)
Private Constructor. |
protected |
PDPMessage(java.util.Vector entry)
Constructor. |
Method Summary | |
protected byte[] |
getBytes()
Translates this objecto into a byte array to send this PDP message through the network |
private byte[] |
getEntryBytes()
Returns a byte array cotainning the information stored on the entry field |
private byte |
getFlags()
Returns the flags header field form this PDP message |
protected byte |
getFunctionID()
Returns the functionID header field of this PDP message. |
protected ServiceEntry[] |
getPrList()
Returns the PRList field from a PDPServiceRequest message |
protected ServiceEntry[] |
getServiceEntry()
Returns the ServiceEntry list within an array |
protected java.lang.String |
getServiceType()
Returns the serviceType field from a PDPServiceRequest message |
protected int |
getXID()
Returns the xid header field from the PDP message. |
protected boolean |
isAny()
Returns whether the message is set as a 1-request 1-reply or not. |
private void |
newEntry(java.util.Vector v,
int i)
Fills entry field from the information given on
the parameters |
protected void |
setXid(int xid)
Sets the xid on this PDP message |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte PDP_VERSION
protected static final byte PDP_SERVICE_REQUEST
protected static final byte PDP_SERVICE_REPLY
protected static final byte PDP_SERVICE_DEREGISTER
private static final byte MINIMUN_MESSAGE_LENGTH
private static final int MAXIMUN_MESSAGE_LENGTH
private byte function_id
private boolean overflow
true
whether the entry message does
not fit within one single datagram.
private boolean any
true
it specifies a
1-request 1-reply type message
private int xid
private java.lang.String service_type
private ServiceEntry[] entry
Constructor Detail |
protected PDPMessage(int xid, java.lang.String service_type, java.util.Vector pr_list, boolean any) throws PDPException
xid
- XID message field that identifies every
ServiceRequest messageservice_type
- Type of service to discover on the networkpr_list
- Vector of already known services of
the type of service requested on the messageany
- Any flag field that identifies tye type of the request
sent to the network. When true
this request
is a 1-request 1-reply message typeprotected PDPMessage(int xid, java.util.Vector entry) throws PDPException
( int, Vector, byte )
Constructor.
xid
- XID message field that identifies every
ServiceReply messageentry
- Vector of services stored on the messageprotected PDPMessage(java.util.Vector entry) throws PDPException
( Vector )
Constructor.
entry
- Vector of services stored on the messageprivate PDPMessage(int xid, java.util.Vector entry, byte id) throws PDPException
( int, Vector )
) or
ServiceDeregister (see ( Vector )
)
message to be sent throgh the network.
xid
- XID message field that identifies every
ServiceReply message. On a ServiceDeregister message
this field is set to 0x00entry
- Vector of services stored on the messageid
- FunctionID header field messageprotected PDPMessage(byte[] data) throws PDPException
data
- Byte array with the message received from the networkMethod Detail |
protected boolean isAny()
protected ServiceEntry[] getServiceEntry()
protected byte getFunctionID()
protected ServiceEntry[] getPrList()
protected java.lang.String getServiceType()
protected int getXID()
protected void setXid(int xid)
xid
- The xid to setprivate byte getFlags()
protected byte[] getBytes()
private void newEntry(java.util.Vector v, int i)
entry
field from the information given on
the parameters
v
- Vector of ServiceEntry
objects to add on the
entry
fieldi
- number of elements of the vector to add on the
entry
fieldprivate byte[] getEntryBytes()
entry
field
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |