Class AbstractAzureDatabaseService<T>

java.lang.Object
de.hybris.platform.azure.dtu.impl.AbstractAzureDatabaseService<T>
Type Parameters:
T - The desired type to read
All Implemented Interfaces:
DatabaseUtilizationService, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
AzureDatabaseUtilizationService

public abstract class AbstractAzureDatabaseService<T> extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware, DatabaseUtilizationService
Provides base functionality to access the azure data base.
  • Field Details

    • jdbcTemplate

      protected final org.springframework.jdbc.core.JdbcTemplate jdbcTemplate
  • Constructor Details

    • AbstractAzureDatabaseService

      protected AbstractAzureDatabaseService(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String schemaName, String viewName)
      Constructor.
      Parameters:
      jdbcTemplate - JdbcTemplate
      schemaName - The schema name of the table
      viewName - The table name
  • Method Details

    • isActive

      public boolean isActive()
      Description copied from interface: DatabaseUtilizationService
      Checks if the utilization can be determined at all.
      Specified by:
      isActive in interface DatabaseUtilizationService
      Returns:
      True for readiness
    • getStatusReason

      public String getStatusReason()
      Description copied from interface: DatabaseUtilizationService
      Returns the reason if the service is not active.
      Specified by:
      getStatusReason in interface DatabaseUtilizationService
      Returns:
      The reason or null
    • getQuery

      protected abstract String getQuery()
    • query

      protected Optional<T> query(org.springframework.jdbc.core.PreparedStatementSetter pss, org.springframework.jdbc.core.ResultSetExtractor<T> rse)
    • prepareStatement

      protected PreparedStatement prepareStatement(Connection connection) throws SQLException
      Throws:
      SQLException
    • assertValidConnection

      protected boolean assertValidConnection(Connection connection) throws SQLException
      Assert that the connection is valid.
      Parameters:
      connection - The connection
      Returns:
      True for valid connection
      Throws:
      SQLException - On error requesting the connection
    • setDatabaseAccessService

      public void setDatabaseAccessService(DatabaseAccessService databaseAccessService)
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • setBeanName

      public void setBeanName(String beanName)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware