Class DefaultDatabaseAccessService
java.lang.Object
de.hybris.platform.azure.dtu.impl.DefaultDatabaseAccessService
- All Implemented Interfaces:
DatabaseAccessService
Provides database functions to check for permissions and table access.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckIfTableExists(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String schemaName, String tableName) Checks for existence of desired table within the given database schema.booleancheckPermission(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String permission) Checks for a permission for the securable class: Database.booleanCheck if the database is azure compatible.
-
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:
checkIfTableExistsin interfaceDatabaseAccessService- Parameters:
jdbcTemplate-JdbcTemplateschemaName- The name of the schematableName- 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:
checkPermissionin interfaceDatabaseAccessService- Parameters:
jdbcTemplate-JdbcTemplatepermission- 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:DatabaseAccessServiceCheck if the database is azure compatible.- Specified by:
isAzureCompatiblein interfaceDatabaseAccessService- Returns:
- TRUE for compatibility.
-