M - Type used for the Edmx modelpublic class MetaDataAccessorImpl<M> extends Object implements MetaDataAccessor<M>
| Modifier and Type | Class and Description |
|---|---|
static interface |
MetaDataAccessorImpl.EdmxModelCreator<M> |
| Constructor and Description |
|---|
MetaDataAccessorImpl(SidecarAccess sidecarAccess,
CacheParams cacheParams,
MetaDataAccessorImpl.EdmxModelCreator<M> strToEdmx,
com.google.common.base.Ticker cacheTicker) |
MetaDataAccessorImpl(SidecarAccess sidecarAccess,
CacheParams cacheParams,
com.google.common.base.Ticker cacheTicker,
BiFunction<String,String,M> strToEdmxFunction) |
| Modifier and Type | Method and Description |
|---|---|
void |
cacheActions(String tenantId,
Consumer<String> cdsAction,
Consumer<com.sap.cds.mtx.impl.MetaDataAccessorImpl.EdmxCacheKey> edmxAction) |
void |
evict(String tenantId) |
CdsModel |
getCdsModel(String tenantId)
Returns a Cds model
|
M |
getEdmx(String tenantId,
String serviceName,
String language)
Returns an edmx model
|
void |
refresh(String tenantId) |
public MetaDataAccessorImpl(SidecarAccess sidecarAccess, CacheParams cacheParams, MetaDataAccessorImpl.EdmxModelCreator<M> strToEdmx, com.google.common.base.Ticker cacheTicker)
sidecarAccess - Object of type SidecarAccessthat 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 usepublic MetaDataAccessorImpl(SidecarAccess sidecarAccess, CacheParams cacheParams, com.google.common.base.Ticker cacheTicker, BiFunction<String,String,M> strToEdmxFunction)
sidecarAccess - Object of type SidecarAccessthat 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 modelsstrToEdmxFunction - BiFunction that converts an edmx model description given
as string into an edmx model.Parameters are edmx model as string
and service namecacheTicker - Optional ticker used by guava cache for testing
purposes, use null for productive usepublic M getEdmx(String tenantId, String serviceName, String language) throws CdsException
getEdmx in interface MetaDataAccessor<M>tenantId - tenant identifier, must not be nullserviceName - service name, can be nulllanguage - language, can be nullCdsExceptionpublic CdsModel getCdsModel(String tenantId) throws CdsException
getCdsModel in interface MetaDataAccessor<M>tenantId - tenant id, mustn't be nullCdsModel for the specified tenantCdsExceptionpublic void refresh(String tenantId)
refresh in interface MetaDataAccessor<M>public void evict(String tenantId)
evict in interface MetaDataAccessor<M>public void cacheActions(String tenantId, Consumer<String> cdsAction, Consumer<com.sap.cds.mtx.impl.MetaDataAccessorImpl.EdmxCacheKey> edmxAction)
Copyright © 2020 SAP. All rights reserved.