/** * @return the NodeId */ public Long getnodeconnectornodeId() { return (Long) this.nodeConnector.getNode().getID(); }
/** * Node Disconnected from the node's master controller. */ @Override public void notifyNodeDisconnectFromMaster(Node node) { ISwitch sw = switches.get((Long)node.getID()); if (sw != null) notifySwitchAdded(sw); } }
private Element getSwitchFunctionConfig(Node node, VsFunctionName funcName){ Long nodeID = (Long)node.getID(); String modelName = cmethUtil.getModel(nodeID); return getSwitchFunctionConfig(modelName, funcName); }
@Override public void updateNode(Node node, UpdateType type, Set<Property> props) { Long switchId = (Long) node.getID(); switch (type) { case ADDED: addStatisticsTicks(switchId); break; case REMOVED: clearFlowStatsAndTicks(switchId); default: } }
@Override public void updateNode(Node node, UpdateType type, Set<Property> props) { Long switchId = (Long) node.getID(); switch (type) { case ADDED: addStatisticsTicks(switchId); break; case REMOVED: clearFlowStatsAndTicks(switchId); default: } }
/** * @param aDNode * @return */ public static NodeId toNodeId(org.opendaylight.controller.sal.core.Node aDNode) { String targetPrefix = null; if (NodeIDType.OPENFLOW.equals(aDNode.getType())) { targetPrefix = OPENFLOW_ID_PREFIX; } else { targetPrefix = aDNode.getType() + ":"; } return new NodeId(targetPrefix + String.valueOf(aDNode.getID())); }
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()))); }
public List<NodeConnector> getVLANPorts(Node node, Integer vlanID){ Status status = checkNodeIpValid(node); if(status.getCode() != StatusCode.SUCCESS) return null; if(!isValidVlan(vlanID)) return null; if(isDummy) return new CopyOnWriteArrayList<NodeConnector>(); long nodeId = ((Long)node.getID()).longValue(); int vlanId = vlanID.intValue(); List<NodeConnector> ncList = new SNMPHandler(cmethUtil).getVLANPorts(nodeId, vlanId); if(ncList == null) logger.debug("ERROR: getVLANPorts(): fail to get VLAN (node:" + nodeId + "(" + getNodeIP(nodeId) + ")" + ", vlanId:" + vlanId + ")'s ports"); return ncList; }
public VLANTable getVLANTable(Node node){ Status status = checkNodeIpValid(node); if(status.getCode() != StatusCode.SUCCESS) return null; if(isDummy) return new VLANTable(); long nodeId = ((Long)node.getID()).longValue(); VLANTable vlanTable = new SNMPHandler(cmethUtil).getVLANTable(nodeId); if(vlanTable == null) logger.debug("ERROR: getVLANTable(): fail to get VLAN table on node " + nodeId); return vlanTable; }
@Override public Status disconnect(Node node) { ISwitch sw = getSwitch((Long) node.getID()); if (sw != null) disconnectSwitch(sw); return new Status(StatusCode.SUCCESS); }
private Future<RpcResult<TransactionStatus>> internalAddFlowAsync(final Node node, final Flow flow, final long rid) { final Map<Flow,UUID> cache = this.getCache(); UUID flowId = cache.get(flow); if (flowId != null) { this.removeFlow(node, flow); } flowId = UUID.randomUUID(); cache.put(flow, flowId); return this.writeFlowAsync(MDFlowMapping.toMDFlow(flow, flowId.toString()), new NodeKey( new NodeId(NodeMapping.OPENFLOW_ID_PREFIX + node.getID()))); }
@Override public NodeDescription readDescription(Node node, boolean cached) { if (controller == null) { logger.error("Internal plugin error"); return null; } long sid = (Long) node.getID(); List<OFStatistics> ofList = (cached == true) ? statsMgr .getOFDescStatistics(sid) : statsMgr.queryStatistics(sid, OFStatisticsType.DESC, null); return new DescStatisticsConverter(ofList).getHwDescription(); }
@Override public NodeDescription readDescription(Node node, boolean cached) { if (controller == null) { logger.error("Internal plugin error"); return null; } long sid = (Long) node.getID(); List<OFStatistics> ofList = (cached == true) ? statsMgr .getOFDescStatistics(sid) : statsMgr.queryStatistics(sid, OFStatisticsType.DESC, null); return new DescStatisticsConverter(ofList).getHwDescription(); }
@Override public long getTransmitRate(String containerName, NodeConnector connector) { if (!containerOwnsNodeConnector(containerName, connector)) { return 0; } long switchId = (Long) connector.getNode().getID(); short port = (Short) connector.getID(); return statsMgr.getTransmitRate(switchId, port); }
@Override public long getTransmitRate(String containerName, NodeConnector connector) { if (!containerOwnsNodeConnector(containerName, connector)) { return 0; } long switchId = (Long) connector.getNode().getID(); short port = (Short) connector.getID(); return statsMgr.getTransmitRate(switchId, port); }
@Override public List<NodeConnectorStatistics> readAllNodeConnector( String containerName, Node node, boolean cached) { long sid = (Long) node.getID(); List<OFStatistics> ofList = (cached == true) ? statsMgr .getOFPortStatistics(sid) : statsMgr.queryStatistics(sid, OFStatisticsType.FLOW, null); List<OFStatistics> filteredList = filterPortListPerContainer( containerName, sid, ofList); return new PortStatisticsConverter(sid, filteredList) .getNodeConnectorStatsList(); }
public static NodeRef toNodeRef(final org.opendaylight.controller.sal.core.Node node) { Preconditions.checkArgument(NodeIDType.OPENFLOW.equals(node.getType())); final Long nodeId = Arguments.<Long>checkInstanceOf(node.getID(), Long.class); final NodeKey nodeKey = new NodeKey(new NodeId(OPENFLOW_ID_PREFIX + nodeId)); final InstanceIdentifier<Node> nodePath = InstanceIdentifier.builder(Nodes.class).child(NODE_CLASS, nodeKey).toInstance(); return new NodeRef(nodePath); }
@Override public List<FlowOnNode> readAllFlow(String container, Node node, boolean cached) { long sid = (Long) node.getID(); List<OFStatistics> ofList = (cached == true) ? statsMgr .getOFFlowStatistics(sid) : statsMgr.queryStatistics(sid, OFStatisticsType.FLOW, null); // Convert and filter the statistics per container List<FlowOnNode> flowOnNodeList = new FlowStatisticsConverter(ofList).getFlowOnNodeList(node); return filterFlowListPerContainer(container, node, flowOnNodeList); }
@Override public List<NodeTableStatistics> readAllNodeTable(String containerName, Node node, boolean cached) { long sid = (Long) node.getID(); List<OFStatistics> ofList = (cached == true) ? statsMgr.getOFTableStatistics(sid) : statsMgr.queryStatistics(sid, OFStatisticsType.TABLE, null); List<OFStatistics> filteredList = filterTableListPerContainer(containerName, sid, ofList); return new TableStatisticsConverter(sid, filteredList).getNodeTableStatsList(); }
@Override public List<NodeConnectorStatistics> readAllNodeConnector(String containerName, Node node, boolean cached) { long sid = (Long) node.getID(); List<OFStatistics> ofList = (cached == true) ? statsMgr .getOFPortStatistics(sid) : statsMgr.queryStatistics(sid, OFStatisticsType.PORT, null); List<OFStatistics> filteredList = filterPortListPerContainer(containerName, sid, ofList); return new PortStatisticsConverter(sid, filteredList).getNodeConnectorStatsList(); }