use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.Updates in project bgpcep by opendaylight.
the class Stateful07PCUpdateRequestMessageParser method getValidUpdates.
protected Updates getValidUpdates(final List<Object> objects, final List<Message> errors) {
final UpdatesBuilder builder = new UpdatesBuilder();
Object object = objects.remove(0);
if (object instanceof Srp) {
builder.setSrp((Srp) object);
if (objects.isEmpty()) {
object = null;
} else {
object = objects.remove(0);
}
} else {
errors.add(createErrorMsg(PCEPErrors.SRP_MISSING, Optional.absent()));
}
if (validateLsp(object, errors, builder)) {
if (!objects.isEmpty()) {
if (!validatePath(objects, errors, builder)) {
return null;
}
}
return builder.build();
}
return null;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.Updates in project bgpcep by opendaylight.
the class Stateful07PCUpdateRequestMessageParser method serializeMessage.
@Override
public void serializeMessage(final Message message, final ByteBuf out) {
Preconditions.checkArgument(message instanceof Pcupd, "Wrong instance of Message. Passed instance of %s. Need Pcupd.", message.getClass());
final Pcupd msg = (Pcupd) message;
final List<Updates> updates = msg.getPcupdMessage().getUpdates();
final ByteBuf buffer = Unpooled.buffer();
for (final Updates update : updates) {
serializeUpdate(update, buffer);
}
MessageUtil.formatMessage(TYPE, buffer, out);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.Updates in project genius by opendaylight.
the class VtepConfigSchemaListener method update.
@Override
public void update(@Nonnull VtepConfigSchema original, @Nonnull VtepConfigSchema updated) {
LOG.error("Received DCN for updating VTEP Original schema: {}. Updated schema: {}", original, updated);
VtepConfigSchema originalSchema = ItmUtils.validateVtepConfigSchema(original);
VtepConfigSchema updatedSchema = ItmUtils.validateVtepConfigSchema(updated);
if (doesDeleteAndAddSchemaRequired(original, updated)) {
LOG.error("Failed to handle DCN for updating VTEP schema. Original schema: {}. Updated schema: {}", original, updated);
// TODO: handle updates
return;
}
handleUpdateOfDpnIds(originalSchema, updatedSchema);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.Updates in project bgpcep by opendaylight.
the class PCCTunnelManagerImplTest method createUpdate.
private static Updates createUpdate(final long plspId, final Optional<Boolean> delegate) {
final UpdatesBuilder updsBuilder = new UpdatesBuilder();
final LspBuilder lsp = new LspBuilder().setPlspId(new PlspId(plspId));
if (delegate.isPresent()) {
lsp.setDelegate(Boolean.TRUE);
}
updsBuilder.setLsp(lsp.build());
final PathBuilder pathBuilder = new PathBuilder();
pathBuilder.setEro(ERO);
updsBuilder.setPath(pathBuilder.build());
updsBuilder.setSrp(new SrpBuilder().setOperationId(new SrpIdNumber(0L)).build());
return updsBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.Updates in project bgpcep by opendaylight.
the class StatefulPCUpdateRequestMessageParser method serializeUpdate.
protected void serializeUpdate(final Updates update, final ByteBuf buffer) {
serializeObject(update.getSrp(), buffer);
serializeObject(update.getLsp(), buffer);
final Path p = update.getPath();
if (p != null) {
serializeObject(p.getEro(), buffer);
serializeObject(p.getLspa(), buffer);
serializeObject(p.getBandwidth(), buffer);
serializeObject(p.getReoptimizationBandwidth(), buffer);
for (final Metrics m : p.nonnullMetrics()) {
serializeObject(m.getMetric(), buffer);
}
serializeObject(p.getIro(), buffer);
}
}
Aggregations