public abstract class PCEPObject extends Object implements PCEPElement
Modifier and Type | Field and Description |
---|---|
protected boolean |
Ibit
I flag (Ignore - 1 bit): the I flag is used by a PCE in a PCRep
message to indicate to a PCC whether or not an optional object was
processed.
|
protected static org.slf4j.Logger |
log |
protected byte[] |
object_bytes
Bytes of the object
|
protected int |
ObjectClass
Object-Class (8 bits): identifies the PCEP object class.
|
protected int |
ObjectLength
Object Length (16 bits): Specifies the total object length including
the header, in bytes.
|
protected int |
OT
OT (Object-Type - 4 bits): identifies the PCEP object type.
|
protected boolean |
Pbit
P flag (Processing-Rule - 1-bit): the P flag allows a PCC to specify
in a PCReq message sent to a PCE whether the object must be taken
into account by the PCE during path computation or is just
optional.
|
protected int |
Res
Res flags (2 bits): Reserved field.
|
Constructor and Description |
---|
PCEPObject()
Constructs a PCEPObject
|
PCEPObject(byte[] bytes,
int offset)
Construct a new PCEP Object from a sequence of bytes.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
decode()
Decode the object.
|
void |
decode(byte[] bytes,
int offset)
Decodes an object from a sequence of bytes starting in offset.
|
void |
decodeHeader()
Decodes the PCEP Object Header
|
void |
encode_header()
Encodes the header of the PCEP object (4 bytes)
|
abstract void |
encode()
Encode the object.
|
boolean |
equals(Object obj) |
byte[] |
getBytes()
Get the bytes of the message.
|
int |
getLength()
Get the object Length.
|
byte[] |
getObject_bytes() |
int |
getObjectClass()
Returns the Object-Class (8 bits) which identifies the PCEP object class.
|
static int |
getObjectClass(byte[] bytes,
int offset)
Static method to obtain the object class of an object encoded in a byte array
|
static int |
getObjectLength(byte[] bytes,
int offset)
Static method to get the length of an object in a sequence of bytes
|
static int |
getObjectType(byte[] bytes,
int offset)
Static method to get the Object type of an object encoded in a byte array
|
int |
getOT() |
int |
getRes() |
int |
hashCode() |
boolean |
isIbit() |
boolean |
isPbit() |
void |
setIbit(boolean ibit) |
void |
setObject_bytes(byte[] object_bytes) |
void |
setObjectClass(int objectClass)
Sets the Object-Class (8 bits) which identifies the PCEP object class.
|
protected void |
setObjectLength(int objectLength) |
void |
setOT(int oT) |
void |
setPbit(boolean pbit) |
void |
setRes(int res) |
static boolean |
supportedObject(int oc) |
protected int ObjectClass
protected int OT
protected int Res
protected boolean Pbit
protected boolean Ibit
protected int ObjectLength
protected byte[] object_bytes
protected static final org.slf4j.Logger log
public PCEPObject()
public PCEPObject(byte[] bytes, int offset) throws MalformedPCEPObjectException
bytes
- offset
- MalformedPCEPObjectException
public abstract void encode()
encode
in interface PCEPElement
public abstract void decode() throws MalformedPCEPObjectException
MalformedPCEPObjectException
public void decode(byte[] bytes, int offset) throws MalformedPCEPObjectException
bytes
- offset
- MalformedPCEPObjectException
public void encode_header()
public void decodeHeader()
public int getObjectClass()
public void setObjectClass(int objectClass)
objectClass
- Object-Classpublic int getOT()
public void setOT(int oT)
oT
- public int getRes()
public void setRes(int res)
res
- public boolean isPbit()
public void setPbit(boolean pbit)
public boolean isIbit()
public void setIbit(boolean ibit)
public int getLength()
getLength
in interface PCEPElement
protected void setObjectLength(int objectLength)
public byte[] getObject_bytes()
public void setObject_bytes(byte[] object_bytes)
public byte[] getBytes()
getBytes
in interface PCEPElement
public static int getObjectClass(byte[] bytes, int offset)
bytes
- Byte array where the object appearsoffset
- Byte where the the object starts in the byte arraypublic static int getObjectType(byte[] bytes, int offset)
bytes
- Byte array where the object appearsoffset
- Byte where the the object starts in the byte arraypublic static int getObjectLength(byte[] bytes, int offset)
bytes
- Byte array where the object appearsoffset
- Byte where the the object starts in the byte arraypublic static boolean supportedObject(int oc)
Copyright © 2016. All rights reserved.