use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.lsp.attributes.Metrics in project bgpcep by opendaylight.
the class Stateful07PCReportMessageParser method parsePath.
private static void parsePath(final List<Object> objects, final PathBuilder builder) {
final List<Metrics> pathMetrics = Lists.newArrayList();
Object obj;
State state = State.INIT;
while (!objects.isEmpty() && !state.equals(State.END)) {
obj = objects.get(0);
state = insertObject(state, obj, builder, pathMetrics);
if (!state.equals(State.END)) {
objects.remove(0);
}
}
if (!pathMetrics.isEmpty()) {
builder.setMetrics(pathMetrics);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.lsp.attributes.Metrics in project bgpcep by opendaylight.
the class Stateful07PCUpdateRequestMessageParser method parsePath.
private static void parsePath(final List<Object> objects, final PathBuilder pBuilder) {
final List<Metrics> pathMetrics = Lists.newArrayList();
Object obj;
State state = State.INIT;
while (!objects.isEmpty() && !state.equals(State.END)) {
obj = objects.get(0);
state = insertObject(state, obj, pBuilder, pathMetrics);
if (!state.equals(State.END)) {
objects.remove(0);
}
}
if (!pathMetrics.isEmpty()) {
pBuilder.setMetrics(pathMetrics);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.lsp.attributes.Metrics in project bgpcep by opendaylight.
the class CInitiated00PCInitiateMessageParser method serializeRequest.
protected void serializeRequest(final Requests req, final ByteBuf buffer) {
serializeObject(req.getSrp(), buffer);
serializeObject(req.getLsp(), buffer);
serializeObject(req.getEndpointsObj(), buffer);
serializeObject(req.getEro(), buffer);
serializeObject(req.getLspa(), buffer);
serializeObject(req.getBandwidth(), buffer);
if (req.getMetrics() != null) {
for (final Metrics m : req.getMetrics()) {
serializeObject(m.getMetric(), buffer);
}
}
serializeObject(req.getIro(), buffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.lsp.attributes.Metrics in project bgpcep by opendaylight.
the class CInitiated00PCInitiateMessageParser method getValidRequest.
protected Requests getValidRequest(final List<Object> objects) {
final RequestsBuilder builder = new RequestsBuilder();
builder.setSrp((Srp) objects.get(0));
objects.remove(0);
builder.setLsp((Lsp) objects.get(0));
objects.remove(0);
final List<Metrics> metrics = Lists.newArrayList();
Object obj;
State state = State.INIT;
while (!objects.isEmpty() && !state.equals(State.END)) {
obj = objects.get(0);
state = insertObject(state, obj, builder, metrics);
if (!state.equals(State.END)) {
objects.remove(0);
}
}
builder.setMetrics(metrics);
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.lsp.attributes.Metrics in project bgpcep by opendaylight.
the class PCEPReplyMessageParser method parseAttributes.
protected void parseAttributes(final FailureCaseBuilder builder, final List<Object> objects) {
final List<Metrics> pathMetrics = new ArrayList<>();
Object obj;
State state = State.INIT;
while (!objects.isEmpty() && !state.equals(State.END)) {
obj = objects.get(0);
state = insertObject(state, obj, builder, pathMetrics);
if (!state.equals(State.END)) {
objects.remove(0);
}
}
if (!pathMetrics.isEmpty()) {
builder.setMetrics(pathMetrics);
}
}
Aggregations