public TopologyTypesBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.TopologyTypes>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.TopologyTypes> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
public ServerSessionManager(final DataBroker broker, final InstanceIdentifier<Topology> topology, final TopologySessionListenerFactory listenerFactory, final int rpcTimeout) throws ReadFailedException, TransactionCommitFailedException { this.broker = Preconditions.checkNotNull(broker); this.topology = Preconditions.checkNotNull(topology); this.listenerFactory = Preconditions.checkNotNull(listenerFactory); this.peerProposal = PCEPStatefulPeerProposal.createStatefulPeerProposal(this.broker, this.topology); this.rpcTimeout = rpcTimeout; // Now create the base topology final TopologyKey k = InstanceIdentifier.keyOf(topology); final WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.put(LogicalDatastoreType.OPERATIONAL, topology, new TopologyBuilder().setKey(k).setTopologyId(k.getTopologyId()).setTopologyTypes( new TopologyTypesBuilder().addAugmentation(TopologyTypes1.class, new TopologyTypes1Builder().setTopologyPcep(new TopologyPcepBuilder().build()).build()).build()).setNode( new ArrayList<Node>()).build(), true); tx.submit().checkedGet(); }
public TopologyTypesBuilder addAugmentation(Class<? extends Augmentation<TopologyTypes>> augmentationType, Augmentation<TopologyTypes> augmentationValue) { if (augmentationValue == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentationValue); return this; }