Class MetaDataAccessorImpl<M>
java.lang.Object
com.sap.cds.services.utils.lib.mtx.impl.MetaDataAccessorImpl<M>
- Type Parameters:
M- Type used for the Edmx model
- All Implemented Interfaces:
MetaDataAccessor<M>
Class that provides access to CDS and Edmx models and caches them
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interfacestatic classNested classes/interfaces inherited from interface com.sap.cds.services.utils.lib.mtx.MetaDataAccessor
MetaDataAccessor.I18n -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetaDataAccessorImpl(MetaDataAccessorImpl.MetaDataAccessorConfig config, com.github.benmanes.caffeine.cache.Ticker cacheTicker) MetaDataAccessorImpl(SidecarAccess sidecarAccess, CacheParams cacheParams, MetaDataAccessorImpl.EdmxModelCreator<M> strToEdmx, com.github.benmanes.caffeine.cache.Ticker cacheTicker) -
Method Summary
Modifier and TypeMethodDescriptionvoidevicts CDS and EDMX models for the specified tenantcom.sap.cds.reflect.CdsModelgetCdsModel(ModelId key, int maxAgeSeconds) voidTODO sync Rereads CDS and EDMX models for the specified tenant if they have changedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sap.cds.services.utils.lib.mtx.MetaDataAccessor
getCdsModel, refresh
-
Field Details
-
CACHE_NOT_CONFIGURED
- See Also:
-
-
Constructor Details
-
MetaDataAccessorImpl
public MetaDataAccessorImpl(MetaDataAccessorImpl.MetaDataAccessorConfig config, com.github.benmanes.caffeine.cache.Ticker cacheTicker) - Parameters:
config- MetaDataAccessor configurationscacheTicker- Optional ticker used by guava cache for testing purposes, use null for productive use
-
MetaDataAccessorImpl
public MetaDataAccessorImpl(SidecarAccess sidecarAccess, CacheParams cacheParams, MetaDataAccessorImpl.EdmxModelCreator<M> strToEdmx, com.github.benmanes.caffeine.cache.Ticker cacheTicker) - Parameters:
sidecarAccess- Object of typeSidecarAccessthat provides access to the node.js application sidecar/mtx via a rest APIcacheParams- Parameters that control size and lifecycle of cache for cds and edmx modelsstrToEdmx- Function that converts an edmx model description given as string into an edmx modelcacheTicker- Optional ticker used by guava cache for testing purposes, use null for productive use
-
-
Method Details
-
getCdsModel
- Specified by:
getCdsModelin interfaceMetaDataAccessor<M>- Parameters:
key- model identifiermaxAgeSeconds- maximum acceptable age of resource- Returns:
- CDS model
-
getEdmx
- Specified by:
getEdmxin interfaceMetaDataAccessor<M>- Parameters:
key- model identifiermaxAgeSeconds- maximum acceptable age of resource- Returns:
- EDMX model
- Throws:
com.sap.cds.CdsException
-
getI18n
- Specified by:
getI18nin interfaceMetaDataAccessor<M>- Parameters:
modelId- model identifiermaxAgeSeconds- maximum acceptable age of resource- Returns:
- model related i18n resources
-
evict
Description copied from interface:MetaDataAccessorevicts CDS and EDMX models for the specified tenant- Specified by:
evictin interfaceMetaDataAccessor<M>- Parameters:
tenantId- tenant identifier
-
refresh
Description copied from interface:MetaDataAccessorTODO sync Rereads CDS and EDMX models for the specified tenant if they have changed- Specified by:
refreshin interfaceMetaDataAccessor<M>- Parameters:
tenantId- tenant identifiermaxAgeSeconds- maximum acceptable age of resource
-