use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier in project bgpcep by opendaylight.
the class NodeNlriParser method parseObjectType.
@Override
protected ObjectType parseObjectType(final ByteBuf buffer) {
final NodeCaseBuilder builder = new NodeCaseBuilder();
builder.setNodeDescriptors(new NodeDescriptorsBuilder((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.NodeIdentifier) SimpleNlriTypeRegistry.getInstance().parseTlv(buffer)).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier in project bgpcep by opendaylight.
the class AbstractNodeDescriptorTlvCodec method parseNodeDescriptor.
protected static NodeIdentifier parseNodeDescriptor(final ByteBuf value, final Map<QName, Object> parsedSubTlvs) {
parsedSubTlvs.putAll(SimpleNlriTypeRegistry.getInstance().parseSubTlvs(value));
final AsNumber asNumber = (AsNumber) parsedSubTlvs.get(AsNumTlvParser.AS_NUMBER_QNAME);
final DomainIdentifier domainId = (DomainIdentifier) parsedSubTlvs.get(DomainIdTlvParser.DOMAIN_ID_QNAME);
final AreaIdentifier areaId = (AreaIdentifier) parsedSubTlvs.get(AreaIdTlvParser.AREA_ID_QNAME);
final CRouterIdentifier routerId = (CRouterIdentifier) parsedSubTlvs.get(CRouterIdentifier.QNAME);
return new NodeIdentifier() {
@Override
public Class<? extends DataContainer> getImplementedInterface() {
return NodeIdentifier.class;
}
@Override
public AsNumber getAsNumber() {
return asNumber;
}
@Override
public DomainIdentifier getDomainId() {
return domainId;
}
@Override
public AreaIdentifier getAreaId() {
return areaId;
}
@Override
public CRouterIdentifier getCRouterIdentifier() {
return routerId;
}
};
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier in project openflowplugin by opendaylight.
the class OpenflowpluginTestServiceProvider method register.
public ObjectRegistration<OpenflowpluginTestServiceProvider> register(final ProviderContext ctx) {
RoutedRpcRegistration<SalFlowService> addRoutedRpcImplementation = ctx.<SalFlowService>addRoutedRpcImplementation(SalFlowService.class, this);
setFlowRegistration(addRoutedRpcImplementation);
InstanceIdentifierBuilder<Nodes> builderII = InstanceIdentifier.<Nodes>builder(Nodes.class);
NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
NodeKey nodeKey = new NodeKey(nodeId);
InstanceIdentifierBuilder<Node> nodeIdentifier = builderII.<Node, NodeKey>child(Node.class, nodeKey);
InstanceIdentifier<Node> instance = nodeIdentifier.build();
flowRegistration.registerPath(NodeContext.class, instance);
RoutedRpcRegistration<SalFlowService> flowRegistration2 = getFlowRegistration();
return new AbstractObjectRegistration<OpenflowpluginTestServiceProvider>(this) {
@Override
protected void removeRegistration() {
flowRegistration2.close();
}
};
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier in project genius by opendaylight.
the class HwVTEPConfigListener method add.
@Override
public void add(@Nonnull Interface newInterface) {
// HwVTEPs support only VXLAN
IfTunnel ifTunnel = newInterface.getAugmentation(IfTunnel.class);
if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
ParentRefs parentRefs = newInterface.getAugmentation(ParentRefs.class);
if (parentRefs != null && parentRefs.getNodeIdentifier() != null) {
LOG.debug("Received HwVTEP Interface Add Event: {}", newInterface.getName());
LOG.trace("Received HwVTEP Interface Add Event: {}", newInterface);
for (NodeIdentifier nodeIdentifier : parentRefs.getNodeIdentifier()) {
if (SouthboundUtils.HWVTEP_TOPOLOGY.equals(nodeIdentifier.getTopologyId())) {
coordinator.enqueueJob(newInterface.getName(), () -> HwVTEPInterfaceConfigAddHelper.addConfiguration(txRunner, createPhysicalSwitchInstanceIdentifier(nodeIdentifier.getNodeId()), createGlobalNodeInstanceIdentifier(nodeIdentifier.getNodeId()), newInterface, ifTunnel), IfmConstants.JOB_MAX_RETRIES);
}
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier in project genius by opendaylight.
the class HwVTEPConfigListener method update.
@Override
public void update(@Nonnull Interface originalInterface, @Nonnull Interface updatedInterface) {
// HwVTEPs support only VXLAN
IfTunnel ifTunnel = originalInterface.getAugmentation(IfTunnel.class);
if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
ParentRefs parentRefs = originalInterface.getAugmentation(ParentRefs.class);
if (parentRefs != null && parentRefs.getNodeIdentifier() != null) {
LOG.debug("Received HwVTEP Interface Update Event: {}", originalInterface.getName());
LOG.trace("Received HwVTEP Interface Update Event: updatedInterface: {}, OriginalInterface: {}", updatedInterface, originalInterface);
for (NodeIdentifier nodeIdentifier : parentRefs.getNodeIdentifier()) {
if (SouthboundUtils.HWVTEP_TOPOLOGY.equals(nodeIdentifier.getTopologyId())) {
coordinator.enqueueJob(originalInterface.getName(), () -> HwVTEPInterfaceConfigUpdateHelper.updateConfiguration(txRunner, createPhysicalSwitchInstanceIdentifier(nodeIdentifier.getNodeId()), createGlobalNodeInstanceIdentifier(nodeIdentifier.getNodeId()), updatedInterface, ifTunnel), IfmConstants.JOB_MAX_RETRIES);
}
}
}
}
}
Aggregations