public OfOverlayContextListener(DataBroker dataProvider, SwitchManager swManager) { super(dataProvider); this.swManager = checkNotNull(swManager); registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier .builder(Endpoints.class).child(Endpoint.class).augmentation(OfOverlayContext.class).build())); }
public CheckedFuture<Void,TransactionCommitFailedException> removeFlowNew(BigInteger dpnId, Flow flowEntity) { s_logger.debug("Remove flow {}",flowEntity); Node nodeDpn = buildDpnNode(dpnId); FlowKey flowKey = new FlowKey(new FlowId(flowEntity.getId())); InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class) .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class) .child(Table.class, new TableKey(flowEntity.getTableId())).child(Flow.class, flowKey).build(); WriteTransaction modification = m_dataBroker.newWriteOnlyTransaction(); modification.delete(LogicalDatastoreType.CONFIGURATION,flowInstanceId ); return modification.submit(); }
public NodeChangeListenerImpl(final DataBroker dataBroker, final OperationProcessor operationProcessor) { // TODO: listener on FlowCapableNode. what if node id in Node.class is changed (it won't be caught by this listener) super(operationProcessor, dataBroker, InstanceIdentifier.builder(Nodes.class).child(Node.class) .augmentation(FlowCapableNode.class).build()); }
/** * {@inheritDoc} */ @Override protected InstanceIdentifier<Flow> getWildcardPath() { return InstanceIdentifier.builder(Nodes.class). child(Node.class). augmentation(FlowCapableNode.class). child(Table.class, new TableKey(FlowUtils.TABLE_ID)). child(Flow.class). build(); }
private void registerPortListener() { InstanceIdentifier<HostNode> hostNodes = InstanceIdentifier .builder(NetworkTopology.class) .child(Topology.class) .child(Node.class).augmentation(HostNode.class).build(); this.hostListener = this.dataBroker .registerDataChangeListener(LogicalDatastoreType.OPERATIONAL, hostNodes, this, AsyncDataBroker.DataChangeScope.SUBTREE); } public String getIpByMac(String macAddress) {
public static InstanceIdentifier<FlowCapableNodeConnectorStatisticsData> flowCapableNodeConnectorStatisticsData(String nodeConnectorId) { String nodeId = NameConverter.extractNodeId(nodeConnectorId); return InstanceIdentifier .builder(Nodes.class) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(new NodeId(nodeId))) .child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId(nodeConnectorId))) .augmentation(FlowCapableNodeConnectorStatisticsData.class) .build(); }
public CheckedFuture<Void,TransactionCommitFailedException> installFlow(BigInteger dpId, Flow flow) { FlowKey flowKey = new FlowKey( new FlowId(flow.getId()) ); Node nodeDpn = buildDpnNode(dpId); InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class) .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class) .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class,flowKey).build(); WriteTransaction modification = m_dataBroker.newWriteOnlyTransaction(); modification.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flow, true); return modification.submit(); }
static InstanceIdentifier<Adjacencies> getAdjListPath(String vpnInterfaceName) { return InstanceIdentifier.builder(org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.VpnInterfaces.class) .child(org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterface.class, new org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterfaceKey(vpnInterfaceName)).augmentation( org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.Adjacencies.class).build(); }
private InstanceIdentifier<Table> getTableInstanceId(InstanceIdentifier<Node> nodeId) { // get flow table key TableKey flowTableKey = new TableKey(flowTableId); return nodeId.builder() .augmentation(FlowCapableNode.class) .child(Table.class, flowTableKey) .build(); }
private void registerPortListener() { InstanceIdentifier<HostNode> hostNodes = InstanceIdentifier .builder(NetworkTopology.class) .child(Topology.class) .child(Node.class).augmentation(HostNode.class).build(); this.hostListener = this.dataBroker .registerDataChangeListener(LogicalDatastoreType.OPERATIONAL, hostNodes, this, AsyncDataBroker.DataChangeScope.SUBTREE); }
private InstanceIdentifier<Table> getTableInstanceId(InstanceIdentifier<Node> nodeId) { // get flow table key TableKey flowTableKey = new TableKey(flowTableId); return nodeId.builder() .augmentation(FlowCapableNode.class) .child(Table.class, flowTableKey) .build(); }
public static InstanceIdentifier<FlowCapableNode> flowCapableNode(String nodeId) { return InstanceIdentifier .builder(Nodes.class) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(new NodeId(nodeId))) .augmentation(FlowCapableNode.class) .build(); }
public TerminationPointChangeListenerImpl(final DataBroker dataBroker, final OperationProcessor operationProcessor) { super(operationProcessor, dataBroker, InstanceIdentifier.builder(Nodes.class).child(Node.class) .child(NodeConnector.class).augmentation(FlowCapableNodeConnector.class).build()); this.operationProcessor = operationProcessor; }
private static InstanceIdentifier<Table> generateFlowTableInstanceIdentifier(final NodeConnectorRef nodeConnectorRef, final TableKey flowTableKey) { return generateNodeInstanceIdentifier(nodeConnectorRef).builder() .augmentation(FlowCapableNode.class) .child(Table.class, flowTableKey) .build(); } private static InstanceIdentifier<Node> generateNodeInstanceIdentifier(final NodeConnectorRef nodeConnectorRef) {
/** * {@inheritDoc} */ @Override protected InstanceIdentifier<FlowCapableNodeConnector> getWildcardPath() { return InstanceIdentifier.builder(Nodes.class).child(Node.class). child(NodeConnector.class). augmentation(FlowCapableNodeConnector.class).build(); }
/** * @return InstanceIdentifier pointing to current Database */ private InstanceIdentifier.InstanceIdentifierBuilder<org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.sxp.databases.fields.MasterDatabase> getIdentifierBuilder() { return InstanceIdentifier.builder(NetworkTopology.class) .child(Topology.class, new TopologyKey(new TopologyId(Configuration.TOPOLOGY_NAME))) .child(Node.class, new NodeKey(new NodeId(nodeId))) .augmentation(SxpNodeIdentity.class) .child(SxpDomains.class) .child(SxpDomain.class, new SxpDomainKey(domain)) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.sxp.databases.fields.MasterDatabase.class); }
static InstanceIdentifier<Adjacency> getAdjacencyIdentifier(String vpnInterfaceName, String ipAddress) { return InstanceIdentifier.builder(org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.VpnInterfaces.class) .child(org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterface.class, new org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterfaceKey(vpnInterfaceName)).augmentation( org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.Adjacencies.class) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.adjacency.list.Adjacency.class, new org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.adjacency.list.AdjacencyKey(ipAddress)).build(); }
public static InstanceIdentifier<FlowCapableNode> flowCapableNode(String nodeId) { return InstanceIdentifier .builder(Nodes.class) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(new NodeId(nodeId))) .augmentation(FlowCapableNode.class) .build(); }
private InstanceIdentifier<Adjacency> getAdjacencyIdentifier(String vpnInterfaceName, String ipAddress) { return InstanceIdentifier.builder(VpnInterfaces.class) .child(VpnInterface.class, new VpnInterfaceKey(vpnInterfaceName)).augmentation( Adjacencies.class).child(Adjacency.class, new AdjacencyKey(ipAddress)).build(); }
/** * Return an instance identifier that specifies flow-capable-node for * the node corresponding to this instance. * * @return An instance identifier for the flow-capable-node. */ public final InstanceIdentifier<FlowCapableNode> getFlowNodeIdentifier() { return getNodeIdentifierBuilder(). augmentation(FlowCapableNode.class). build(); }