|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object dk.i1.diameter.AVP
public class AVP
A Diameter AVP. See RFC3588 section 4 for details. An AVP consists of a code, some flags, an optional vendor ID, and a payload.
The payload is not checked for correct size and content until you try to construct one of its subclasses from it. Eg
AVP avp = ...
try {
int application_id = new AVP_Unsigned32(avp).queryValue());
...
} catch(InvalidAVPLengthException
ex) {
..
}
ProtocolConstants
Field Summary | |
---|---|
int |
code
The AVP code |
int |
vendor_id
The vendor ID. |
Constructor Summary | |
---|---|
AVP()
Default constructor The code and vendor_id are initialized to 0, no flags are set, and the payload is null. |
|
AVP(AVP a)
Copy constructor (deep copy) |
|
AVP(int code,
byte[] payload)
Create AVP with code and payload |
|
AVP(int code,
int vendor_id,
byte[] payload)
Create AVP with code and payload |
Method Summary | |
---|---|
boolean |
isMandatory()
Returns if the mandatory (M) flag is set |
boolean |
isPrivate()
Returns if the private (P) flag is set |
boolean |
isVendorSpecific()
Returns if the AVP is vendor-specific (has non-zero vendor_id) |
byte[] |
queryPayload()
Returns the payload of the AVP Returns a copy of the (unpadded) payload of the AVP in network byte order. |
AVP |
setM()
Sets the M-bit and returns the instance. |
void |
setMandatory(boolean b)
Sets/unsets the mandatory (M) flag |
void |
setPrivate(boolean b)
Sets/unsets the private (P) flag |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int code
public int vendor_id
Constructor Detail |
---|
public AVP()
public AVP(AVP a)
public AVP(int code, byte[] payload)
code
- payload
- public AVP(int code, int vendor_id, byte[] payload)
code
- vendor_id
- payload
- Method Detail |
---|
public byte[] queryPayload()
public boolean isVendorSpecific()
public boolean isMandatory()
public boolean isPrivate()
public void setMandatory(boolean b)
public void setPrivate(boolean b)
public AVP setM()
ccr.add(new AVP_Grouped(ProtocolConstants.DI_REQUESTED_SERVICE_UNIT, new AVP[] {new AVP_Unsigned64(ProtocolConstants.DI_CC_SERVICE_SPECIFIC_UNITS,42).setM()} ) );where the alternative would have been more cumbersome:
AVP tmp-avp = new AVP_Unsigned64(ProtocolConstants.DI_CC_SERVICE_SPECIFIC_UNITS,42); tmp_avp.setMandatory(true); ccr.add(new AVP_Grouped(ProtocolConstants.DI_REQUESTED_SERVICE_UNIT, new AVP[] {tmp_avp} ) );
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |