Class DefaultDatabaseAccessService

java.lang.Object
de.hybris.platform.azure.dtu.impl.DefaultDatabaseAccessService
All Implemented Interfaces:
DatabaseAccessService

public class DefaultDatabaseAccessService extends Object implements DatabaseAccessService
Provides database functions to check for permissions and table access.
  • Constructor Details

    • DefaultDatabaseAccessService

      public DefaultDatabaseAccessService()
  • Method Details

    • checkIfTableExists

      public boolean checkIfTableExists(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String schemaName, String tableName) throws SQLException
      Checks for existence of desired table within the given database schema.
      Specified by:
      checkIfTableExists in interface DatabaseAccessService
      Parameters:
      jdbcTemplate - JdbcTemplate
      schemaName - The name of the schema
      tableName - The name of the view or table to search for
      Returns:
      True if the table or view exists.
      Throws:
      SQLException
    • checkPermission

      public boolean checkPermission(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String permission) throws SQLException
      Checks for a permission for the securable class: Database.
      Specified by:
      checkPermission in interface DatabaseAccessService
      Parameters:
      jdbcTemplate - JdbcTemplate
      permission - The requested permission e.g. VIEW DATABASE STATE
      Returns:
      TRUE if permission is granted and the user has the access to read this information from the database
      Throws:
      SQLException - on connection error
    • isAzureCompatible

      public boolean isAzureCompatible()
      Description copied from interface: DatabaseAccessService
      Check if the database is azure compatible.
      Specified by:
      isAzureCompatible in interface DatabaseAccessService
      Returns:
      TRUE for compatibility.