public class SchemaSourceTransformer<S extends SchemaSourceRepresentation,D extends SchemaSourceRepresentation> extends Object implements SchemaSourceListener, SchemaSourceProvider<D>
Modifier and Type | Class and Description |
---|---|
static interface |
SchemaSourceTransformer.Transformation<S extends SchemaSourceRepresentation,D extends SchemaSourceRepresentation> |
Constructor and Description |
---|
SchemaSourceTransformer(SchemaRepository provider,
Class<S> srcClass,
SchemaSourceRegistry consumer,
Class<D> dstClass,
com.google.common.util.concurrent.AsyncFunction<S,D> function) |
Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.ListenableFuture<D> |
getSource(SourceIdentifier sourceIdentifier)
Returns a representation a for supplied YANG source identifier.
|
void |
schemaSourceEncountered(SchemaSourceRepresentation source)
Invoked when the registry sees a concrete source.
|
void |
schemaSourceRegistered(Iterable<PotentialSchemaSource<?>> sources)
Invoked when a new schema source is registered by a provider.
|
void |
schemaSourceUnregistered(PotentialSchemaSource<?> source)
Invoked when a schema source is unregistered.
|
public SchemaSourceTransformer(SchemaRepository provider, Class<S> srcClass, SchemaSourceRegistry consumer, Class<D> dstClass, com.google.common.util.concurrent.AsyncFunction<S,D> function)
public com.google.common.util.concurrent.ListenableFuture<D> getSource(SourceIdentifier sourceIdentifier)
SchemaSourceProvider
MissingSchemaSourceException
.
MissingSchemaSourceException
.
In either case the returned representation is required to report a non-null
revision in the SourceIdentifier
returned from
SchemaSourceRepresentation.getIdentifier()
.
Implementations are not required to provide constant behavior in time, notably this different invocation of this method may produce different results.
getSource
in interface SchemaSourceProvider<D extends SchemaSourceRepresentation>
sourceIdentifier
- source identifierpublic final void schemaSourceEncountered(SchemaSourceRepresentation source)
SchemaSourceListener
schemaSourceEncountered
in interface SchemaSourceListener
source
- Schema sourcepublic final void schemaSourceRegistered(Iterable<PotentialSchemaSource<?>> sources)
SchemaSourceListener
SchemaSourceListener.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.schemaSourceRegistered
in interface SchemaSourceListener
sources
- Newly available sourcespublic final void schemaSourceUnregistered(PotentialSchemaSource<?> source)
SchemaSourceListener
schemaSourceUnregistered
in interface SchemaSourceListener
source
- Schema source representationCopyright © 2019 OpenDaylight. All rights reserved.