public class JdbcFeatureStore extends AbstractFeatureStore
FeatureStore to work with RDBMS through JDBC.| Modifier and Type | Field and Description |
|---|---|
static String |
CANNOT_CHECK_FEATURE_EXISTENCE_ERROR_RELATED_TO_DATABASE
Error message 1.
|
static String |
CANNOT_UPDATE_FEATURES_DATABASE_SQL_ERROR
Error message 2.
|
| Constructor and Description |
|---|
JdbcFeatureStore()
Default Constructor.
|
JdbcFeatureStore(DataSource jdbcDS)
Constructor from DataSource.
|
JdbcFeatureStore(DataSource jdbcDS,
String xmlConfFile)
Constructor from DataSource.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToGroup(String uid,
String groupName)
Add target
Feature to target group. |
void |
clear()
Empty features set.
|
void |
create(Feature fp)
Create flipPoint in storage (with roles).
|
void |
createCustomProperties(String uid,
Collection<Property<?>> props)
Ease creation of properties in Database.
|
void |
createSchema()
Initialize the target database schema by creating expected structures.
|
void |
delete(String uid)
Remove fliPoint from store.
|
void |
disable(String uid)
Create Feature is does not exist and enable it.
|
void |
disableGroup(String groupName)
Disable all features contained in the following group.
|
void |
enable(String uid)
Enable/UP/switch on a FlipPoint.
|
void |
enableGroup(String groupName)
Enable all features contained in the following group.
|
boolean |
exist(String uid)
Check if Feature Exist.
|
boolean |
existGroup(String groupName)
Check if current group exist or not.
|
DataSource |
getDataSource()
Getter accessor for attribute 'dataSource'.
|
JdbcQueryBuilder |
getQueryBuilder() |
void |
grantRoleOnFeature(String uid,
String roleName)
Add a role to a flipPOINT.
|
Feature |
read(String uid)
Create Feature is does not exist and enable it.
|
Map<String,Feature> |
readAll()
Access to all features to get information.
|
Set<String> |
readAllGroups()
Return a set of existing groups.
|
Map<String,Feature> |
readGroup(String groupName)
Read all features within target group.
|
void |
removeFromGroup(String uid,
String groupName)
Remove target
Feature from group. |
void |
removeRoleFromFeature(String uid,
String roleName)
Remove role to acess flip point
|
void |
setDataSource(DataSource dataSource)
Setter accessor for attribute 'dataSource'.
|
void |
setQueryBuilder(JdbcQueryBuilder queryBuilder) |
void |
update(Feature fp)
Update FlipPoint within store.
|
void |
update(String query,
String... params)
Utility method to perform UPDATE and DELETE operations.
|
assertFeatureExist, assertFeatureNotExist, assertFeatureNotNull, assertGroupExist, importFeatures, importFeaturesFromXmlFile, toJson, toStringpublic static final String CANNOT_CHECK_FEATURE_EXISTENCE_ERROR_RELATED_TO_DATABASE
public static final String CANNOT_UPDATE_FEATURES_DATABASE_SQL_ERROR
public JdbcFeatureStore()
public JdbcFeatureStore(DataSource jdbcDS)
jdbcDS - native jdbc datasourcepublic JdbcFeatureStore(DataSource jdbcDS, String xmlConfFile)
jdbcDS - native jdbc datasourcepublic void createSchema()
createSchema in interface FeatureStorecreateSchema in class AbstractFeatureStorepublic void enable(String uid)
uid - unique feature identifierpublic void disable(String uid)
public boolean exist(String uid)
public void create(Feature fp)
fp - create rolespublic void delete(String uid)
public void grantRoleOnFeature(String uid, String roleName)
public void removeRoleFromFeature(String uid, String roleName)
public Map<String,Feature> readAll()
public Set<String> readAllGroups()
public void update(Feature fp)
fp - flipPoint new elementpublic void clear()
public void createCustomProperties(String uid, Collection<Property<?>> props)
uid - target unique identifierprops - target properties.public boolean existGroup(String groupName)
groupName - target group namepublic void enableGroup(String groupName)
groupName - target group namepublic void disableGroup(String groupName)
groupName - target group namepublic Map<String,Feature> readGroup(String groupName)
groupName - target group namepublic void addToGroup(String uid, String groupName)
Feature to target group.uid - target feature identifiergroupName - target groupNamepublic void removeFromGroup(String uid, String groupName)
Feature from group.uid - target feature identifiergroupName - target groupNamepublic void update(String query, String... params)
query - target queryparams - sql query paramspublic DataSource getDataSource()
public void setDataSource(DataSource dataSource)
dataSource - new value for 'dataSource 'public JdbcQueryBuilder getQueryBuilder()
public void setQueryBuilder(JdbcQueryBuilder queryBuilder)
queryBuilder - the queryBuilder to setCopyright © 2013–2017 FF4J. All rights reserved.