use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project netvirt by opendaylight.
the class TestOdlInterfaceRpcService method getNodeconnectorIdFromInterface.
@Override
public Future<RpcResult<GetNodeconnectorIdFromInterfaceOutput>> getNodeconnectorIdFromInterface(GetNodeconnectorIdFromInterfaceInput input) {
String ifName = input.getIntfName();
// if the ifName is INTERFACE_NAME_NO_EXIST, then an empty response will be returned
GetNodeconnectorIdFromInterfaceOutputBuilder builder = new GetNodeconnectorIdFromInterfaceOutputBuilder();
if (ifName == GeniusProviderTestParams.INTERFACE_NAME) {
builder.setNodeconnectorId(new NodeConnectorId(GeniusProviderTestParams.NODE_CONNECTOR_ID_PREFIX + GeniusProviderTestParams.INTERFACE_NAME));
} else if (ifName == GeniusProviderTestParams.INTERFACE_NAME_INVALID) {
return Futures.immediateFuture(RpcResultBuilder.<GetNodeconnectorIdFromInterfaceOutput>failed().withError(ErrorType.APPLICATION, "Invalid data.").build());
}
return Futures.immediateFuture(RpcResultBuilder.<GetNodeconnectorIdFromInterfaceOutput>success(builder.build()).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project netvirt by opendaylight.
the class StatisticsImpl method getNodeConnectorResult.
private boolean getNodeConnectorResult(List<CounterResult> counters, BigInteger dpId, String portNumber) {
CounterResultDataStructure counterResultDS = counterRetriever.getNodeConnectorCountersDirect(new NodeId(CountersUtils.getNodeId(dpId)), new NodeConnectorId(CountersUtils.getNodeConnectorId(dpId, portNumber)));
if (counterResultDS == null) {
return false;
}
CounterResultBuilder crb = new CounterResultBuilder();
String resultId = CountersUtils.getNodeConnectorId(dpId, portNumber);
crb.setId(resultId);
createGroups(counters, counterResultDS, crb, resultId);
return !counters.isEmpty();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project netvirt by opendaylight.
the class InterfaceUtils method getDpIdFromInterface.
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));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project netvirt by opendaylight.
the class IfMgr method transmitRouterAdvertisement.
private void transmitRouterAdvertisement(VirtualPort intf, Ipv6RtrAdvertType advType) {
Ipv6RouterAdvt ipv6RouterAdvert = new Ipv6RouterAdvt(packetService);
LOG.debug("in transmitRouterAdvertisement for {}", advType);
VirtualNetwork vnet = getNetwork(intf.getNetworkID());
if (vnet != null) {
String nodeName;
String outPort;
Collection<VirtualNetwork.DpnInterfaceInfo> dpnIfaceList = vnet.getDpnIfaceList();
for (VirtualNetwork.DpnInterfaceInfo dpnIfaceInfo : dpnIfaceList) {
nodeName = Ipv6Constants.OPENFLOW_NODE_PREFIX + dpnIfaceInfo.getDpId();
List<NodeConnectorRef> ncRefList = new ArrayList<>();
for (Long ofPort : dpnIfaceInfo.ofPortList) {
outPort = nodeName + ":" + ofPort;
LOG.debug("Transmitting RA {} for node {}, port {}", advType, nodeName, outPort);
InstanceIdentifier<NodeConnector> outPortId = InstanceIdentifier.builder(Nodes.class).child(Node.class, new NodeKey(new NodeId(nodeName))).child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId(outPort))).build();
ncRefList.add(new NodeConnectorRef(outPortId));
}
if (!ncRefList.isEmpty()) {
ipv6RouterAdvert.transmitRtrAdvertisement(advType, intf, ncRefList, null);
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project netvirt by opendaylight.
the class IfMgr method updateInterfaceDpidOfPortInfo.
public void updateInterfaceDpidOfPortInfo(Uuid portId) {
LOG.debug("In updateInterfaceDpidOfPortInfo portId {}", portId);
Interface interfaceState = ipv6ServiceUtils.getInterfaceStateFromOperDS(portId.getValue());
if (interfaceState == null) {
LOG.warn("In updateInterfaceDpidOfPortInfo, port info not found in Operational Store {}.", portId);
return;
}
List<String> ofportIds = interfaceState.getLowerLayerIf();
NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0));
BigInteger dpId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId));
if (!dpId.equals(Ipv6Constants.INVALID_DPID)) {
Long ofPort = MDSALUtil.getOfPortNumberFromPortName(nodeConnectorId);
updateDpnInfo(portId, dpId, ofPort);
}
}
Aggregations