public interface ModelActionBuilder
Since YANG allows forward references, some inference actions need to be taken at a later point, where reference is
actually resolved. Referenced objects are not retrieved directly but are represented as ModelActionBuilder.Prerequisite
(prerequisite) for inference action to be taken.
Some existing YANG statements are more complex and also object, for which effective model may be inferred is also
represented as a ModelActionBuilder.Prerequisite which, when reference is available, will contain target context, which may be
used for inference action.
In order to declare inference action following steps needs to be taken:
StmtContext.Mutable.newInferenceAction(ModelProcessingPhase) to obtain
ModelActionBuilder.
apply(InferenceAction) with ModelActionBuilder.InferenceAction implementation
to register inference action.
An action will be executed when:
InferenceAction#apply(InferenceContext) - all prerequisites (and declared forward references) are met,
action could dereference them and start applying changes.
ModelActionBuilder.InferenceAction.prerequisiteFailed(Collection) - semantic parser finished all other satisfied
inference actions and some of declared prerequisites was still not met.
TODO: Insert real word example
Future seems as viable and more standard alternative to ModelActionBuilder.Prerequisite, but
Futures also carries promise that resolution of it is carried in other thread, which will actually put additional
constraints on semantic parser.
Also listening on multiple futures is costly, so we opted out of future and designed API, which later may introduce futures.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ModelActionBuilder.InferenceAction
User-defined inference action.
|
static interface |
ModelActionBuilder.InferenceContext |
static interface |
ModelActionBuilder.Prerequisite<T> |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(ModelActionBuilder.InferenceAction action) |
<C extends StmtContext.Mutable<?,?,?>,CT extends C> |
mutatesCtx(CT root,
ModelProcessingPhase phase) |
<K,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?,?>,N extends org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace<K,? extends StmtContext<?,?,?>>> |
mutatesEffectiveCtx(StmtContext<?,?,?> context,
Class<N> namespace,
K key) |
default <T extends StmtContext.Mutable<?,?,?>> |
mutatesEffectiveCtx(T stmt) |
<N extends org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace<?,?>> |
mutatesNs(StmtContext.Mutable<?,?,?> ctx,
Class<N> namespace)
Deprecated.
Undocumented method. Use at your own risk.
|
<K,N extends StatementNamespace<K,?,?>> |
requiresCtx(StmtContext<?,?,?> context,
Class<N> namespace,
K key,
ModelProcessingPhase phase) |
<K,N extends StatementNamespace<K,?,?>> |
requiresCtx(StmtContext<?,?,?> context,
Class<N> namespace,
NamespaceKeyCriterion<K> criterion,
ModelProcessingPhase phase) |
<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>> |
requiresCtx(StmtContext<A,D,E> context,
ModelProcessingPhase phase)
Action requires that the specified context completes specified phase.
|
<K,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<?>,N extends StatementNamespace<K,? extends D,?>> |
requiresDeclared(StmtContext<?,?,?> context,
Class<N> namespace,
K key)
Deprecated.
Undocumented method. Use at your own risk.
|
<D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<?>> |
requiresDeclared(StmtContext<?,? extends D,?> context)
Action requires that the specified context transition to complete
ModelProcessingPhase.FULL_DECLARATION
phase and produce a declared statement. |
<K,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<?>,N extends StatementNamespace<K,? extends D,?>> |
requiresDeclaredCtx(StmtContext<?,?,?> context,
Class<N> namespace,
K key)
Deprecated.
Undocumented method. Use at your own risk.
|
<K,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?,?>,N extends StatementNamespace<K,?,? extends E>> |
requiresEffective(StmtContext<?,?,?> context,
Class<N> namespace,
K key)
Deprecated.
Undocumented method. Use at your own risk.
|
<E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?,?>> |
requiresEffective(StmtContext<?,?,? extends E> stmt)
Deprecated.
Undocumented method. Use at your own risk.
|
<K,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?,?>,N extends StatementNamespace<K,?,? extends E>> |
requiresEffectiveCtx(StmtContext<?,?,?> context,
Class<N> namespace,
K key)
Deprecated.
Undocumented method. Use at your own risk.
|
@Nonnull <D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<?>> ModelActionBuilder.Prerequisite<D> requiresDeclared(StmtContext<?,? extends D,?> context)
ModelProcessingPhase.FULL_DECLARATION
phase and produce a declared statement.context - Statement context which needs to complete the transition.ModelActionBuilder.Prerequisite returning the declared statement of the requested context.@Deprecated @Nonnull <K,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<?>,N extends StatementNamespace<K,? extends D,?>> ModelActionBuilder.Prerequisite<D> requiresDeclared(StmtContext<?,?,?> context, Class<N> namespace, K key)
@Nonnull <A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>> ModelActionBuilder.Prerequisite<StmtContext<A,D,E>> requiresCtx(StmtContext<A,D,E> context, ModelProcessingPhase phase)
context - Statement context which needs to complete the transition.phase - ModelProcessingPhase which must have completedModelActionBuilder.Prerequisite returning the requested context.@Nonnull <K,N extends StatementNamespace<K,?,?>> ModelActionBuilder.Prerequisite<StmtContext<?,?,?>> requiresCtx(StmtContext<?,?,?> context, Class<N> namespace, K key, ModelProcessingPhase phase)
@Nonnull <K,N extends StatementNamespace<K,?,?>> ModelActionBuilder.Prerequisite<StmtContext<?,?,?>> requiresCtx(StmtContext<?,?,?> context, Class<N> namespace, NamespaceKeyCriterion<K> criterion, ModelProcessingPhase phase)
@Nonnull default <T extends StmtContext.Mutable<?,?,?>> ModelActionBuilder.Prerequisite<T> mutatesEffectiveCtx(T stmt)
@Nonnull <K,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?,?>,N extends org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace<K,? extends StmtContext<?,?,?>>> ModelActionBuilder.Prerequisite<StmtContext.Mutable<?,?,E>> mutatesEffectiveCtx(StmtContext<?,?,?> context, Class<N> namespace, K key)
@Nonnull <C extends StmtContext.Mutable<?,?,?>,CT extends C> ModelActionBuilder.Prerequisite<C> mutatesCtx(CT root, ModelProcessingPhase phase)
void apply(ModelActionBuilder.InferenceAction action) throws InferenceException
InferenceException@Deprecated @Nonnull <K,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<?>,N extends StatementNamespace<K,? extends D,?>> ModelActionBuilder.Prerequisite<StmtContext<?,D,?>> requiresDeclaredCtx(StmtContext<?,?,?> context, Class<N> namespace, K key)
@Deprecated @Nonnull <E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?,?>> ModelActionBuilder.Prerequisite<E> requiresEffective(StmtContext<?,?,? extends E> stmt)
@Deprecated @Nonnull <K,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?,?>,N extends StatementNamespace<K,?,? extends E>> ModelActionBuilder.Prerequisite<E> requiresEffective(StmtContext<?,?,?> context, Class<N> namespace, K key)
@Deprecated @Nonnull <K,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?,?>,N extends StatementNamespace<K,?,? extends E>> ModelActionBuilder.Prerequisite<StmtContext<?,?,E>> requiresEffectiveCtx(StmtContext<?,?,?> context, Class<N> namespace, K key)
@Deprecated @Nonnull <N extends org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace<?,?>> ModelActionBuilder.Prerequisite<StmtContext.Mutable<?,?,?>> mutatesNs(StmtContext.Mutable<?,?,?> ctx, Class<N> namespace)
Copyright © 2018 OpenDaylight. All rights reserved.