X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-runtime-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fruntime%2Fapi%2FBindingRuntimeContext.java;h=15892d17036931a8755f4538e7770e21d10e86c1;hb=c3a2361f4c0de50dba3e64e066d30cfcb32776df;hp=99b98d1c3365b347f4c8f2dd83ccd04a3779716d;hpb=11db4e7ea702ac79a4320e42fccb6d0175ef524a;p=mdsal.git diff --git a/binding/mdsal-binding-runtime-api/src/main/java/org/opendaylight/mdsal/binding/runtime/api/BindingRuntimeContext.java b/binding/mdsal-binding-runtime-api/src/main/java/org/opendaylight/mdsal/binding/runtime/api/BindingRuntimeContext.java index 99b98d1c33..15892d1703 100644 --- a/binding/mdsal-binding-runtime-api/src/main/java/org/opendaylight/mdsal/binding/runtime/api/BindingRuntimeContext.java +++ b/binding/mdsal-binding-runtime-api/src/main/java/org/opendaylight/mdsal/binding/runtime/api/BindingRuntimeContext.java @@ -21,6 +21,7 @@ import org.opendaylight.yangtools.concepts.Immutable; import org.opendaylight.yangtools.yang.binding.Action; import org.opendaylight.yangtools.yang.binding.Augmentation; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; import org.opendaylight.yangtools.yang.model.api.ActionDefinition; import org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode; @@ -44,6 +45,7 @@ import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absol * by additional models. Same goes for all possible augmentations. */ @Beta +// FIXME: refactor return to follow foo()/getFoo()/findFoo() naming public interface BindingRuntimeContext extends EffectiveModelContextProvider, Immutable { @NonNull BindingRuntimeTypes getTypes(); @@ -72,10 +74,9 @@ public interface BindingRuntimeContext extends EffectiveModelContextProvider, Im * schema. * * @param augClass Augmentation class - * @return Schema of augmentation or null if augmentaiton is not known in this context - * @throws IllegalArgumentException If supplied class is not an augmentation + * @return Schema of augmentation or null if augmentation is not known in this context */ - @Nullable AugmentationSchemaNode getAugmentationDefinition(Class augClass); + > @Nullable AugmentationSchemaNode getAugmentationDefinition(Class augClass); /** * Returns defining {@link DataSchemaNode} for supplied class. @@ -92,8 +93,13 @@ public interface BindingRuntimeContext extends EffectiveModelContextProvider, Im */ @Nullable DataSchemaNode getSchemaDefinition(Class cls); + // FIXME: document this thing and perhaps move it to BindingRuntimeTypes? + @Nullable DataSchemaNode findChildSchemaDefinition(DataNodeContainer parentSchema, QNameModule parentNamespace, + Class childClass); + @Nullable ActionDefinition getActionDefinition(Class> cls); + @Deprecated(forRemoval = true) @Nullable Absolute getActionIdentifier(Class> cls); @NonNull Entry getResolvedAugmentationSchema( @@ -129,6 +135,14 @@ public interface BindingRuntimeContext extends EffectiveModelContextProvider, Im @NonNull Class getClassForSchema(SchemaNode childSchema); + /** + * Return the mapping of a particular {@link DataNodeContainer}'s available augmentations. This method deals with + * resolving {@code uses foo { augment bar { ... } } } scenarios by returning the augmentation created for + * {@code grouping foo}'s Binding representation. + * + * @param container {@link DataNodeContainer} to examine + * @return a mapping from local {@link AugmentationIdentifier}s to their corresponding Binding augmentations + */ @NonNull ImmutableMap getAvailableAugmentationTypes(DataNodeContainer container); @NonNull Class getIdentityClass(QName input);