Package com.tridion.storage
Interface DAOFactory
- All Superinterfaces:
com.tridion.configuration.Configurable
- All Known Subinterfaces:
TimeoutAwareDAOFactory
public interface DAOFactory
extends com.tridion.configuration.Configurable
The DAOFactory interface that specifies which DAO's can be accessed.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcommitTransaction(String transactionId) voidconfigureBundle(com.tridion.configuration.Configuration storageDAOBundleConfiguration) Configure this DAOFactory with the provided StorageDAOBundle.<T extends BaseDAO>
TgetDAOForTypeMapping(int namespaceId, String typeMapping) Get the specified DAO for the given type.<T extends BaseDAO>
TgetDAOForTypeMapping(String typeMapping) Get the specified DAO for the given type.getDAOForTypeMappingInTransaction(int namespaceId, String typeMapping, String transactionId) Get the specified DAO for the given type and transaction.getDAOForTypeMappingInTransaction(String typeMapping, String transactionId) Get the specified DAO within the scope of a transaction.This returns the storageId of the given DAOFactory.voidrollbackTransaction(String transactionId) voidThis is shuts down all the resources hold up by the DAOFactory, for a nice clean shutdown.voidstartTransaction(String transactionId) Methods inherited from interface com.tridion.configuration.Configurable
configure
-
Method Details
-
getStorageId
String getStorageId()This returns the storageId of the given DAOFactory.- Returns:
- The storageId of the DAO factory
-
getDAOForTypeMapping
<T extends BaseDAO> T getDAOForTypeMapping(String typeMapping) throws com.tridion.broker.StorageException Get the specified DAO for the given type.- Parameters:
typeMapping- The type that maps a certain DAO.- Returns:
- the DAO associate with that type.
- Throws:
com.tridion.broker.StorageException- If there is no DAO available for this type mapping.
-
getDAOForTypeMapping
<T extends BaseDAO> T getDAOForTypeMapping(int namespaceId, String typeMapping) throws com.tridion.broker.StorageException, UnsupportedOperationException Get the specified DAO for the given type. Supported only for JPA DAOs.- Parameters:
namespaceId- id of namespace from database.typeMapping- the type that maps a certain DAO.- Returns:
- the DAO associate with that type.
- Throws:
com.tridion.broker.StorageException- if there is no DAO available for this type mapping.UnsupportedOperationException- if used to create FS DAO.
-
getDAOForTypeMappingInTransaction
BaseDAO getDAOForTypeMappingInTransaction(String typeMapping, String transactionId) throws com.tridion.broker.StorageException Get the specified DAO within the scope of a transaction.- Parameters:
typeMapping- the type that maps a certain DAO.transactionId- id of the transaction- Returns:
- Throws:
com.tridion.broker.StorageException
-
getDAOForTypeMappingInTransaction
BaseDAO getDAOForTypeMappingInTransaction(int namespaceId, String typeMapping, String transactionId) throws com.tridion.broker.StorageException, UnsupportedOperationException Get the specified DAO for the given type and transaction. Supported only for JPA DAOs.- Parameters:
namespaceId- id of namespace from database.typeMapping- the type that maps a certain DAO.transactionId- id of transaction- Returns:
- the DAO associate with that type and transaction.
- Throws:
com.tridion.broker.StorageException- if there is no DAO available for this type mapping.UnsupportedOperationException- if used to create FS DAO.
-
startTransaction
- Throws:
com.tridion.broker.StorageException
-
commitTransaction
- Throws:
com.tridion.broker.StorageException
-
rollbackTransaction
- Throws:
com.tridion.broker.StorageException
-
configureBundle
void configureBundle(com.tridion.configuration.Configuration storageDAOBundleConfiguration) throws com.tridion.configuration.ConfigurationException Configure this DAOFactory with the provided StorageDAOBundle.- Parameters:
storageDAOBundleConfiguration- The StorageDAOBundle configuration to use.- Throws:
com.tridion.configuration.ConfigurationException- On a badly configured StorageDAOBundle.
-
shutdownFactory
void shutdownFactory()This is shuts down all the resources hold up by the DAOFactory, for a nice clean shutdown.
-