@Override protected InstanceIdentifier<Flow> getWildCardPath() { return InstanceIdentifier.create(Nodes.class).child(Node.class) .augmentation(FlowCapableNode.class).child(Table.class).child(Flow.class); }
@Nonnull @Override public Initialized<? extends DataObject> init(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier, @Nonnull MapServer mapServer, @Nonnull ReadContext readContext) { final InstanceIdentifier<MapServer> configId = InstanceIdentifier.create(Lisp.class) .child(LispFeatureData.class) .child(MapServers.class) .child(MapServer.class, instanceIdentifier.firstKeyOf(MapServer.class)); return Initialized.create(configId, mapServer); }
private void processFloatingIPAdd(final InstanceIdentifier<IpMapping> identifier, final IpMapping mapping) { LOG.trace("Add event - key: {}, value: {}", identifier, mapping); final String routerId = identifier.firstKeyOf(RouterPorts.class).getRouterId(); final PortsKey pKey = identifier.firstKeyOf(Ports.class); String interfaceName = pKey.getPortName(); InstanceIdentifier<RouterPorts> pIdentifier = identifier.firstIdentifierOf(RouterPorts.class); createNATFlowEntries(interfaceName, mapping, pIdentifier, routerId); }
InstanceIdentifierV3(final InstanceIdentifier<T> source) { pathArguments = source.pathArguments; targetType = source.getTargetType(); wildcarded = source.isWildcarded(); hash = source.hashCode(); }
@SuppressWarnings({ "rawtypes", "unchecked" }) private static ListBindingContext newInstance(final Class<? extends DataObject> bindingClass, final String listKeyValue) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { // We assume the yang list key type is string. Identifier keyInstance = (Identifier) bindingClass.getMethod(GET_KEY_METHOD).getReturnType() .getConstructor(String.class).newInstance(listKeyValue); InstanceIdentifier appConfigPath = InstanceIdentifier.builder((Class)bindingClass, keyInstance).build(); return new ListBindingContext(bindingClass, appConfigPath, listKeyValue); }
static InstanceIdentifier<Ingress> getCfgId( final InstanceIdentifier<Ingress> id) { return SubInterfaceCustomizer.getCfgId(RWUtils.cutId(id, SubInterface.class)) .augmentation(VppSubinterfaceAclAugmentation.class) .child(Acl.class) .child(Ingress.class); } }
@Override protected InstanceIdentifier<VppAcls> getCfgId( final InstanceIdentifier<VppAcls> id) { return getAclCfgId(RWUtils.cutId(id, Acl.class)).child(Egress.class) .child(VppAcls.class, id.firstKeyOf(VppAcls.class)); } }
/** * Method builds OVSDB Topology InstanceIdentifier * <p> * * @return InstanceIdentifier<Topology> */ public static InstanceIdentifier<Topology> buildOvsdbTopologyIID() { InstanceIdentifier<Topology> ovsdbTopologyIID = InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)); return ovsdbTopologyIID; }
public static PCEPTunnelTopologyProvider create(final DataBroker dataProvider, final InstanceIdentifier<Topology> sourceTopology, final TopologyId targetTopology) { final InstanceIdentifier<Topology> dst = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(targetTopology)).build(); final NodeChangedListener ncl = new NodeChangedListener(dataProvider, sourceTopology.firstKeyOf(Topology.class).getTopologyId(), dst); final InstanceIdentifier<Node> src = sourceTopology.child(Node.class); final ListenerRegistration<NodeChangedListener> reg = dataProvider.registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, src), ncl); return new PCEPTunnelTopologyProvider(dst, reg); }
public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev180319.interfaces._interface.sub.interfaces.SubInterface> getCfgId( final InstanceIdentifier<SubInterface> id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(SubinterfaceAugmentation.class) .child(SubInterfaces.class) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev180319.interfaces._interface.sub.interfaces.SubInterface.class, new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev180319.interfaces._interface.sub.interfaces.SubInterfaceKey( id.firstKeyOf(SubInterface.class).getIdentifier())); } }
@SuppressWarnings("unchecked") public static <D extends DataObject> InstanceIdentifier<D> appendTypeToId( final InstanceIdentifier<? extends DataObject> parentId, final InstanceIdentifier<D> type) { final InstanceIdentifier.PathArgument t = new InstanceIdentifier.Item<>(type.getTargetType()); return (InstanceIdentifier<D>) InstanceIdentifier.create(Iterables.concat( parentId.getPathArguments(), Collections.singleton(t))); }
private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node> createBindingPathForTopology(final NodeKey key) { final InstanceIdentifier<NetworkTopology> networkTopology = InstanceIdentifier.builder(NetworkTopology.class).build(); final KeyedInstanceIdentifier<Topology, TopologyKey> topology = networkTopology.child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName()))); return topology .child(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node.class, new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey (new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId(key.getId().getValue()))); }
/** * Return a MD-SAL node connector ID in the given instance identifier. * * @param path An {@link InstanceIdentifier} instance. * @return A MD-SAL node connector ID if found. * {@code null} if not found. */ public static NodeConnectorId getNodeConnectorId( InstanceIdentifier<?> path) { NodeConnectorKey key = path.firstKeyOf(NodeConnector.class); return (key == null) ? null : key.getId(); }
@SuppressWarnings("unchecked") private void removeData(final Set<InstanceIdentifier<?>> removeData, final Map<InstanceIdentifier<?>, DataObject> originalData) { for (InstanceIdentifier<?> key : removeData) { if (clazz.equals(key.getTargetType())) { final InstanceIdentifier<T> ident = key.firstIdentifierOf(clazz); final DataObject removeValue = originalData.get(key); this.remove(ident, (T)removeValue); } } }
private void onDataDeleted(final AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> change) { Set<InstanceIdentifier<?>> removed = change.getRemovedPaths(); for (InstanceIdentifier<?> eachPath : removed) { if (eachPath.getTargetType() == FlowCapableNodeConnectorStatisticsData.class) { String name = eachPath.firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId().getValue(); nodeStatisticData.remove(name); } } } });
@SuppressWarnings("unchecked") ContainerBindingContext(final Class<? extends DataObject> appConfigBindingClass) { super((Class<DataObject>) appConfigBindingClass, InstanceIdentifier.create((Class<DataObject>) appConfigBindingClass), ContainerSchemaNode.class); }
private void registerListner(final EventSourceTopology eventSourceTopology) { this.listenerRegistration = eventSourceTopology.getDataBroker().registerDataTreeChangeListener( DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, EventSourceTopology.EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class)), this); }
private Node getNode(Map<InstanceIdentifier<?>, DataObject> changes, Map.Entry<InstanceIdentifier<?>, DataObject> change) { InstanceIdentifier<Node> nodeInstanceIdentifier = change.getKey().firstIdentifierOf(Node.class); return (Node)changes.get(nodeInstanceIdentifier); }
@Override public <D extends DataObject & Identifiable<K>, K extends Identifier<D>> void addStructuralListReader(@Nonnull InstanceIdentifier<D> id, @Nonnull Class<? extends Builder<D>> builderType, @Nonnull List<K> staticKeys) { checkArgument(Identifiable.class.isAssignableFrom(id.getTargetType()), "Node %s is not keyed, use addStructuralReader()", id.getTargetType()); add(GenericListReader.createReflexive(id, builderType, staticKeys)); }
/** * {@inheritDoc} */ @Override protected InstanceIdentifier<VtnFlowCondition> getWildcardPath() { return InstanceIdentifier.builder(VtnFlowConditions.class). child(VtnFlowCondition.class).build(); }