use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project openflowplugin by opendaylight.
the class SyncReactorGuardDecoratorTest method setUp.
@Before
public void setUp() throws Exception {
reactor = new SyncReactorGuardDecorator(delegate);
InstanceIdentifier<Node> nodePath = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(NODE_ID));
fcNodePath = nodePath.augmentation(FlowCapableNode.class);
final Node operationalNode = Mockito.mock(Node.class);
Mockito.when(operationalNode.getId()).thenReturn(NODE_ID);
Mockito.when(operationalNode.getAugmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project openflowplugin by opendaylight.
the class LLDPDiscoveryListener method onPacketReceived.
@Override
public void onPacketReceived(PacketReceived lldp) {
NodeConnectorRef src = LLDPDiscoveryUtils.lldpToNodeConnectorRef(lldp.getPayload(), true);
if (src != null) {
final NodeKey nodeKey = lldp.getIngress().getValue().firstKeyOf(Node.class);
LOG.debug("LLDP packet received for destination node {}", nodeKey);
if (nodeKey != null) {
LinkDiscoveredBuilder ldb = new LinkDiscoveredBuilder();
ldb.setDestination(lldp.getIngress());
ldb.setSource(new NodeConnectorRef(src));
LinkDiscovered ld = ldb.build();
lldpLinkAger.put(ld);
if (LLDPDiscoveryUtils.isEntityOwned(this.eos, nodeKey.getId().getValue())) {
LOG.debug("Publish add event for link {}", ld);
notificationService.publish(ld);
} else {
LOG.trace("Skip publishing the add event for link because controller is non-owner of the " + "node {}. Link : {}", nodeKey.getId().getValue(), ld);
}
} else {
LOG.debug("LLDP packet ignored. Unable to extract node-key from packet-in ingress.");
}
}
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project openflowplugin by opendaylight.
the class DeviceManagerImpl method sendNodeAddedNotification.
@Override
public void sendNodeAddedNotification(@Nonnull final KeyedInstanceIdentifier<Node, NodeKey> instanceIdentifier) {
if (!notificationCreateNodeSend.contains(instanceIdentifier)) {
notificationCreateNodeSend.add(instanceIdentifier);
final NodeId id = instanceIdentifier.firstKeyOf(Node.class).getId();
NodeUpdatedBuilder builder = new NodeUpdatedBuilder();
builder.setId(id);
builder.setNodeRef(new NodeRef(instanceIdentifier));
LOG.info("Publishing node added notification for {}", id);
notificationPublishService.offerNotification(builder.build());
}
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createUserNode.
private void createUserNode(String nodeRef) {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(nodeRef));
builder.setKey(new NodeKey(builder.getId()));
testNode12 = builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createTestNode.
private NodeBuilder createTestNode(String nodeId) {
if (nodeId == null) {
nodeId = OpenflowpluginTestActivator.NODE_ID;
}
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(nodeId));
builder.setKey(new NodeKey(builder.getId()));
return builder;
}
Aggregations