public static NodeId nodeIdFromDatapathId(final BigInteger datapathId) { // FIXME: Convert to textual representation of datapathID String current = datapathId.toString(); return new NodeId(OF_URI_PREFIX + current); }
/** * @param nodeId containing "<NodeTypeString>:<plainIntegerId>" * @return adNodeId form */ public static String toADNodeId(final NodeId nodeId) { if (nodeId == null) { return null; } return nodeId.getValue(); }
/** * Test if the specified MAC address table entry should be accepted or not. * * @param ment A {@link MacTableEntry} instance to be tested. * @return {@code true} only if the specified entry was detected on the * specified physical switch. */ @Override public boolean accept(MacTableEntry ment) { return targetNode.equals(ment.getNode()); } }
public TransactionChainManagerRegistration provideTransactionChainManager(final ConnectionContext connectionContext) { final NodeId nodeId = connectionContext.getNodeId(); TransactionChainManager transactionChainManager; boolean ownedByCurrentContext = false; synchronized (this) { transactionChainManager = txChManagers.get(nodeId); if (null == transactionChainManager) { LOG.info("Creating new transaction chain for device {}", nodeId.toString()); Registration registration = new Registration() { @Override public void close() throws Exception { txChManagers.remove(nodeId); } }; transactionChainManager = new TransactionChainManager(dataBroker, InventoryDataServiceUtil.createNodeInstanceIdentifier(connectionContext.getNodeId()), registration); txChManagers.put(nodeId, transactionChainManager); ownedByCurrentContext = true; } } TransactionChainManagerRegistration transactionChainManagerRegistration = new TransactionChainManagerRegistration(ownedByCurrentContext, transactionChainManager); return transactionChainManagerRegistration; }
public static NodeId nodeIdFromDatapathId(final BigInteger datapathId) { // FIXME: Convert to textual representation of datapathID String current = String.valueOf(datapathId); return new NodeId("openflow:" + current); }
@Override public void instantiateServiceInstance() { LOG.debug("FRM started for: {}", nodeId.getValue()); deviceMastered = true; }
private boolean containsLinkNodeId(final EndPointGroup endPointGroup, final NodeId linkNodeId) { final String nodeIdValue = extractNodeId(endPointGroup).getValue(); return linkNodeId.equals(nodeIdValue); }
public static NodeId nodeIdFromDatapathId(final BigInteger datapathId) { // FIXME: Convert to textual representation of datapathID String current = String.valueOf(datapathId); return new NodeId("openflow:" + current); }
public static String radioheadIdFromNodeId(final NodeId nodeId) { String radioheadId = nodeId.getValue().replace(OCP_URI_PREFIX, ""); return radioheadId; }
/** * Return a future associated with the task to read flow statistics * about the given VTN flow entry. * * @param vfent The target flow entry. * @return A {@link VTNFuture} instance which returns the flow statistics * about the specified flow entry. */ public VTNFuture<FlowStatsRecord> get(VtnFlowEntry vfent) { assert vfent.getNode().equals(targetNode.getNodeId()); BigInteger cookie = vfent.getCookie().getValue(); SettableVTNFuture<FlowStatsRecord> f = getFuture(cookie); if (txState.get() >= STATE_COMPLETED) { // No more statistics will be received. f.set(null); } return f; }
public static NodeId toAdNodeId(final NodeConnectorId nodeConnectorId) { NodeId nodeId = null; if (nodeConnectorId != null) { nodeId = new NodeId(COLON_NUMBERS_EOL.matcher(nodeConnectorId.getValue()).replaceFirst("")); } return nodeId; }
/** * Return a {@link NodeId} instance that specifies the same OpenFlow switch * as this instance. * * @return A {@link NodeId} instance. */ public NodeId getNodeId() { return new NodeId(toString()); }
public static BigInteger dataPathIdFromNodeId(final NodeId nodeId) { String dpids = nodeId.getValue().replace(OF_URI_PREFIX, ""); BigInteger dpid = new BigInteger(dpids); return dpid; }
/** * Return a {@link NodeId} instance corresponding to this instance. * * @return A {@link NodeId} instance. */ public final NodeId getNodeId() { return new NodeId(toNodeString()); }
private void setStatus(SwitchStatus newStatus) { if (Objects.equal(status, newStatus)) { return; } LOG.debug("Switch {} is changing status from {} to {}", nodeId.getValue(), this.status, newStatus); this.status = newStatus; }
private Future<RpcResult<TransactionStatus>> internalModifyFlowAsync(final Node node, final Flow oldFlow, final Flow newFlow, final long rid) { final Map<Flow,UUID> cache = this.getCache(); UUID flowId = cache.remove(oldFlow); if (flowId == null) { flowId = UUID.randomUUID(); cache.put(oldFlow, flowId); LOG.warn("Could not find flow {} in cache, assigned new ID {}", oldFlow.hashCode(), flowId); } cache.put(newFlow, flowId); return this.writeFlowAsync(MDFlowMapping.toMDFlow(newFlow, flowId.toString()), new NodeKey( new NodeId(NodeMapping.OPENFLOW_ID_PREFIX + node.getID()))); }
@Override public ListenableFuture<Void> closeServiceInstance() { LOG.debug("FRM stopped for: {}", nodeId.getValue()); deviceMastered = false; return Futures.immediateFuture(null); }
private static NodeRef createNodeRef(String string) { NodeKey key = new NodeKey(new NodeId(string)); InstanceIdentifier<Node> path = InstanceIdentifier.create(Nodes.class).child(Node.class, key); return new NodeRef(path); }
private static BigInteger dataPathIdFromNodeId(final NodeId nodeId) { String dpids = nodeId.getValue().replace(OF_URI_PREFIX, ""); return new BigInteger(dpids); }