Class SchemaSourceTransformer<S extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation,D extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>
java.lang.Object
org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceTransformer<S,D>
- All Implemented Interfaces:
EventListener,SchemaSourceListener,SchemaSourceProvider<D>
public class SchemaSourceTransformer<S extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation,D extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>
extends Object
implements SchemaSourceListener, SchemaSourceProvider<D>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSchemaSourceTransformer.Transformation<S extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation,D extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation> -
Constructor Summary
ConstructorsConstructorDescriptionSchemaSourceTransformer(org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository provider, Class<S> srcClass, SchemaSourceRegistry consumer, Class<D> dstClass, com.google.common.util.concurrent.AsyncFunction<S, D> function) -
Method Summary
Modifier and TypeMethodDescriptionfinal com.google.common.util.concurrent.ListenableFuture<D>getSource(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier sourceIdentifier) Returns a representation a for supplied YANG source identifier.final voidschemaSourceEncountered(org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation source) Invoked when the registry sees a concrete source.final voidschemaSourceRegistered(Iterable<PotentialSchemaSource<?>> sources) Invoked when a new schema source is registered by a provider.final voidschemaSourceUnregistered(PotentialSchemaSource<?> source) Invoked when a schema source is unregistered.
-
Constructor Details
-
SchemaSourceTransformer
-
-
Method Details
-
getSource
public final com.google.common.util.concurrent.ListenableFuture<D> getSource(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier sourceIdentifier) Description copied from interface:SchemaSourceProviderReturns a representation a for supplied YANG source identifier. The resolution criteria are as follows:- If the source identifier specifies a revision, this method returns either
a representation of that particular revision or throw
MissingSchemaSourceException. - If the source identifier does not specify a revision, this method returns
the newest available revision, or throws
MissingSchemaSourceException.
In either case the returned representation is required to report a non-null revision in the
SourceIdentifierreturned fromSchemaSourceRepresentation.getIdentifier().Implementations are not required to provide constant behavior in time, notably this different invocation of this method may produce different results.
- Specified by:
getSourcein interfaceSchemaSourceProvider<S extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>- Parameters:
sourceIdentifier- source identifier- Returns:
- future source representation, if supplied YANG module is available
- If the source identifier specifies a revision, this method returns either
a representation of that particular revision or throw
-
schemaSourceEncountered
public final void schemaSourceEncountered(org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation source) Description copied from interface:SchemaSourceListenerInvoked when the registry sees a concrete source. This callback is typically used by cache-type listeners, who intercept the source, store it locally and announce themselves as a provider of that particular schema source.- Specified by:
schemaSourceEncounteredin interfaceSchemaSourceListener- Parameters:
source- Schema source
-
schemaSourceRegistered
Description copied from interface:SchemaSourceListenerInvoked when a new schema source is registered by a provider. This call callback, along withSchemaSourceListener.schemaSourceUnregistered(PotentialSchemaSource)is typically used by transformer-type listeners, who intercept the registration if the advertised representation matches their input type and register themselves as a potential provider of the same source in their output representation type.- Specified by:
schemaSourceRegisteredin interfaceSchemaSourceListener- Parameters:
sources- Newly available sources
-
schemaSourceUnregistered
Description copied from interface:SchemaSourceListenerInvoked when a schema source is unregistered.- Specified by:
schemaSourceUnregisteredin interfaceSchemaSourceListener- Parameters:
source- Schema source representation
-