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 Summary
FieldsModifier and TypeFieldDescriptionprotected final org.springframework.jdbc.core.JdbcTemplate -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAzureDatabaseService(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String schemaName, String viewName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected booleanassertValidConnection(Connection connection) Assert that the connection is valid.protected abstract StringgetQuery()Returns the reason if the service is not active.booleanisActive()Checks if the utilization can be determined at all.protected PreparedStatementprepareStatement(Connection connection) query(org.springframework.jdbc.core.PreparedStatementSetter pss, org.springframework.jdbc.core.ResultSetExtractor<T> rse) voidsetBeanName(String beanName) voidsetDatabaseAccessService(DatabaseAccessService databaseAccessService) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.azure.dtu.DatabaseUtilizationService
getUtilization
-
Field Details
-
jdbcTemplate
protected final org.springframework.jdbc.core.JdbcTemplate jdbcTemplate
-
-
Constructor Details
-
Method Details
-
isActive
public boolean isActive()Description copied from interface:DatabaseUtilizationServiceChecks if the utilization can be determined at all.- Specified by:
isActivein interfaceDatabaseUtilizationService- Returns:
- True for readiness
-
getStatusReason
Description copied from interface:DatabaseUtilizationServiceReturns the reason if the service is not active.- Specified by:
getStatusReasonin interfaceDatabaseUtilizationService- Returns:
- The reason or null
-
getQuery
-
query
-
prepareStatement
- Throws:
SQLException
-
assertValidConnection
Assert that the connection is valid.- Parameters:
connection- The connection- Returns:
- True for valid connection
- Throws:
SQLException- On error requesting the connection
-
setDatabaseAccessService
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-