Class MetaDataAccessorSingleModelImpl<M>
java.lang.Object
com.sap.cds.services.utils.lib.mtx.impl.MetaDataAccessorSingleModelImpl<M>
- All Implemented Interfaces:
MetaDataAccessor<M>
Class that provides access to CDS and Edmx models read from java resource folders
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.sap.cds.services.utils.lib.mtx.MetaDataAccessor
MetaDataAccessor.I18n -
Constructor Summary
ConstructorsConstructorDescriptionMetaDataAccessorSingleModelImpl(String cdsModelPath, String edmxFolder, MetaDataAccessorImpl.EdmxModelCreator<M> edmxstrAndServiceToEdmxModel) -
Method Summary
Modifier and TypeMethodDescriptionvoidevicts CDS and EDMX models for the specified tenantcom.sap.cds.reflect.CdsModelgetCdsModel(ModelId modelId, 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
-
Constructor Details
-
MetaDataAccessorSingleModelImpl
public MetaDataAccessorSingleModelImpl(String cdsModelPath, String edmxFolder, MetaDataAccessorImpl.EdmxModelCreator<M> edmxstrAndServiceToEdmxModel) throws IOException - Parameters:
cdsModelPath- Path to the csn-file,including file nameedmxFolder- Path of edmx folder, null and empty are allowededmxstrAndServiceToEdmxModel- Function that converts edmx model read as string into generic type M- Throws:
IOException
-
-
Method Details
-
getEdmx
- Specified by:
getEdmxin interfaceMetaDataAccessor<M>- Parameters:
id- 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
-
getCdsModel
public com.sap.cds.reflect.CdsModel getCdsModel(ModelId modelId, int maxAgeSeconds) throws com.sap.cds.CdsException - Specified by:
getCdsModelin interfaceMetaDataAccessor<M>- Parameters:
modelId- model identifiermaxAgeSeconds- maximum acceptable age of resource- Returns:
- CDS model
- Throws:
com.sap.cds.CdsException
-
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
-
evict
Description copied from interface:MetaDataAccessorevicts CDS and EDMX models for the specified tenant- Specified by:
evictin interfaceMetaDataAccessor<M>- Parameters:
tenantId- tenant identifier
-