Search in sources :

Example 86 with Container

use of org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.Container in project netvirt by opendaylight.

the class StatisticsImpl method acquireElementCountersRequestHandler.

@Override
public ListenableFuture<RpcResult<AcquireElementCountersRequestHandlerOutput>> acquireElementCountersRequestHandler(AcquireElementCountersRequestHandlerInput input) {
    AcquireElementCountersRequestHandlerOutputBuilder aecrhob = new AcquireElementCountersRequestHandlerOutputBuilder();
    UUID randomNumber = UUID.randomUUID();
    Integer intRequestKey = allocateId(randomNumber.toString());
    if (intRequestKey == null) {
        LOG.warn("failed generating unique request identifier");
        statisticsCounters.failedGeneratingUniqueRequestId();
        return RpcResultBuilder.<AcquireElementCountersRequestHandlerOutput>failed().withError(ErrorType.APPLICATION, "failed generating unique request identifier").buildFuture();
    }
    String requestKey = String.valueOf(intRequestKey);
    SettableFuture<RpcResult<AcquireElementCountersRequestHandlerOutput>> result = SettableFuture.create();
    LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(transaction -> {
        if (input.getIncomingTraffic() != null) {
            Optional<EgressElementCountersRequestConfig> eecrcOpt = transaction.read(LogicalDatastoreType.CONFIGURATION, CountersServiceUtils.EECRC_IDENTIFIER).get();
            if (!eecrcOpt.isPresent()) {
                LOG.warn("failed creating incoming traffic counter request data container in DB");
                statisticsCounters.failedCreatingEgressCounterDataConfig();
                result.setFuture(RpcResultBuilder.<AcquireElementCountersRequestHandlerOutput>failed().withError(ErrorType.APPLICATION, "failed creating egress counter request data container in DB").buildFuture());
                return;
            }
            if (!isIdenticalCounterRequestExist(input.getPortId(), ElementCountersDirection.EGRESS.toString(), input.getIncomingTraffic().getFilters(), eecrcOpt.get().getCounterRequests())) {
                installCounterSpecificRules(input.getPortId(), getLportTag(input.getPortId()), getDpn(input.getPortId()), ElementCountersDirection.EGRESS, input.getIncomingTraffic().getFilters());
            }
            putEgressElementCounterRequestInConfig(input, ElementCountersDirection.EGRESS, transaction, requestKey, CountersServiceUtils.EECRC_IDENTIFIER, eecrcOpt, randomNumber.toString());
            aecrhob.setIncomingTrafficHandler(requestKey);
            bindCountersServiceIfUnbound(input.getPortId(), ElementCountersDirection.EGRESS);
        }
        if (input.getOutgoingTraffic() != null) {
            Optional<IngressElementCountersRequestConfig> iecrcOpt = transaction.read(LogicalDatastoreType.CONFIGURATION, CountersServiceUtils.IECRC_IDENTIFIER).get();
            if (!iecrcOpt.isPresent()) {
                LOG.warn("failed creating outgoing traffc counter request data container in DB");
                statisticsCounters.failedCreatingIngressCounterDataConfig();
                result.setFuture(RpcResultBuilder.<AcquireElementCountersRequestHandlerOutput>failed().withError(ErrorType.APPLICATION, "failed creating ingress counter request data container in DB").buildFuture());
                return;
            }
            if (!isIdenticalCounterRequestExist(input.getPortId(), ElementCountersDirection.INGRESS.toString(), input.getOutgoingTraffic().getFilters(), iecrcOpt.get().getCounterRequests())) {
                installCounterSpecificRules(input.getPortId(), getLportTag(input.getPortId()), getDpn(input.getPortId()), ElementCountersDirection.INGRESS, input.getOutgoingTraffic().getFilters());
            }
            putIngressElementCounterRequestInConfig(input, ElementCountersDirection.INGRESS, transaction, requestKey, CountersServiceUtils.IECRC_IDENTIFIER, iecrcOpt, randomNumber.toString());
            aecrhob.setIncomingTrafficHandler(requestKey);
            bindCountersServiceIfUnbound(input.getPortId(), ElementCountersDirection.INGRESS);
            result.setFuture(RpcResultBuilder.success(aecrhob.build()).buildFuture());
        }
    }), LOG, "Error acquiring element counters");
    return result;
}
Also used : AcquireElementCountersRequestHandlerOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.AcquireElementCountersRequestHandlerOutputBuilder) BigInteger(java.math.BigInteger) ReadFailedException(org.opendaylight.mdsal.common.api.ReadFailedException) GetNodeConnectorCountersInput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetNodeConnectorCountersInput) CounterResultBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.CounterResultBuilder) CheckedFuture(com.google.common.util.concurrent.CheckedFuture) AcquireElementCountersRequestHandlerInput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.AcquireElementCountersRequestHandlerInput) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match) Future(java.util.concurrent.Future) EgressElementCountersRequestConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.EgressElementCountersRequestConfig) NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) GetElementCountersByHandlerOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetElementCountersByHandlerOutput) Map(java.util.Map) BigInteger(java.math.BigInteger) CreateIdPoolInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput) GetElementCountersByHandlerInput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetElementCountersByHandlerInput) ReleaseIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput) ReleaseElementCountersRequestHandlerOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.ReleaseElementCountersRequestHandlerOutput) ReadWriteTransaction(org.opendaylight.mdsal.binding.api.ReadWriteTransaction) Set(java.util.Set) ErrorType(org.opendaylight.yangtools.yang.common.RpcError.ErrorType) CleanAllElementCounterRequestsOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.CleanAllElementCounterRequestsOutput) GetNodeCountersInput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetNodeCountersInput) NonNull(org.eclipse.jdt.annotation.NonNull) AllocateIdOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdOutput) StatisticsService(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.StatisticsService) ManagedNewTransactionRunner(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase) ArrayList(java.util.ArrayList) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey) InterfaceInfo(org.opendaylight.genius.interfacemanager.globals.InterfaceInfo) GetNodeAggregatedCountersOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetNodeAggregatedCountersOutputBuilder) IdPool(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.id.pools.IdPool) WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) TcpFilter(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.elementrequestdata.filters.TcpFilter) EgressElementCountersRequestConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.EgressElementCountersRequestConfigBuilder) ReleaseIdOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdOutput) FutureCallback(com.google.common.util.concurrent.FutureCallback) ExecutionException(java.util.concurrent.ExecutionException) Futures(com.google.common.util.concurrent.Futures) Nodes(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) GetNodeAggregatedCountersOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetNodeAggregatedCountersOutput) IngressElementCountersRequestConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.IngressElementCountersRequestConfig) UdpFilter(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.elementrequestdata.filters.UdpFilter) IMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager) LogicalDatastoreType(org.opendaylight.mdsal.common.api.LogicalDatastoreType) ICountersInterfaceChangeHandler(org.opendaylight.netvirt.statistics.api.ICountersInterfaceChangeHandler) DataBroker(org.opendaylight.mdsal.binding.api.DataBroker) CounterRequests(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequests) Groups(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.Groups) CreateIdPoolOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolOutput) LoggerFactory(org.slf4j.LoggerFactory) SettableFuture(com.google.common.util.concurrent.SettableFuture) CleanAllElementCounterRequestsInput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.CleanAllElementCounterRequestsInput) GetNodeCountersOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetNodeCountersOutputBuilder) ReadTransaction(org.opendaylight.mdsal.binding.api.ReadTransaction) IdPoolKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.id.pools.IdPoolKey) LoggingFutures(org.opendaylight.infrautils.utils.concurrent.LoggingFutures) MDSALUtil(org.opendaylight.genius.mdsalutil.MDSALUtil) CountersBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.groups.CountersBuilder) GetNodeCountersOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetNodeCountersOutput) CounterRequestsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequestsBuilder) UUID(java.util.UUID) Interface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface) CounterResult(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.CounterResult) AllocateIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInput) GetNodeConnectorCountersOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetNodeConnectorCountersOutputBuilder) List(java.util.List) ManagedNewTransactionRunnerImpl(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl) GroupsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.GroupsBuilder) Entry(java.util.Map.Entry) GetNodeAggregatedCountersInput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetNodeAggregatedCountersInput) Optional(java.util.Optional) AcquireElementCountersRequestHandlerOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.AcquireElementCountersRequestHandlerOutput) Filters(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.elementrequestdata.Filters) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings) NodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) AcquireElementCountersRequestHandlerOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.AcquireElementCountersRequestHandlerOutputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) GetNodeConnectorCountersOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetNodeConnectorCountersOutput) HashMap(java.util.HashMap) IngressElementCountersRequestConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.IngressElementCountersRequestConfigBuilder) ReleaseElementCountersRequestHandlerInput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.ReleaseElementCountersRequestHandlerInput) HashSet(java.util.HashSet) CreateIdPoolInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInputBuilder) CounterRequestsKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequestsKey) InterfaceUtils(org.opendaylight.netvirt.vpnmanager.api.InterfaceUtils) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) IInterfaceManager(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager) Logger(org.slf4j.Logger) GetElementCountersByHandlerOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetElementCountersByHandlerOutputBuilder) ReleaseIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder) IdManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService) IdPools(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdPools) RpcResultBuilder(org.opendaylight.yangtools.yang.common.RpcResultBuilder) AllocateIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInputBuilder) Counters(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.groups.Counters) Optional(java.util.Optional) AcquireElementCountersRequestHandlerOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.AcquireElementCountersRequestHandlerOutput) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) UUID(java.util.UUID)

Example 87 with Container

use of org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.Container in project netvirt by opendaylight.

the class ShowFibCommand method doExecute.

@Override
@Nullable
protected Object doExecute() {
    PrintStream console = session.getConsole();
    if (prefixOrSubnetOption != null && prefixOrSubnetOption.length() > 0) {
        prefixOrSubnet = prefixOrSubnetOption.replace("[", "");
        prefixOrSubnet = prefixOrSubnet.replace("]", "");
        if (!prefixOrSubnet.contains("/")) {
            String maskFull = null;
            try {
                Inet4Address tempAdd = (Inet4Address) InetAddress.getByName(prefixOrSubnet);
                maskFull = "/32";
            } catch (SecurityException | UnknownHostException | ClassCastException e) {
                maskFull = null;
            }
            if (maskFull == null) {
                try {
                    Inet6Address tempAdd = (Inet6Address) InetAddress.getByName(prefixOrSubnet);
                    maskFull = "/128";
                } catch (SecurityException | UnknownHostException | ClassCastException e) {
                    maskFull = null;
                }
            }
            if (maskFull == null) {
                console.println("a part of cli " + SUBNET + " is wrong => " + prefixOrSubnet);
                return usage(console);
            }
            prefixOrSubnet += maskFull;
        }
    }
    console.println(HEADER);
    if (options == null && prefixOrSubnet == null && (addrFamList == null || addrFamList.isEmpty())) {
        InstanceIdentifier<FibEntries> id = InstanceIdentifier.create(FibEntries.class);
        try {
            FibEntries fibEntries = singleTxDb.syncRead(LogicalDatastoreType.CONFIGURATION, id);
            Map<VrfTablesKey, VrfTables> keyVrfTablesMap = fibEntries.getVrfTables();
            if (keyVrfTablesMap == null || keyVrfTablesMap.isEmpty()) {
                console.println(" No Fib entries found");
                return null;
            }
            for (VrfTables vrfTable : keyVrfTablesMap.values()) {
                printVrfTable(vrfTable, console);
            }
        } catch (ExpectedDataObjectNotFoundException e404) {
            /* This is always thrown the first time FIB DS is accessed,
                   and no route have yet been configured in it. So, no need to print FATAL on the console.
                */
            String errMsg = "FATAL: fib-entries container is missing from MD-SAL";
            LOG.error(errMsg, e404);
        } catch (ReadFailedException rfe) {
            String errMsg = "Internal Error occurred while processing vpnservice:fib-show command";
            console.println("\n" + errMsg);
            LOG.error(errMsg, rfe);
        }
        return null;
    } else {
        String optionsLowerCase = options != null ? options.toLowerCase(Locale.getDefault()) : "";
        switch(optionsLowerCase) {
            case "fullhelp":
                return usage(console);
            default:
        }
        if ((addrFamList == null || addrFamList.isEmpty()) && (prefixOrSubnet == null || prefixOrSubnet.indexOf("/") < 5)) {
            console.println("any address family is requiered or " + SUBNET + " is wrong");
            usage(console);
        } else {
            boolean isIpv4 = false;
            boolean isIpv6 = false;
            boolean isL2vpn = false;
            if (addrFamList != null && addrFamList.size() > 0) {
                for (String addF : addrFamList) {
                    switch(addF.toLowerCase(Locale.getDefault())) {
                        case "ipv4":
                            isIpv4 = true;
                            break;
                        case "ipv6":
                            isIpv6 = true;
                            break;
                        case "l2vpn":
                            isL2vpn = true;
                            break;
                        default:
                    }
                }
            }
            InstanceIdentifier<FibEntries> id = InstanceIdentifier.create(FibEntries.class);
            try {
                FibEntries fibEntries = singleTxDb.syncRead(LogicalDatastoreType.CONFIGURATION, id);
                Map<VrfTablesKey, VrfTables> keyVrfTablesMap = fibEntries.getVrfTables();
                if (keyVrfTablesMap == null || keyVrfTablesMap.isEmpty()) {
                    console.println(" No Fib entries found");
                    return null;
                }
                for (VrfTables vrfTable : keyVrfTablesMap.values()) {
                    printVrfTable(vrfTable, console, isIpv4, isIpv6, isL2vpn, prefixOrSubnet);
                }
            } catch (ExpectedDataObjectNotFoundException e404) {
                String errMsg = "FATAL: fib-entries container is missing from MD-SAL";
                console.println("\n" + errMsg);
                LOG.error(errMsg, e404);
            } catch (ReadFailedException rfe) {
                String errMsg = "Internal Error occurred while processing vpnservice:fib-show command";
                console.println("\n" + errMsg);
                LOG.error(errMsg, rfe);
            }
            return null;
        }
    }
    return null;
}
Also used : PrintStream(java.io.PrintStream) ReadFailedException(org.opendaylight.mdsal.common.api.ReadFailedException) Inet4Address(java.net.Inet4Address) UnknownHostException(java.net.UnknownHostException) ExpectedDataObjectNotFoundException(org.opendaylight.genius.datastoreutils.ExpectedDataObjectNotFoundException) FibEntries(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.FibEntries) Inet6Address(java.net.Inet6Address) VrfTablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey) VrfTables(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTables) Nullable(org.eclipse.jdt.annotation.Nullable)

Example 88 with Container

use of org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.Container in project bgpcep by opendaylight.

the class SimpleXROSubobjectRegistryTest method testUnrecognizedType.

@Test
public void testUnrecognizedType() throws RSVPParsingException {
    final int wrongType = 99;
    assertNull(this.simpleXROSubobjectRegistry.parseSubobject(wrongType, this.input, false));
    final ByteBuf output = Unpooled.EMPTY_BUFFER;
    final SubobjectContainer container = new SubobjectContainerBuilder().setSubobjectType(new LabelCaseBuilder().build()).build();
    this.simpleXROSubobjectRegistry.serializeSubobject(container, output);
    assertEquals(0, output.readableBytes());
}
Also used : SubobjectContainer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.exclude.route.object.exclude.route.object.SubobjectContainer) SubobjectContainerBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.exclude.route.object.exclude.route.object.SubobjectContainerBuilder) ByteBuf(io.netty.buffer.ByteBuf) LabelCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.LabelCaseBuilder) Test(org.junit.Test)

Example 89 with Container

use of org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.Container in project bgpcep by opendaylight.

the class SimpleRROSubobjectRegistryTest method testUnrecognizedType.

@Test
public void testUnrecognizedType() throws RSVPParsingException {
    final int wrongType = 99;
    assertNull(this.simpleRROSubobjectRegistry.parseSubobject(wrongType, this.input));
    final ByteBuf output = Unpooled.EMPTY_BUFFER;
    final SubobjectContainer container = new SubobjectContainerBuilder().setSubobjectType(new LabelCaseBuilder().build()).build();
    this.simpleRROSubobjectRegistry.serializeSubobject(container, output);
    assertEquals(0, output.readableBytes());
}
Also used : SubobjectContainer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.list.SubobjectContainer) SubobjectContainerBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.list.SubobjectContainerBuilder) ByteBuf(io.netty.buffer.ByteBuf) LabelCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.subobject.type.LabelCaseBuilder) Test(org.junit.Test)

Example 90 with Container

use of org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.Container in project bgpcep by opendaylight.

the class SimpleRROSubobjectRegistryTest method testSerializerRegistration.

@Test
public void testSerializerRegistration() {
    assertNotNull(this.simpleRROSubobjectRegistry.registerSubobjectSerializer(LabelCase.class, this.rroSubobjectSerializer));
    final ByteBuf output = Unpooled.buffer();
    final SubobjectContainer container = new SubobjectContainerBuilder().setSubobjectType(new LabelCaseBuilder().build()).build();
    this.simpleRROSubobjectRegistry.serializeSubobject(container, output);
    assertEquals(1, output.readableBytes());
}
Also used : SubobjectContainer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.list.SubobjectContainer) LabelCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.subobject.type.LabelCase) SubobjectContainerBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.list.SubobjectContainerBuilder) ByteBuf(io.netty.buffer.ByteBuf) LabelCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.subobject.type.LabelCaseBuilder) Test(org.junit.Test)

Aggregations

ItemStack (org.bukkit.inventory.ItemStack)45 Test (org.junit.Test)16 HashMap (java.util.HashMap)10 Container (net.minecraft.server.v1_12_R1.Container)9 Container (net.minecraft.server.v1_16_R3.Container)9 Container (org.flyte.api.v1.Container)9 FailedNbt (com.ruinscraft.panilla.api.exception.FailedNbt)8 INbtTagCompound (com.ruinscraft.panilla.api.nbt.INbtTagCompound)8 Container (net.minecraft.server.v1_11_R1.Container)8 Container (net.minecraft.server.v1_14_R1.Container)8 Container (net.minecraft.server.v1_15_R1.Container)8 Container (net.minecraft.server.v1_16_R1.Container)8 Container (net.minecraft.server.v1_16_R2.Container)8 Container (net.minecraft.server.v1_8_R3.Container)8 ByteBuf (io.netty.buffer.ByteBuf)7 ArrayList (java.util.ArrayList)7 Container (net.minecraft.server.v1_13_R1.Container)7 Container (net.minecraft.server.v1_13_R2.Container)6 Container (net.minecraft.server.v1_10_R1.Container)5 EntityPlayer (net.minecraft.server.v1_8_R3.EntityPlayer)5