Package com.evolveum.midpoint.repo.sqale
Class SqaleRepositoryConfiguration
- java.lang.Object
 - 
- com.evolveum.midpoint.repo.sqale.SqaleRepositoryConfiguration
 
 
- 
- All Implemented Interfaces:
 JdbcRepositoryConfiguration
public class SqaleRepositoryConfiguration extends Object implements JdbcRepositoryConfiguration
Common part of the SQL-based repository configuration. Contains JDBC/datasource setup, connection pool configuration, but no framework/ORM stuff. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringAPPLICATION_NAME_JDBC_PARAM- 
Fields inherited from interface com.evolveum.midpoint.repo.sqlbase.JdbcRepositoryConfiguration
PROPERTY_CREATE_MISSING_CUSTOM_COLUMNS, PROPERTY_DATABASE, PROPERTY_DATASOURCE, PROPERTY_DRIVER_CLASS_NAME, PROPERTY_FULL_OBJECT_FORMAT, PROPERTY_IDLE_TIMEOUT, PROPERTY_INITIALIZATION_FAIL_TIMEOUT, PROPERTY_ITERATIVE_SEARCH_BY_PAGING_BATCH_SIZE, PROPERTY_JDBC_PASSWORD, PROPERTY_JDBC_PASSWORD_FILE, PROPERTY_JDBC_URL, PROPERTY_JDBC_USERNAME, PROPERTY_KEEPALIVE_TIME, PROPERTY_LEAK_DETECTION_THRESHOLD, PROPERTY_MAX_LIFETIME, PROPERTY_MAX_POOL_SIZE, PROPERTY_MIN_POOL_SIZE, PROPERTY_PERFORMANCE_STATISTICS_FILE, PROPERTY_PERFORMANCE_STATISTICS_LEVEL, PROPERTY_USE_ZIP, PROPERTY_USE_ZIP_AUDIT 
 - 
 
- 
Constructor Summary
Constructors Constructor Description SqaleRepositoryConfiguration(@NotNull org.apache.commons.configuration2.Configuration configuration) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull SupportedDatabasegetDatabaseType()StringgetDataSource()StringgetDefaultEmbeddedJdbcUrlPrefix()StringgetDriverClassName()StringgetFullObjectFormat()Returns serialization format (language) for writing fullObject.LonggetIdleTimeout()longgetInitializationFailTimeout()intgetIterativeSearchByPagingBatchSize()StringgetJdbcPassword()StringgetJdbcUrl()StringgetJdbcUrl(@NotNull String applicationName)Allows distinguishing connections for various usages like repository, audit, scheduler.StringgetJdbcUsername()LonggetKeepaliveTime()LonggetLeakDetectionThreshold()LonggetMaxLifetime()intgetMaxPoolSize()intgetMinPoolSize()StringgetPerformanceStatisticsFile()intgetPerformanceStatisticsLevel()longgetSqlDurationWarningMs()Returns threshold duration for SQL, after which it should be logged on warning level.TransactionIsolationgetTransactionIsolation()voidinit()static SqaleRepositoryConfigurationinitForAudit(@NotNull SqaleRepositoryConfiguration mainRepoConfig, org.apache.commons.configuration2.Configuration auditConfig)Creates a copy of provided configuration for audit and applies override from config.xml.booleanisCreateMissingCustomColumns()booleanisEmbedded()booleanisUseZip()We leave potential compression to PG, for us the values are plain.booleanisUseZipAudit()We leave potential compression to PG, for us the values are plain.booleanisUsing(SupportedDatabase db)protected voidnotEmpty(String value, String message)voidsetIterativeSearchByPagingBatchSize(int iterativeSearchByPagingBatchSize)booleanuseSetReadOnlyOnConnection()If true, thenConnection.setReadOnly(boolean)is used for read only transactions andJdbcRepositoryConfiguration.getReadOnlyTransactionStatement()is ignored.- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface com.evolveum.midpoint.repo.sqlbase.JdbcRepositoryConfiguration
getReadOnlyTransactionStatement, isUsingH2, isUsingOracle, isUsingPostgreSQL, isUsingSQLServer 
 - 
 
 - 
 
- 
- 
Field Detail
- 
APPLICATION_NAME_JDBC_PARAM
public static final String APPLICATION_NAME_JDBC_PARAM
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
init
@PostConstruct public void init() throws RepositoryServiceFactoryException 
- 
getDatabaseType
@NotNull public @NotNull SupportedDatabase getDatabaseType()
- Specified by:
 getDatabaseTypein interfaceJdbcRepositoryConfiguration
 
- 
getDataSource
public String getDataSource()
- Specified by:
 getDataSourcein interfaceJdbcRepositoryConfiguration
 
- 
notEmpty
protected void notEmpty(String value, String message) throws RepositoryServiceFactoryException
 
- 
getDriverClassName
public String getDriverClassName()
- Specified by:
 getDriverClassNamein interfaceJdbcRepositoryConfiguration
 
- 
getJdbcUrl
public String getJdbcUrl()
- Specified by:
 getJdbcUrlin interfaceJdbcRepositoryConfiguration
 
- 
getJdbcUrl
public String getJdbcUrl(@NotNull @NotNull String applicationName)
Description copied from interface:JdbcRepositoryConfigurationAllows distinguishing connections for various usages like repository, audit, scheduler. By default, this doesn't do anything, but works for new repository.- Specified by:
 getJdbcUrlin interfaceJdbcRepositoryConfiguration
 
- 
getJdbcUsername
public String getJdbcUsername()
- Specified by:
 getJdbcUsernamein interfaceJdbcRepositoryConfiguration
 
- 
getJdbcPassword
public String getJdbcPassword()
- Specified by:
 getJdbcPasswordin interfaceJdbcRepositoryConfiguration
 
- 
isUseZip
public boolean isUseZip()
We leave potential compression to PG, for us the values are plain.- Specified by:
 isUseZipin interfaceJdbcRepositoryConfiguration
 
- 
isUseZipAudit
public boolean isUseZipAudit()
We leave potential compression to PG, for us the values are plain.- Specified by:
 isUseZipAuditin interfaceJdbcRepositoryConfiguration
 
- 
getFullObjectFormat
public String getFullObjectFormat()
Returns serialization format (language) for writing fullObject. Also seeJdbcRepositoryConfiguration.PROPERTY_FULL_OBJECT_FORMAT.- Specified by:
 getFullObjectFormatin interfaceJdbcRepositoryConfiguration
 
- 
isEmbedded
public boolean isEmbedded()
- Specified by:
 isEmbeddedin interfaceJdbcRepositoryConfiguration
 
- 
getDefaultEmbeddedJdbcUrlPrefix
public String getDefaultEmbeddedJdbcUrlPrefix()
- Specified by:
 getDefaultEmbeddedJdbcUrlPrefixin interfaceJdbcRepositoryConfiguration
 
- 
isUsing
public boolean isUsing(SupportedDatabase db)
- Specified by:
 isUsingin interfaceJdbcRepositoryConfiguration
 
- 
getTransactionIsolation
public TransactionIsolation getTransactionIsolation()
- Specified by:
 getTransactionIsolationin interfaceJdbcRepositoryConfiguration
 
- 
useSetReadOnlyOnConnection
public boolean useSetReadOnlyOnConnection()
Description copied from interface:JdbcRepositoryConfigurationIf true, thenConnection.setReadOnly(boolean)is used for read only transactions andJdbcRepositoryConfiguration.getReadOnlyTransactionStatement()is ignored.- Specified by:
 useSetReadOnlyOnConnectionin interfaceJdbcRepositoryConfiguration
 
- 
getMinPoolSize
public int getMinPoolSize()
- Specified by:
 getMinPoolSizein interfaceJdbcRepositoryConfiguration
 
- 
getMaxPoolSize
public int getMaxPoolSize()
- Specified by:
 getMaxPoolSizein interfaceJdbcRepositoryConfiguration
 
- 
getMaxLifetime
public Long getMaxLifetime()
- Specified by:
 getMaxLifetimein interfaceJdbcRepositoryConfiguration
 
- 
getIdleTimeout
public Long getIdleTimeout()
- Specified by:
 getIdleTimeoutin interfaceJdbcRepositoryConfiguration
 
- 
getInitializationFailTimeout
public long getInitializationFailTimeout()
- Specified by:
 getInitializationFailTimeoutin interfaceJdbcRepositoryConfiguration
 
- 
getKeepaliveTime
public Long getKeepaliveTime()
- Specified by:
 getKeepaliveTimein interfaceJdbcRepositoryConfiguration
 
- 
getLeakDetectionThreshold
public Long getLeakDetectionThreshold()
- Specified by:
 getLeakDetectionThresholdin interfaceJdbcRepositoryConfiguration
 
- 
getPerformanceStatisticsFile
public String getPerformanceStatisticsFile()
- Specified by:
 getPerformanceStatisticsFilein interfaceJdbcRepositoryConfiguration
 
- 
getPerformanceStatisticsLevel
public int getPerformanceStatisticsLevel()
- Specified by:
 getPerformanceStatisticsLevelin interfaceJdbcRepositoryConfiguration
 
- 
getIterativeSearchByPagingBatchSize
public int getIterativeSearchByPagingBatchSize()
- Specified by:
 getIterativeSearchByPagingBatchSizein interfaceJdbcRepositoryConfiguration
 
- 
setIterativeSearchByPagingBatchSize
public void setIterativeSearchByPagingBatchSize(int iterativeSearchByPagingBatchSize)
 
- 
isCreateMissingCustomColumns
public boolean isCreateMissingCustomColumns()
- Specified by:
 isCreateMissingCustomColumnsin interfaceJdbcRepositoryConfiguration
 
- 
getSqlDurationWarningMs
public long getSqlDurationWarningMs()
Returns threshold duration for SQL, after which it should be logged on warning level. Value of 0 or less means that this warning is disabled. 
- 
initForAudit
public static SqaleRepositoryConfiguration initForAudit(@NotNull @NotNull SqaleRepositoryConfiguration mainRepoConfig, org.apache.commons.configuration2.Configuration auditConfig)
Creates a copy of provided configuration for audit and applies override from config.xml. This is used when the same data source is used by audit and repository. 
 - 
 
 -