Interface SchemaSourceProvider<T extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>

  • Type Parameters:
    T - Schema source representation type provided by this implementation
    All Known Implementing Classes:
    AbstractSchemaSourceCache, GuavaSchemaSourceCache, SchemaSourceTransformer

    @Beta
    public interface SchemaSourceProvider<T extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>
    Schema source provider implementations take care of resolving a SourceIdentifier into a particular representation of the schema source. Examples of resolution include fetching the source from an external source, opening a classpath resource, or similar.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @NonNull com.google.common.util.concurrent.ListenableFuture<? extends T> getSource​(@NonNull org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier sourceIdentifier)
      Returns a representation a for supplied YANG source identifier.
    • Method Detail

      • getSource

        @NonNull com.google.common.util.concurrent.ListenableFuture<? extends T> getSource​(@NonNull org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier sourceIdentifier)
        Returns 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 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.

        Parameters:
        sourceIdentifier - source identifier
        Returns:
        future source representation, if supplied YANG module is available
        Throws:
        NullPointerException - if sourceIdentifier is null