Package org.togglz.core.repository.jdbc
Class JDBCStateRepository.Builder
- java.lang.Object
-
- org.togglz.core.repository.jdbc.JDBCStateRepository.Builder
-
- Enclosing class:
- JDBCStateRepository
public static class JDBCStateRepository.Builder extends Object
Builder for aJDBCStateRepository.
-
-
Constructor Summary
Constructors Constructor Description Builder(DataSource dataSource)Creates a new builder for creating aJDBCStateRepository.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JDBCStateRepositorybuild()Creates aJDBCStateRepositoryfrom the current configurationJDBCStateRepository.BuildercreateTable(boolean createTable)If set totrue, the table will be automatically created if it is missing.JDBCStateRepository.BuildernoCommit(boolean noCommit)Can be used to suppress to commit after modifying data in the repository.JDBCStateRepository.Builderserializer(MapSerializer serializer)TheMapSerializerfor storing parameters.JDBCStateRepository.BuildertableName(String tableName)Sets the table name to use for the Togglz feature state table.
-
-
-
Constructor Detail
-
Builder
public Builder(DataSource dataSource)
Creates a new builder for creating aJDBCStateRepository.- Parameters:
dataSource- theDataSourceTogglz should use to obtain JDBC connections
-
-
Method Detail
-
tableName
public JDBCStateRepository.Builder tableName(String tableName)
Sets the table name to use for the Togglz feature state table. The default name isTOGGLZ.- Parameters:
tableName- The database table name
-
serializer
public JDBCStateRepository.Builder serializer(MapSerializer serializer)
TheMapSerializerfor storing parameters. By default the repository will useDefaultMapSerializer.multiline().- Parameters:
serializer- The serializer to use
-
noCommit
public JDBCStateRepository.Builder noCommit(boolean noCommit)
Can be used to suppress to commit after modifying data in the repository. Can be useful if Togglz uses managed connections provided by a JEE container. The default isfalse.- Parameters:
noCommit-trueto suppress commits
-
createTable
public JDBCStateRepository.Builder createTable(boolean createTable)
If set totrue, the table will be automatically created if it is missing. The default istrue.- Parameters:
createTable-trueif the table should be created automatically
-
build
public JDBCStateRepository build()
Creates aJDBCStateRepositoryfrom the current configuration
-
-