/** * @param nodeId containing "<NodeTypeString>:<plainIntegerId>" * @return adNodeId form */ public static String toADNodeId(final NodeId nodeId) { if (nodeId == null) { return null; } return nodeId.getValue(); }
@Override public void instantiateServiceInstance() { LOG.debug("FRM started for: {}", nodeId.getValue()); deviceMastered = true; }
/** * Many uses in log, this will make code more readable * @return string representation of nodeId */ default String getLOGValue() { return getNodeId().getValue(); }
public void setFlowCapableNode(FlowCapableNode fcNode) { this.fcNode = fcNode; LOG.trace("Switch {} set {}", nodeId.getValue(), fcNode); updateStatus(); }
/** * Get a 32-bit context ordinal suitable for use in the OF data plane for * the given policy item. * * @param destNode * destination node ID * @return the 32-bit ordinal value * @throws Exception throws all exception */ public static int getContextOrdinal(NodeId destNode) throws Exception { return getContextOrdinalFromString(destNode.getValue()); }
public DeviceMastership(final NodeId nodeId) { this.nodeId = nodeId; this.identifier = ServiceGroupIdentifier.create(nodeId.getValue()); this.deviceMastered = false; }
public static MacAddress toADMacAddress(final NodeId id) { final String nodeId = id.getValue().replaceAll(OPENFLOW_ID_PREFIX, ""); BigInteger nodeIdRaw = new BigInteger(nodeId); long lNodeId = nodeIdRaw.longValue(); byte[] bytesFromDpid = ToSalConversionsUtils.bytesFromDpid(lNodeId); return new MacAddress(bytesFromDpid); }
@Override public void onFailure(Throwable cause) { String msg = "add-group RPC failed: node=" + nodeIdentity.firstKeyOf(Node.class).getId().getValue() + ", id=" + groupId; LOG.error(msg, cause); } });
public void setConfig(OfOverlayNodeConfig config) { this.nodeConfig = config; LOG.trace("Switch {} set {}", nodeId.getValue(), config); update(); updateStatus(); }
public void setNodeConnectorConfig(InstanceIdentifier<NodeConnector> ncIid, FlowCapableNodeConnector fcnc) { if (fcnc == null) { fcncByNcIid.remove(ncIid); } else { fcncByNcIid.put(ncIid, fcnc); } LOG.trace("Switch {} node connector {} set {}", nodeId.getValue(), ncIid.firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId().getValue(), fcnc); update(); updateStatus(); }
public void remove(InstanceIdentifier<FlowCapableNode> identifier, FlowCapableNode del, InstanceIdentifier<FlowCapableNode> nodeIdent) { if(compareInstanceIdentifierTail(identifier,II_TO_FLOW_CAPABLE_NODE)){ if (LOG.isDebugEnabled()) { LOG.debug("Node removed: {}",nodeIdent.firstKeyOf(Node.class).getId().getValue()); } if ( ! nodeIdent.isWildcarded()) { flowNodeDisconnected(nodeIdent); } } }
protected NodeId provideTopologyNodeId(InstanceIdentifier<T> iiToNodeInInventory) { final NodeKey inventoryNodeKey = iiToNodeInInventory.firstKeyOf(Node.class, NodeKey.class); if (inventoryNodeKey != null) { return new NodeId(inventoryNodeKey.getId().getValue()); } return null; }
@Override protected void remove(InstanceIdentifier<Flow> identifier, Flow del) { BigInteger dpId = getDpnFromString(identifier.firstKeyOf(Node.class, NodeKey.class).getId().getValue()); notifyTaskIfRequired(dpId, del); }
public void add(InstanceIdentifier<FlowCapableNode> identifier, FlowCapableNode add, InstanceIdentifier<FlowCapableNode> nodeIdent) { if(compareInstanceIdentifierTail(identifier,II_TO_FLOW_CAPABLE_NODE)){ if (LOG.isDebugEnabled()) { LOG.debug("Node added: {}",nodeIdent.firstKeyOf(Node.class).getId().getValue()); } if ( ! nodeIdent.isWildcarded()) { flowNodeConnected(nodeIdent); } } }
@Override protected void remove(InstanceIdentifier<Group> identifier, Group del) { BigInteger dpId = getDpnFromString(identifier.firstKeyOf(Node.class, NodeKey.class).getId().getValue()); executeNotifyTaskIfRequired(dpId, del); }
@Override protected void add(InstanceIdentifier<Flow> identifier, Flow add) { BigInteger dpId = getDpnFromString(identifier.firstKeyOf(Node.class, NodeKey.class).getId().getValue()); notifyTaskIfRequired(dpId, add); } }
public static org.opendaylight.controller.sal.core.Node toAdNode(final InstanceIdentifier<Node> identifier) { @SuppressWarnings("unchecked") final NodeKey tpKey = ((KeyedInstanceIdentifier<Node,NodeKey>)identifier).getKey(); return InventoryMapping.nodeFromNodeId(tpKey.getId().getValue()); }
@Override protected void update(InstanceIdentifier<Group> identifier, Group original, Group update) { BigInteger dpId = getDpnFromString(identifier.firstKeyOf(Node.class, NodeKey.class).getId().getValue()); executeNotifyTaskIfRequired(dpId, update); }
private static void deregisterRoutedRPCForSwitch(MDSwitchMetaData entityMetadata) { ModelDrivenSwitchRegistration registration = entityMetadata.getContext().getProviderRegistration(); if (null != registration) { registration.close(); entityMetadata.getContext().setProviderRegistration(null); entityMetadata.setIsRPCRegistrationDone(false); } LOG.info("deregisterRoutedRPCForSwitch: De-registered routed rpc for ModelDrivenSwitch {}", entityMetadata.getOfSwitch().getNodeId().getValue()); }
private static void sendNodeAddedNotification(MDSwitchMetaData entityMetadata) { //Node added notification need to be sent irrespective of whether // *this* instance is owner of the entity or not. Because yang notifications // are local, and we should maintain the behavior across the application. LOG.info("sendNodeAddedNotification: Node Added notification is sent for ModelDrivenSwitch {}", entityMetadata.getOfSwitch().getNodeId().getValue()); entityMetadata.getContext().getNotificationEnqueuer().enqueueNotification( entityMetadata.getWrappedNotification()); //Send multipart request to get other details of the switch. entityMetadata.getOfSwitch().requestSwitchDetails(); }