public static NodeConnectorId getNodeConnectorId(NodeId nodeId, long portNumber) { if (nodeId == null) return null; String nodeConnectorIdStr = nodeId.getValue() + ":" + portNumber; return new NodeConnectorId(nodeConnectorIdStr); }
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)); }
/** * Return a {@link NodeConnectorId} instance corresponding to this * instance. * * @return A {@link NodeConnectorId} instance. */ public NodeConnectorId getNodeConnectorId() { return new NodeConnectorId(toString()); }
private NodeConnectorId createNodeConnectorId(String connectorId, NodeId nodeId) { StringBuilder stringId = new StringBuilder(nodeId.getValue()).append(":").append(connectorId); return new NodeConnectorId(stringId.toString()); }
public static BigInteger getDpIdFromInterface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState) { String lowerLayerIf = ifState.getLowerLayerIf().get(0); NodeConnectorId nodeConnectorId = new NodeConnectorId(lowerLayerIf); return new BigInteger(getDpnFromNodeConnectorId(nodeConnectorId)); }
public static BigInteger getDpIdFromInterface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState) { String lowerLayerIf = ifState.getLowerLayerIf().get(0); NodeConnectorId nodeConnectorId = new NodeConnectorId(lowerLayerIf); return new BigInteger(getDpnFromNodeConnectorId(nodeConnectorId)); }
private static MatchBuilder createInphyportMatch(NodeId nodeId) { MatchBuilder match = new MatchBuilder(); match.setInPort(new NodeConnectorId(nodeId + ":202")); match.setInPhyPort(new NodeConnectorId(nodeId + ":10122")); return match; }
public static BigInteger getDpIdFromIterfaceState(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf .interfaces.rev140508.interfaces.state.Interface interfaceState) { BigInteger dpId = null; List<String> ofportIds = interfaceState.getLowerLayerIf(); if (ofportIds != null && !ofportIds.isEmpty()) { NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0)); dpId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId)); } return dpId; }
public static BigInteger getDpIdFromInterface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState) { String lowerLayerIf = ifState.getLowerLayerIf().get(0); NodeConnectorId nodeConnectorId = new NodeConnectorId(lowerLayerIf); return new BigInteger(getDpnFromNodeConnectorId(nodeConnectorId)); }
private BigInteger getDpnIdFromInterfaceState(Interface inter) { String lowerLayerIf = inter.getLowerLayerIf().get(0); NodeConnectorId nodeConnectorId = new NodeConnectorId(lowerLayerIf); BigInteger dpId = new BigInteger(getDpnFromNodeConnectorId(nodeConnectorId)); return dpId; }
private static MatchBuilder createInphyportMatch(final NodeId nodeId) { final MatchBuilder match = new MatchBuilder(); match.setInPort(new NodeConnectorId(nodeId + ":202")); match.setInPhyPort(new NodeConnectorId(nodeId + ":10122")); return match; }
public static NodeConnectorKey toNodeConnectorKey(final org.opendaylight.controller.sal.core.NodeConnector nc) { final NodeConnectorId nodeConnectorId = new NodeConnectorId(InventoryMapping.toNodeConnectorId(nc)); return new NodeConnectorKey(nodeConnectorId); }
@Override protected void remove(InstanceIdentifier<Interface> identifier, Interface del) { String interfaceName = del.getName(); List<String> ofportIds = del.getLowerLayerIf(); NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0)); BigInteger dpId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId)); logger.trace("Received remove DCN for interface {} dpId {}", interfaceName, dpId); unInstallDhcpEntries(interfaceName, dpId); }
@Override protected void add(InstanceIdentifier<Interface> identifier, Interface add) { String interfaceName = add.getName(); List<String> ofportIds = add.getLowerLayerIf(); NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0)); BigInteger dpId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId)); logger.trace("Received add DCN for interface {}, dpid {}", interfaceName, dpId); installDhcpEntries(interfaceName, dpId); }
public static NodeConnectorRef createNodeConnRef(final String nodeId, final String port) { StringBuilder sBuild = new StringBuilder(nodeId).append(':').append(port); NodeConnectorKey nConKey = new NodeConnectorKey(new NodeConnectorId(sBuild.toString())); InstanceIdentifier<NodeConnector> path = InstanceIdentifier.<Nodes>builder(Nodes.class) .<Node, NodeKey>child(Node.class, new NodeKey(new NodeId(nodeId))) .<NodeConnector, NodeConnectorKey>child(NodeConnector.class, nConKey) .build(); return new NodeConnectorRef(path); }
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 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; }
private InstanceIdentifier createNCId(String nodeId, String nodeConnId) { return (InstanceIdentifier.builder(Nodes.class).child(Node.class, new NodeKey(new NodeId(nodeId))) .child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId(nodeConnId))).build()); } }
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(); }
/** * Create a instance identifier which specifies the given switch port. * * @param pid The port identifier. * @return An {@link InstanceIdentifier} instance. */ public static InstanceIdentifier<NodeConnector> getPortPath(String pid) { String nid = OfMockUtils.getNodeIdentifier(pid); NodeConnectorId ncid = new NodeConnectorId(pid); return InstanceIdentifier.builder(Nodes.class). child(Node.class, new NodeKey(new NodeId(nid))). child(NodeConnector.class, new NodeConnectorKey(ncid)).build(); }