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 String
APPLICATION_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 SupportedDatabase
getDatabaseType()
String
getDataSource()
String
getDefaultEmbeddedJdbcUrlPrefix()
String
getDriverClassName()
String
getFullObjectFormat()
Returns serialization format (language) for writing fullObject.Long
getIdleTimeout()
long
getInitializationFailTimeout()
int
getIterativeSearchByPagingBatchSize()
String
getJdbcPassword()
String
getJdbcUrl()
String
getJdbcUrl(@NotNull String applicationName)
Allows distinguishing connections for various usages like repository, audit, scheduler.String
getJdbcUsername()
Long
getKeepaliveTime()
Long
getLeakDetectionThreshold()
Long
getMaxLifetime()
int
getMaxPoolSize()
int
getMinPoolSize()
String
getPerformanceStatisticsFile()
int
getPerformanceStatisticsLevel()
TransactionIsolation
getTransactionIsolation()
void
init()
static SqaleRepositoryConfiguration
initForAudit(@NotNull SqaleRepositoryConfiguration mainRepoConfig, org.apache.commons.configuration2.Configuration auditConfig)
Creates a copy of provided configuration for audit and applies override from config.xml.boolean
isCreateMissingCustomColumns()
boolean
isEmbedded()
boolean
isUseZip()
We leave potential compression to PG, for us the values are plain.boolean
isUseZipAudit()
We leave potential compression to PG, for us the values are plain.boolean
isUsing(SupportedDatabase db)
protected void
notEmpty(String value, String message)
void
setIterativeSearchByPagingBatchSize(int iterativeSearchByPagingBatchSize)
boolean
useSetReadOnlyOnConnection()
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, isUsingMySqlCompatible, 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:
getDatabaseType
in interfaceJdbcRepositoryConfiguration
-
getDataSource
public String getDataSource()
- Specified by:
getDataSource
in interfaceJdbcRepositoryConfiguration
-
notEmpty
protected void notEmpty(String value, String message) throws RepositoryServiceFactoryException
-
getDriverClassName
public String getDriverClassName()
- Specified by:
getDriverClassName
in interfaceJdbcRepositoryConfiguration
-
getJdbcUrl
public String getJdbcUrl()
- Specified by:
getJdbcUrl
in interfaceJdbcRepositoryConfiguration
-
getJdbcUrl
public String getJdbcUrl(@NotNull @NotNull String applicationName)
Description copied from interface:JdbcRepositoryConfiguration
Allows distinguishing connections for various usages like repository, audit, scheduler. By default, this doesn't do anything, but works for new repository.- Specified by:
getJdbcUrl
in interfaceJdbcRepositoryConfiguration
-
getJdbcUsername
public String getJdbcUsername()
- Specified by:
getJdbcUsername
in interfaceJdbcRepositoryConfiguration
-
getJdbcPassword
public String getJdbcPassword()
- Specified by:
getJdbcPassword
in interfaceJdbcRepositoryConfiguration
-
isUseZip
public boolean isUseZip()
We leave potential compression to PG, for us the values are plain.- Specified by:
isUseZip
in interfaceJdbcRepositoryConfiguration
-
isUseZipAudit
public boolean isUseZipAudit()
We leave potential compression to PG, for us the values are plain.- Specified by:
isUseZipAudit
in interfaceJdbcRepositoryConfiguration
-
getFullObjectFormat
public String getFullObjectFormat()
Returns serialization format (language) for writing fullObject. Also seeJdbcRepositoryConfiguration.PROPERTY_FULL_OBJECT_FORMAT
.- Specified by:
getFullObjectFormat
in interfaceJdbcRepositoryConfiguration
-
isEmbedded
public boolean isEmbedded()
- Specified by:
isEmbedded
in interfaceJdbcRepositoryConfiguration
-
getDefaultEmbeddedJdbcUrlPrefix
public String getDefaultEmbeddedJdbcUrlPrefix()
- Specified by:
getDefaultEmbeddedJdbcUrlPrefix
in interfaceJdbcRepositoryConfiguration
-
isUsing
public boolean isUsing(SupportedDatabase db)
- Specified by:
isUsing
in interfaceJdbcRepositoryConfiguration
-
getTransactionIsolation
public TransactionIsolation getTransactionIsolation()
- Specified by:
getTransactionIsolation
in interfaceJdbcRepositoryConfiguration
-
useSetReadOnlyOnConnection
public boolean useSetReadOnlyOnConnection()
Description copied from interface:JdbcRepositoryConfiguration
If true, thenConnection.setReadOnly(boolean)
is used for read only transactions andJdbcRepositoryConfiguration.getReadOnlyTransactionStatement()
is ignored.- Specified by:
useSetReadOnlyOnConnection
in interfaceJdbcRepositoryConfiguration
-
getMinPoolSize
public int getMinPoolSize()
- Specified by:
getMinPoolSize
in interfaceJdbcRepositoryConfiguration
-
getMaxPoolSize
public int getMaxPoolSize()
- Specified by:
getMaxPoolSize
in interfaceJdbcRepositoryConfiguration
-
getMaxLifetime
public Long getMaxLifetime()
- Specified by:
getMaxLifetime
in interfaceJdbcRepositoryConfiguration
-
getIdleTimeout
public Long getIdleTimeout()
- Specified by:
getIdleTimeout
in interfaceJdbcRepositoryConfiguration
-
getInitializationFailTimeout
public long getInitializationFailTimeout()
- Specified by:
getInitializationFailTimeout
in interfaceJdbcRepositoryConfiguration
-
getKeepaliveTime
public Long getKeepaliveTime()
- Specified by:
getKeepaliveTime
in interfaceJdbcRepositoryConfiguration
-
getLeakDetectionThreshold
public Long getLeakDetectionThreshold()
- Specified by:
getLeakDetectionThreshold
in interfaceJdbcRepositoryConfiguration
-
getPerformanceStatisticsFile
public String getPerformanceStatisticsFile()
- Specified by:
getPerformanceStatisticsFile
in interfaceJdbcRepositoryConfiguration
-
getPerformanceStatisticsLevel
public int getPerformanceStatisticsLevel()
- Specified by:
getPerformanceStatisticsLevel
in interfaceJdbcRepositoryConfiguration
-
getIterativeSearchByPagingBatchSize
public int getIterativeSearchByPagingBatchSize()
- Specified by:
getIterativeSearchByPagingBatchSize
in interfaceJdbcRepositoryConfiguration
-
setIterativeSearchByPagingBatchSize
public void setIterativeSearchByPagingBatchSize(int iterativeSearchByPagingBatchSize)
-
isCreateMissingCustomColumns
public boolean isCreateMissingCustomColumns()
- Specified by:
isCreateMissingCustomColumns
in interfaceJdbcRepositoryConfiguration
-
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.
-
-