public static NodeConnectorId getDefaultInstance(String defaultValue) { return new NodeConnectorId(defaultValue); }
/** * Return the port identifier string in the given node connector ID. * * @param id A {@link NodeConnectorId} instance. * @return A port identifier string. * {@code null} is returned if the port identifier string is * not present. */ public static String getPortIdentifier(NodeConnectorId id) { return (id == null) ? null : id.getValue(); }
public static Object toADNodeConnectorId(final NodeConnectorId nodeConnectorId, final NodeId nodeId) { if (nodeConnectorId.equals(toLocalNodeConnectorId(nodeId)) || nodeConnectorId.equals(toNormalNodeConnectorId(nodeId)) || nodeConnectorId.equals(toControllerNodeConnectorId(nodeId))) { return org.opendaylight.controller.sal.core.NodeConnector.SPECIALNODECONNECTORID; } String nodeConnectorIdStripped = stripToColon(nodeConnectorId.getValue()); if (NUMBERS_ONLY.matcher(nodeConnectorIdStripped).matches()) { Short nodeConnectorIdVal = null; try { nodeConnectorIdVal = Short.valueOf(nodeConnectorIdStripped); return nodeConnectorIdVal; } catch (NumberFormatException e) { LOG.warn("nodeConnectorId not supported (long): {}", nodeConnectorIdStripped, e); } } return nodeConnectorIdStripped; }
public static MatchBuilder createInPortLocalMatch(MatchBuilder matchBuilder, Long dpidLong, String portId) { NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + portId); logger.debug("createInPortMatch() Node Connector ID is - Type=openflow: DPID={} inPort={} ", dpidLong, "LOCAL"); matchBuilder.setInPort(NodeConnectorId.getDefaultInstance(ncid.getValue())); matchBuilder.setInPort(ncid); return matchBuilder; }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } NodeConnectorStatisticsAndPortNumberMapKey other = (NodeConnectorStatisticsAndPortNumberMapKey) obj; if (_nodeConnectorId == null) { if (other._nodeConnectorId != null) { return false; } } else if(!_nodeConnectorId.equals(other._nodeConnectorId)) { return false; } return true; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_nodeConnectorId == null) ? 0 : _nodeConnectorId.hashCode()); return result; }
public static MatchBuilder createInPortReservedMatch(MatchBuilder matchBuilder, Long dpidLong, String inPort) { NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + inPort); LOG.debug("createInPortResrevedMatch() Node Connector ID is - Type=openflow: DPID={} inPort={} ", dpidLong, inPort); matchBuilder.setInPort(NodeConnectorId.getDefaultInstance(ncid.getValue())); matchBuilder.setInPort(ncid); return matchBuilder; }
public static String toNodeConnectorType(final NodeConnectorId ncId, final NodeId nodeId) { if (ncId.equals(toLocalNodeConnectorId(nodeId))) { return NodeConnectorIDType.SWSTACK; } else if (ncId.equals(toNormalNodeConnectorId(nodeId))) { return NodeConnectorIDType.HWPATH; } else if (ncId.equals(toControllerNodeConnectorId(nodeId))) { return NodeConnectorIDType.CONTROLLER; } return NodeConnectorIDType.OPENFLOW; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_queueId == null) ? 0 : _queueId.hashCode()); result = prime * result + ((_nodeConnectorId == null) ? 0 : _nodeConnectorId.hashCode()); return result; }
public static NodeConnectorId getNodeConnectorId(long ofPort, String nodeName) { return new NodeConnectorId(nodeName + ":" + ofPort); }
public static String getDpnFromNodeConnectorId(NodeConnectorId portId) { /* * NodeConnectorId is of form 'openflow:dpnid:portnum' */ String[] split = portId.getValue().split(OF_URI_SEPARATOR); return split[1]; }
/** * Create Ingress Port Match dpidLong, inPort * * @param matchBuilder Map matchBuilder MatchBuilder Object without a match * @param dpidLong Long the datapath ID of a switch/node * @param inPort Long ingress port on a switch * @return matchBuilder Map MatchBuilder Object with a match */ public static MatchBuilder createInPortMatch(MatchBuilder matchBuilder, Long dpidLong, Long inPort) { NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + inPort); LOG.debug("createInPortMatch() Node Connector ID is - Type=openflow: DPID={} inPort={} ", dpidLong, inPort); matchBuilder.setInPort(NodeConnectorId.getDefaultInstance(ncid.getValue())); matchBuilder.setInPort(ncid); return matchBuilder; }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } QueueIdAndStatisticsMapKey other = (QueueIdAndStatisticsMapKey) obj; if (_queueId == null) { if (other._queueId != null) { return false; } } else if(!_queueId.equals(other._queueId)) { return false; } if (_nodeConnectorId == null) { if (other._nodeConnectorId != null) { return false; } } else if(!_nodeConnectorId.equals(other._nodeConnectorId)) { return false; } return true; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_node == null) ? 0 : _node.hashCode()); result = prime * result + ((_nodeConnectorId == null) ? 0 : _nodeConnectorId.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
public static NodeConnectorId nodeConnectorIdfromDatapathPortNo(final BigInteger datapathid, final Long portNo, final OpenflowVersion ofVersion) { String logicalName = OpenflowPortsUtil.getPortLogicalName(ofVersion, portNo); return new NodeConnectorId(OF_URI_PREFIX + datapathid + ":" + (logicalName == null ? portNo : logicalName)); }
public static String getDpnFromNodeConnectorId(NodeConnectorId portId) { /* * NodeConnectorId is of form 'openflow:dpnid:portnum' */ String[] split = portId.getValue().split(OF_URI_SEPARATOR); return split[1]; }
return false; } else if(!_nodeConnectorId.equals(other.getNodeConnectorId())) { return false;
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_node == null) ? 0 : _node.hashCode()); result = prime * result + ((_nodeConnectorId == null) ? 0 : _nodeConnectorId.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
/** * Return a {@link NodeConnectorId} instance corresponding to this * instance. * * @return A {@link NodeConnectorId} instance. */ public NodeConnectorId getNodeConnectorId() { return new NodeConnectorId(toString()); }
public static String getDpnFromNodeConnectorId(NodeConnectorId portId) { /* * NodeConnectorId is of form 'openflow:dpnid:portnum' */ String[] split = portId.getValue().split(OF_URI_SEPARATOR); return split[1]; }