/** * Return a reference to this port. * * @return A {@link NodeConnectorRef} instance. */ public NodeConnectorRef getPortRef() { return new NodeConnectorRef(portPath); }
/** * @param nodeConnectorRef * @return */ public static InstanceIdentifier<Node> generateNodeInstanceIdentifier(final NodeConnectorRef nodeConnectorRef) { return nodeConnectorRef.getValue().firstIdentifierOf(Node.class); }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } QueueKey other = (QueueKey) obj; if (_id == null) { if (other._id != null) { return false; } } else if(!_id.equals(other._id)) { return false; } if (_node == null) { if (other._node != null) { return false; } } else if(!_node.equals(other._node)) { return false; } return true; }
public ListenableFuture<RpcResult<Void>> sendArpResponse(ArpMessageAddress senderAddress, ArpMessageAddress receiverAddress, InstanceIdentifier<NodeConnector> egressNc, Header8021q vlan) { checkNotNull(senderAddress); checkNotNull(receiverAddress); checkNotNull(egressNc); final Ethernet arpFrame = createArpFrame(senderAddress, receiverAddress, vlan); byte[] arpFrameAsBytes; try { arpFrameAsBytes = arpFrame.serialize(); } catch (PacketException e) { LOG.warn("Serializition of ARP packet is not successful.", e); if (LOG.isDebugEnabled()) { LOG.debug("ARP packet: {}", ArpUtils.getArpFrameToStringFormat(arpFrame)); } return Futures.immediateFailedFuture(e); } // Generate packet with destination switch and port LOG.debug("Egress for ARP packetOut: " + new NodeConnectorRef(egressNc).toString()); TransmitPacketInput packet = new TransmitPacketInputBuilder().setEgress(new NodeConnectorRef(egressNc)) .setNode(new NodeRef(egressNc.firstIdentifierOf(Node.class))).setPayload(arpFrameAsBytes).build(); if (LOG.isTraceEnabled()) { LOG.trace("Sending ARP RESPONSE \n{}", ArpUtils.getArpFrameToStringFormat(arpFrame)); } Future<RpcResult<Void>> futureTransmitPacketResult = packetProcessingService.transmitPacket(packet); return JdkFutureAdapters.listenInPoolThread(futureTransmitPacketResult); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_id == null) ? 0 : _id.hashCode()); result = prime * result + ((_node == null) ? 0 : _node.hashCode()); return result; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_id == null) ? 0 : _id.hashCode()); result = prime * result + ((_key == null) ? 0 : _key.hashCode()); result = prime * result + ((_node == null) ? 0 : _node.hashCode()); result = prime * result + ((_port == null) ? 0 : _port.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
/** * Return a {@link NodeConnectorRef} instance corresponding to this * instance. * * @return An {@link NodeConnectorRef} instance. */ public NodeConnectorRef getNodeConnectorRef() { return new NodeConnectorRef(getNodeConnectorIdentifier()); }
return false; } else if(!_node.equals(other._node)) { return false;
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_key == null) ? 0 : _key.hashCode()); result = prime * result + ((_mac == null) ? 0 : _mac.hashCode()); result = prime * result + ((_nodeConnectorRef == null) ? 0 : _nodeConnectorRef.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
public static NodeConnector getNodeConnector(DataBroker dataService, NodeConnectorRef nodeConnectorRef) { return (getNodeConnector (dataService, (InstanceIdentifier<NodeConnector>) nodeConnectorRef.getValue())); } public static NodeConnector getNodeConnector(DataBroker dataService, InstanceIdentifier<NodeConnector> ncId)
public static NodeConnectorRef nodeConnectorRefFromDatapathIdPortno(final BigInteger datapathId, final Long portNo, final OpenflowVersion ofVersion, final KeyedInstanceIdentifier<Node, NodeKey> nodePath) { return new NodeConnectorRef(nodeConnectorInstanceIdentifierFromDatapathIdPortno(datapathId, portNo, ofVersion, nodePath)); }
Preconditions.checkNotNull(destNodeConnectorRef, "Destination port should not be null."); if (sourceNodeConnectorRef.equals(destNodeConnectorRef)) { LOG.info( "In addMacToMacFlowsUsingShortestPath: No flows added. Source and Destination ports are same.");
private boolean verifyExternalPort (NodeConnectorRef ncRef) { return (LacpDataListener.checkExternalNodeConn(ncRef.getValue())); } }
public static NodeConnectorRef nodeConnectorRefFromDatapathIdPortno(final BigInteger datapathId, final Long portNo, final OpenflowVersion ofVersion) { return new NodeConnectorRef(nodeConnectorInstanceIdentifierFromDatapathIdPortno(datapathId, portNo, ofVersion)); }
return false; } else if(!_nodeConnectorRef.equals(other.getNodeConnectorRef())) { return false;
/** * @param nodeConnectorRef * @return */ public static InstanceIdentifier<Node> generateNodeInstanceIdentifier(final NodeConnectorRef nodeConnectorRef) { return nodeConnectorRef.getValue().firstIdentifierOf(Node.class); }
private void publishNodeConnectorUpdate(final Map.Entry<InstanceIdentifier<?>,DataObject> entry, final UpdateType updateType) { if (entry.getKey().getTargetType().equals(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector.class)) { NodeConnectorRef nodeConnectorRef = new NodeConnectorRef(entry.getKey()); NodeConnector nodeConnector = null; try { nodeConnector = NodeMapping.toADNodeConnector(nodeConnectorRef); } catch (ConstructionException e) { LOG.debug("Construction exception: %s",e.getMessage()); } HashSet<Property> _aDNodeConnectorProperties = NodeMapping.toADNodeConnectorProperties((org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector) entry.getValue()); this.publishNodeConnectorUpdate(nodeConnector, updateType, _aDNodeConnectorProperties); } }
public static NodeKey getNodeKey(final NodeConnectorRef ref) { return ref.getValue().firstKeyOf(Node.class, NodeKey.class); }
@Override public NodeConnectorRemoved deleteNotification(final InstanceIdentifier<FlowCapableNodeConnector> path) { Preconditions.checkArgument(path != null); final NodeConnectorRemovedBuilder notifBuilder = new NodeConnectorRemovedBuilder(); notifBuilder.setNodeConnectorRef(new NodeConnectorRef(path)); return notifBuilder.build(); } }