Class GuavaSchemaSourceCache<T extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>
java.lang.Object
org.opendaylight.yangtools.yang.model.repo.spi.AbstractSchemaSourceCache<T>
org.opendaylight.yangtools.yang.model.repo.spi.GuavaSchemaSourceCache<T>
- Type Parameters:
T-SchemaSourceRepresentationtype stored in this cache
- All Implemented Interfaces:
AutoCloseable,EventListener,SchemaSourceListener,SchemaSourceProvider<T>
@Beta
@Deprecated(since="7.0.13",
forRemoval=true)
public final class GuavaSchemaSourceCache<T extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>
extends AbstractSchemaSourceCache<T>
implements AutoCloseable
Deprecated, for removal: This API element is subject to removal in a future version.
A simple
AbstractSchemaSourceCache based on Guava Cache.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated, for removal: This API element is subject to removal in a future version.static <R extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>
@NonNull GuavaSchemaSourceCache<R>createSoftCache(SchemaSourceRegistry consumer, Class<R> representation) Deprecated, for removal: This API element is subject to removal in a future version.static <R extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>
@NonNull GuavaSchemaSourceCache<R>createSoftCache(SchemaSourceRegistry consumer, Class<R> representation, long lifetime, TimeUnit units) Deprecated, for removal: This API element is subject to removal in a future version.static <R extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>
@NonNull GuavaSchemaSourceCache<R>createSoftCache(SchemaSourceRegistry consumer, Class<R> representation, Duration duration) Deprecated, for removal: This API element is subject to removal in a future version.com.google.common.util.concurrent.FluentFuture<? extends T>getSource(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier sourceIdentifier) Deprecated, for removal: This API element is subject to removal in a future version.Returns a representation a for supplied YANG source identifier.protected voidDeprecated, for removal: This API element is subject to removal in a future version.Offer a schema source in requested representation for caching.Methods inherited from class org.opendaylight.yangtools.yang.model.repo.spi.AbstractSchemaSourceCache
register, schemaSourceEncountered, schemaSourceRegistered, schemaSourceUnregistered
-
Method Details
-
createSoftCache
public static <R extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation> @NonNull GuavaSchemaSourceCache<R> createSoftCache(SchemaSourceRegistry consumer, Class<R> representation) Deprecated, for removal: This API element is subject to removal in a future version. -
createSoftCache
public static <R extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation> @NonNull GuavaSchemaSourceCache<R> createSoftCache(SchemaSourceRegistry consumer, Class<R> representation, long lifetime, TimeUnit units) Deprecated, for removal: This API element is subject to removal in a future version. -
createSoftCache
public static <R extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation> @NonNull GuavaSchemaSourceCache<R> createSoftCache(SchemaSourceRegistry consumer, Class<R> representation, Duration duration) Deprecated, for removal: This API element is subject to removal in a future version. -
getSource
public com.google.common.util.concurrent.FluentFuture<? extends T> getSource(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier sourceIdentifier) Deprecated, for removal: This API element is subject to removal in a future version.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<T 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
-
offer
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractSchemaSourceCacheOffer a schema source in requested representation for caching. Subclasses need to implement this method to store the schema source. Once they have determined to cache the source, they should callAbstractSchemaSourceCache.register(SourceIdentifier).- Specified by:
offerin classAbstractSchemaSourceCache<T extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>- Parameters:
source- schema source
-
close
public void close()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
closein interfaceAutoCloseable
-
SoftSchemaSourceCacheinstead.