use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcerr.message.pcerr.message.Errors in project genius by opendaylight.
the class AlivenessMonitor method releaseId.
private void releaseId(String idKey) {
ReleaseIdInput idInput = new ReleaseIdInputBuilder().setPoolName(AlivenessMonitorConstants.MONITOR_IDPOOL_NAME).setIdKey(idKey).build();
try {
Future<RpcResult<Void>> result = idManager.releaseId(idInput);
RpcResult<Void> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.warn("RPC Call to release Id {} returned with Errors {}", idKey, rpcResult.getErrors());
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Exception when releasing Id for key {}", idKey, e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcerr.message.pcerr.message.Errors in project bgpcep by opendaylight.
the class PCEPCloseMessageParser method validate.
@Override
protected Close validate(final List<Object> objects, final List<Message> errors) throws PCEPDeserializerException {
Preconditions.checkArgument(objects != null, "Passed list can't be null.");
if (objects.isEmpty() || !(objects.get(0) instanceof CClose)) {
throw new PCEPDeserializerException("Close message doesn't contain CLOSE object.");
}
final Object o = objects.get(0);
final CCloseMessage msg = new CCloseMessageBuilder().setCClose((CClose) o).build();
objects.remove(0);
if (!objects.isEmpty()) {
throw new PCEPDeserializerException("Unprocessed Objects: " + objects);
}
return new CloseBuilder().setCCloseMessage(msg).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcerr.message.pcerr.message.Errors in project bgpcep by opendaylight.
the class PCEPNotificationMessageParser method validate.
@Override
protected Message validate(final List<Object> objects, final List<Message> errors) throws PCEPDeserializerException {
Preconditions.checkArgument(objects != null, "Passed list can't be null.");
if (objects.isEmpty()) {
throw new PCEPDeserializerException("Notification message cannot be empty.");
}
final List<Notifications> compositeNotifications = new ArrayList<>();
while (!objects.isEmpty()) {
final Notifications comObj = getValidNotificationComposite(objects, errors);
if (comObj == null) {
break;
}
compositeNotifications.add(comObj);
}
if (compositeNotifications.isEmpty()) {
throw new PCEPDeserializerException("Atleast one Notifications is mandatory.");
}
if (!objects.isEmpty()) {
throw new PCEPDeserializerException("Unprocessed Objects: " + objects);
}
return new PcntfBuilder().setPcntfMessage(new PcntfMessageBuilder().setNotifications(compositeNotifications).build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcerr.message.pcerr.message.Errors in project bgpcep by opendaylight.
the class PCEPNotificationMessageParser method getValidNotificationComposite.
private static Notifications getValidNotificationComposite(final List<Object> objects, final List<Message> errors) {
final List<Rps> requestParameters = new ArrayList<>();
final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcntf.message.pcntf.message.notifications.Notifications> notifications = new ArrayList<>();
Object obj;
State state = State.INIT;
while (!objects.isEmpty() && !state.equals(State.END)) {
obj = objects.get(0);
if ((state = insertObject(state, obj, errors, requestParameters, notifications)) == null) {
return null;
}
if (!state.equals(State.END)) {
objects.remove(0);
}
}
if (notifications.isEmpty()) {
return null;
}
return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcntf.message.pcntf.message.NotificationsBuilder().setNotifications(notifications).setRps(requestParameters).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcerr.message.pcerr.message.Errors in project bgpcep by opendaylight.
the class PCEPReplyMessageParser method validate.
@Override
protected Pcrep validate(final List<Object> objects, final List<Message> errors) throws PCEPDeserializerException {
Preconditions.checkArgument(objects != null, "Passed list can't be null.");
if (objects.isEmpty()) {
throw new PCEPDeserializerException("Pcrep message cannot be empty.");
}
final List<Replies> replies = new ArrayList<>();
while (!objects.isEmpty()) {
final Replies r = this.getValidReply(objects, errors);
if (r != null) {
replies.add(r);
}
}
if (!objects.isEmpty()) {
throw new PCEPDeserializerException("Unprocessed Objects: " + objects);
}
return new PcrepBuilder().setPcrepMessage(new PcrepMessageBuilder().setReplies(replies).build()).build();
}
Aggregations