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 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

      void startTransaction(String transactionId) throws com.tridion.broker.StorageException
      Throws:
      com.tridion.broker.StorageException
    • commitTransaction

      void commitTransaction(String transactionId) throws com.tridion.broker.StorageException
      Throws:
      com.tridion.broker.StorageException
    • rollbackTransaction

      void rollbackTransaction(String transactionId) throws com.tridion.broker.StorageException
      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.