Search in sources :

Example 6 with Metrics

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.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);
    }
}
Also used : Metrics(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.Metrics) Object(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object)

Example 7 with Metrics

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.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);
    }
}
Also used : Metrics(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.Metrics) Object(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object)

Example 8 with Metrics

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.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);
}
Also used : Metrics(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.Metrics)

Example 9 with Metrics

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.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();
}
Also used : Metrics(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.Metrics) RequestsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.pcinitiate.message.pcinitiate.message.RequestsBuilder) Object(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object)

Example 10 with Metrics

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.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);
    }
}
Also used : Metrics(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.Metrics) ArrayList(java.util.ArrayList) Object(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object) VendorInformationObject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.vendor.information.objects.VendorInformationObject)

Aggregations

Metrics (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.Metrics)12 Object (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object)7 VendorInformationObject (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.vendor.information.objects.VendorInformationObject)4 ArrayList (java.util.ArrayList)3 Preconditions (com.google.common.base.Preconditions)2 List (java.util.List)2 Counter (org.opendaylight.infrautils.metrics.Counter)2 FlowAndStatisticsMapList (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList)2 NodeConnectorId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)2 NodeConnectorStatisticsAndPortNumberMap (org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMap)2 Optional (com.google.common.base.Optional)1 FutureCallback (com.google.common.util.concurrent.FutureCallback)1 Futures (com.google.common.util.concurrent.Futures)1 JdkFutureAdapters (com.google.common.util.concurrent.JdkFutureAdapters)1 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1 MoreExecutors (com.google.common.util.concurrent.MoreExecutors)1 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 BigInteger (java.math.BigInteger)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1