Search in sources :

Example 1 with Root

use of org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root in project xtext-eclipse by eclipse.

the class Bug377311TestLanguageSemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == Bug377311Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug377311Package.CHILD:
                sequence_Child(context, (Child) semanticObject);
                return;
            case Bug377311Package.ROOT:
                sequence_Root(context, (Root) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Root(org.eclipse.xtext.ui.tests.editor.contentassist.bug377311.Root) Parameter(org.eclipse.xtext.Parameter) Child(org.eclipse.xtext.ui.tests.editor.contentassist.bug377311.Child) EPackage(org.eclipse.emf.ecore.EPackage)

Example 2 with Root

use of org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root in project netvirt by opendaylight.

the class ElanInterfaceManager method setupLeavesLocalBroadcastGroups.

private void setupLeavesLocalBroadcastGroups(ElanInstance elanInfo, DpnInterfaces newDpnInterface, InterfaceInfo interfaceInfo) {
    EtreeInstance etreeInstance = elanInfo.getAugmentation(EtreeInstance.class);
    if (etreeInstance != null) {
        List<Bucket> listBucket = new ArrayList<>();
        int bucketId = 0;
        List<String> interfaces = new ArrayList<>();
        if (newDpnInterface != null) {
            interfaces = newDpnInterface.getInterfaces();
        }
        for (String ifName : interfaces) {
            // In case if there is a InterfacePort in the cache which is not
            // in
            // operational state, skip processing it
            InterfaceInfo ifInfo = interfaceManager.getInterfaceInfoFromOperationalDataStore(ifName, interfaceInfo.getInterfaceType());
            if (!isOperational(ifInfo)) {
                continue;
            }
            if (!interfaceManager.isExternalInterface(ifName)) {
                // only add root interfaces
                bucketId = addInterfaceIfRootInterface(bucketId, ifName, listBucket, ifInfo);
            }
        }
        if (listBucket.isEmpty()) {
            // No Buckets
            createDropBucket(listBucket);
        }
        long etreeLeafTag = etreeInstance.getEtreeLeafTagVal().getValue();
        long groupId = ElanUtils.getEtreeLeafLocalBCGId(etreeLeafTag);
        Group group = MDSALUtil.buildGroup(groupId, elanInfo.getElanInstanceName(), GroupTypes.GroupAll, MDSALUtil.buildBucketLists(listBucket));
        LOG.trace("installing the localBroadCast Group:{}", group);
        mdsalManager.syncInstallGroup(interfaceInfo.getDpId(), group);
    }
}
Also used : ActionGroup(org.opendaylight.genius.mdsalutil.actions.ActionGroup) Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) Bucket(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket) ArrayList(java.util.ArrayList) EtreeInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeInstance) InterfaceInfo(org.opendaylight.genius.interfacemanager.globals.InterfaceInfo)

Example 3 with Root

use of org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root in project controller by opendaylight.

the class Bug2562DeserializedUnkeyedListTest method writeRoot.

private void writeRoot(final LogicalDatastoreType store) {
    final ReadWriteTransaction readWriteTransaction = getDataBroker().newReadWriteTransaction();
    final Barroot barRoot = new BarrootBuilder().setType(2).setValue(2).setKey(new BarrootKey(2)).build();
    final ArrayList<Barroot> barRootList = new ArrayList<>();
    barRootList.add(barRoot);
    final Fooroot fooRoot = new FoorootBuilder().setBarroot(barRootList).build();
    final ArrayList<Fooroot> fooRootList = new ArrayList<>();
    fooRootList.add(fooRoot);
    final Root root = new RootBuilder().setFooroot(fooRootList).build();
    readWriteTransaction.put(store, ROOT_PATH, root);
    assertCommit(readWriteTransaction.submit());
}
Also used : RootBuilder(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.RootBuilder) Root(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root) Fooroot(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.Fooroot) Barroot(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.Barroot) ArrayList(java.util.ArrayList) BarrootBuilder(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.BarrootBuilder) ReadWriteTransaction(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction) BarrootKey(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.BarrootKey) FoorootBuilder(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.FoorootBuilder)

Example 4 with Root

use of org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root in project controller by opendaylight.

the class Bug3090MultiKeyList method write.

private void write(final LogicalDatastoreType store) {
    final ReadWriteTransaction readWriteTransaction = getDataBroker().newReadWriteTransaction();
    final List<ListInRoot> listInRoots = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        listInRoots.add(new ListInRootBuilder().setLeafA("leaf a" + i).setLeafC("leaf c" + i).setLeafB("leaf b" + i).build());
    }
    final Root root = new RootBuilder().setListInRoot(listInRoots).build();
    readWriteTransaction.put(store, ROOT_PATH, root);
    assertCommit(readWriteTransaction.submit());
}
Also used : RootBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.RootBuilder) ListInRootBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.root.ListInRootBuilder) Root(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.Root) ListInRoot(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.root.ListInRoot) ArrayList(java.util.ArrayList) ListInRootBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.root.ListInRootBuilder) ReadWriteTransaction(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction) ListInRoot(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.root.ListInRoot)

Example 5 with Root

use of org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root in project bgpcep by opendaylight.

the class PCEPTunnelTopologyProvider method init.

synchronized void init() {
    final WriteTransaction tx = this.dataBroker.newWriteOnlyTransaction();
    tx.put(LogicalDatastoreType.OPERATIONAL, getTopologyReference().getInstanceIdentifier(), new TopologyBuilder().setTopologyId(this.tunneltopologyId).setTopologyTypes(new TopologyTypesBuilder().addAugmentation(TopologyTypes1.class, new TopologyTypes1Builder().setTopologyTunnelPcep(new TopologyTunnelPcepBuilder().build()).build()).build()).setNode(new ArrayList<>()).build(), true);
    try {
        tx.submit().get();
    } catch (final InterruptedException | ExecutionException e) {
        LOG.error("Failed to create Tunnel Topology root", e);
    }
    this.reg = this.ncl.getDataProvider().registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, this.src), this.ncl);
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) TopologyTunnelPcepBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.topology.tunnel.pcep.type.TopologyTunnelPcepBuilder) TopologyTypesBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.TopologyTypesBuilder) DataTreeIdentifier(org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier) TopologyBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder) TopologyTypes1(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.TopologyTypes1) TopologyTypes1Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.TopologyTypes1Builder) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

ArrayList (java.util.ArrayList)3 ReadWriteTransaction (org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction)2 EtreeInstance (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeInstance)2 ExecutionException (java.util.concurrent.ExecutionException)1 EPackage (org.eclipse.emf.ecore.EPackage)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1 Child (org.eclipse.xtext.ui.tests.editor.contentassist.bug377311.Child)1 Root (org.eclipse.xtext.ui.tests.editor.contentassist.bug377311.Root)1 DataTreeIdentifier (org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier)1 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)1 InterfaceInfo (org.opendaylight.genius.interfacemanager.globals.InterfaceInfo)1 ActionGroup (org.opendaylight.genius.mdsalutil.actions.ActionGroup)1 Root (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root)1 RootBuilder (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.RootBuilder)1 Fooroot (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.Fooroot)1 FoorootBuilder (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.FoorootBuilder)1 Barroot (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.Barroot)1 BarrootBuilder (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.BarrootBuilder)1