use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.secondary.explicit.route.subobjects.subobject.type.DynamicControlProtectionCase in project bgpcep by opendaylight.
the class SERODynamicProtectionSubobjectParser method serializeSubobject.
@Override
public void serializeSubobject(final SubobjectContainer subobject, final ByteBuf buffer) {
Preconditions.checkArgument(subobject.getSubobjectType() instanceof DynamicControlProtectionCase, "Unknown subobject instance. Passed %s. Needed UnnumberedCase.", subobject.getSubobjectType());
final ProtectionSubobject protObj = ((DynamicControlProtectionCase) subobject.getSubobjectType()).getDynamicControlProtection().getProtectionSubobject();
final ByteBuf body = Unpooled.buffer();
serializeBody(CTYPE, protObj, body);
EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.secondary.explicit.route.subobjects.subobject.type.DynamicControlProtectionCase in project bgpcep by opendaylight.
the class SRRODynamicProtectionSubobjectParser method serializeSubobject.
@Override
public void serializeSubobject(final SubobjectContainer subobject, final ByteBuf buffer) {
Preconditions.checkArgument(subobject.getSubobjectType() instanceof DynamicControlProtectionCase, "Unknown subobject instance. Passed %s. Needed UnnumberedCase.", subobject.getSubobjectType());
final ProtectionSubobject protObj = ((DynamicControlProtectionCase) subobject.getSubobjectType()).getDynamicControlProtection().getProtectionSubobject();
final ByteBuf body = Unpooled.buffer();
serializeBody(CTYPE, protObj, body);
RROSubobjectUtil.formatSubobject(TYPE, body, buffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.secondary.explicit.route.subobjects.subobject.type.DynamicControlProtectionCase in project bgpcep by opendaylight.
the class TEObjectTest method testWrongSerializeSRRO.
@Test(expected = IllegalArgumentException.class)
public void testWrongSerializeSRRO() throws RSVPParsingException {
final DynamicControlProtectionCase dynamicProtection = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.secondary._record.route.subobjects.subobject.type.DynamicControlProtectionCaseBuilder().build();
final SRROBasicProtectionSubobjectParser parser = new SRROBasicProtectionSubobjectParser();
parser.serializeSubobject(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.list.SubobjectContainerBuilder().setSubobjectType(dynamicProtection).build(), Unpooled.buffer());
}
Aggregations