Class SimpleObjectRegistry
- java.lang.Object
-
- org.opendaylight.protocol.pcep.spi.pojo.SimpleObjectRegistry
-
- All Implemented Interfaces:
ObjectRegistry,VendorInformationObjectRegistry
public final class SimpleObjectRegistry extends Object implements ObjectRegistry
-
-
Constructor Summary
Constructors Constructor Description SimpleObjectRegistry(VendorInformationObjectRegistry viRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectparseObject(int objectClass, int objectType, ObjectHeader header, io.netty.buffer.ByteBuf buffer)Finds parser for given object type and class in the registry.Optional<? extends Object>parseVendorInformationObject(EnterpriseNumber enterpriseNumber, ObjectHeader header, io.netty.buffer.ByteBuf buffer)org.opendaylight.yangtools.concepts.RegistrationregisterObjectParser(int objectClass, int objectType, ObjectParser parser)org.opendaylight.yangtools.concepts.RegistrationregisterObjectSerializer(Class<? extends Object> objClass, ObjectSerializer serializer)voidserializeObject(Object object, io.netty.buffer.ByteBuf buffer)Find serializer for given object.voidserializeVendorInformationObject(VendorInformationObject viObject, io.netty.buffer.ByteBuf buffer)
-
-
-
Constructor Detail
-
SimpleObjectRegistry
public SimpleObjectRegistry(VendorInformationObjectRegistry viRegistry)
-
-
Method Detail
-
registerObjectParser
public org.opendaylight.yangtools.concepts.Registration registerObjectParser(int objectClass, int objectType, ObjectParser parser)
-
registerObjectSerializer
public org.opendaylight.yangtools.concepts.Registration registerObjectSerializer(Class<? extends Object> objClass, ObjectSerializer serializer)
-
parseObject
public Object parseObject(int objectClass, int objectType, ObjectHeader header, io.netty.buffer.ByteBuf buffer) throws PCEPDeserializerException
Description copied from interface:ObjectRegistryFinds parser for given object type and class in the registry. Delegates parsing to found parser.- Specified by:
parseObjectin interfaceObjectRegistry- Parameters:
objectClass- object classobjectType- object typeheader- ObjectHeaderbuffer- object wrapped in ByteBuf- Returns:
- null if the parser for this object could not be found
- Throws:
PCEPDeserializerException- if the parsing did not succeed
-
serializeObject
public void serializeObject(Object object, io.netty.buffer.ByteBuf buffer)
Description copied from interface:ObjectRegistryFind serializer for given object. Delegates parsing to found serializer.- Specified by:
serializeObjectin interfaceObjectRegistry- Parameters:
object- to be parsedbuffer- ByteBuf wrapped around bytes representing given object
-
parseVendorInformationObject
public Optional<? extends Object> parseVendorInformationObject(EnterpriseNumber enterpriseNumber, ObjectHeader header, io.netty.buffer.ByteBuf buffer) throws PCEPDeserializerException
- Specified by:
parseVendorInformationObjectin interfaceVendorInformationObjectRegistry- Throws:
PCEPDeserializerException
-
serializeVendorInformationObject
public void serializeVendorInformationObject(VendorInformationObject viObject, io.netty.buffer.ByteBuf buffer)
- Specified by:
serializeVendorInformationObjectin interfaceVendorInformationObjectRegistry
-
-