@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); }
@Deprecated public final InstanceIdentifier<Tables> tableInstanceIdentifier(final Class<? extends AddressFamily> afi, final Class<? extends SubsequentAddressFamily> safi) { return this.locRibReference.getInstanceIdentifier().builder().child(LocRib.class).child(Tables.class, new TablesKey(afi, safi)).build(); }
private void createNodesListIfNotPresent(final WriteTransaction writeTx) { final Nodes nodes = new NodesBuilder().build(); final InstanceIdentifier<Nodes> path = InstanceIdentifier.builder(Nodes.class).build(); logger.trace("{}: Merging {} container to ensure its presence", id, Nodes.QNAME, writeTx.getIdentifier()); writeTx.merge(LogicalDatastoreType.CONFIGURATION, path, nodes); writeTx.merge(LogicalDatastoreType.OPERATIONAL, path, nodes); }
public static InstanceIdentifier<FlowCapableNode> flowCapableNode(String nodeId) { return InstanceIdentifier .builder(Nodes.class) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(new NodeId(nodeId))) .augmentation(FlowCapableNode.class) .build(); }
public static InstanceIdentifier<SecurityRuleGroups> securityGroupsIid() { return InstanceIdentifier.builder(TenantLogicalNetworks.class) .child(TenantLogicalNetwork.class) .child(SecurityRuleGroupsContainer.class) .child(SecurityRuleGroups.class) .build(); }
protected static InstanceIdentifier<ChildPools> getChildPoolsInstanceIdentifier(String poolName, String localPoolName) { InstanceIdentifier<ChildPools> childPools = InstanceIdentifier .builder(IdPools.class) .child(IdPool.class, new IdPoolKey(poolName)) .child(ChildPools.class, new ChildPoolsKey(localPoolName)).build(); return childPools; }
public static InstanceIdentifier<ProviderPhysicalNetworkAsL2FloodDomain> providerPhysicalNetworkAsL2FloodDomainIid( TenantId tenantId, ContextId domainId) { return InstanceIdentifier.builder( org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.Mappings.class) .child(NeutronByGbpMappings.class) .child(ProviderNetworksAsL2FloodDomains.class) .child(ProviderPhysicalNetworkAsL2FloodDomain.class, new ProviderPhysicalNetworkAsL2FloodDomainKey(domainId, tenantId)) .build(); }
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); }
/** * Return an instance identifier that specifies the VTN. * * @param tname The name of the VTN. * @return An {@link InstanceIdentifier} instance. */ public static InstanceIdentifier<Vtn> getTenantPath(String tname) { VtnKey vtnKey = new VtnKey(new VnodeName(tname)); return InstanceIdentifier.builder(Vtns.class). child(Vtn.class, vtnKey). build(); }
/** * Creates an Instance Identifier (path) for node with specified id * * @param nodeId the ID of the node * @return the {@link InstanceIdentifier} */ public static final InstanceIdentifier<Node> createNodePath(final NodeId nodeId) { return InstanceIdentifier.builder(Nodes.class).child(Node.class, new NodeKey(nodeId)).build(); }
/** * {@inheritDoc} */ @Override protected InstanceIdentifier<BridgeStatus> newStatusPath() { return getVBridgeIdentifierBuilder().child(BridgeStatus.class).build(); }
/** * {@inheritDoc} */ @Override protected InstanceIdentifier<VtnFlowCondition> getWildcardPath() { return InstanceIdentifier.builder(VtnFlowConditions.class). child(VtnFlowCondition.class).build(); }
/** * Return an instance identifier for a VTN node associated with this * instance. * * @return An instance identifier for a VTN node. */ public final InstanceIdentifier<VtnNode> getVtnNodeIdentifier() { return getVtnNodeIdentifierBuilder().build(); }
/** * Return an instance identifier that specifies flow-capable-node for * the node corresponding to this instance. * * @return An instance identifier for the flow-capable-node. */ public final InstanceIdentifier<FlowCapableNode> getFlowNodeIdentifier() { return getNodeIdentifierBuilder(). augmentation(FlowCapableNode.class). build(); }
/** * Return an instance identifier that specifies MD-SAL node instance. * * @return An instance identifier for a MD-SAL node. */ public final InstanceIdentifier<Node> getNodeIdentifier() { return getNodeIdentifierBuilder().build(); }
public static boolean putServiceFunctionType(ServiceFunctionType sft) { boolean ret; printTraceStart(LOG); InstanceIdentifier<ServiceFunctionType> sftEntryIID = InstanceIdentifier.builder(ServiceFunctionTypes.class) .child(ServiceFunctionType.class, sft.getKey()) .build(); ret = SfcDataStoreAPI.writePutTransactionAPI(sftEntryIID, sft, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }
public static boolean putVariableMetadata(VariableMetadata md) { boolean ret; InstanceIdentifier<VariableMetadata> mdIID; printTraceStart(LOG); mdIID = InstanceIdentifier.builder(ServiceFunctionMetadata.class) .child(VariableMetadata.class, md.getKey()).build(); ret = SfcDataStoreAPI.writePutTransactionAPI(mdIID, md, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }
public static ContextMetadata readContextMetadata(String mdName) { printTraceStart(LOG); ContextMetadata md; InstanceIdentifier<ContextMetadata> mdIID; ContextMetadataKey mdKey = new ContextMetadataKey(mdName); mdIID = InstanceIdentifier.builder(ServiceFunctionMetadata.class) .child(ContextMetadata.class, mdKey).build(); md = SfcDataStoreAPI.readTransactionAPI(mdIID, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return md; }
public static boolean putContextMetadata(ContextMetadata md) { boolean ret; InstanceIdentifier<ContextMetadata> mdIID; printTraceStart(LOG); mdIID = InstanceIdentifier.builder(ServiceFunctionMetadata.class) .child(ContextMetadata.class, md.getKey()).build(); ret = SfcDataStoreAPI.writePutTransactionAPI(mdIID, md, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }
public static ServiceFunctionPaths readAllServiceFunctionPaths() { ServiceFunctionPaths sfps; printTraceStart(LOG); InstanceIdentifier<ServiceFunctionPaths> sfpsIID = InstanceIdentifier.builder(ServiceFunctionPaths.class).build(); sfps = SfcDataStoreAPI.readTransactionAPI(sfpsIID, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return sfps; }