Class ClusterService
- java.lang.Object
-
- org.imixs.archive.service.cassandra.ClusterService
-
public class ClusterService extends Object
The ClusterService provides methods to persist the content of a Imixs Document into a Cassandra keystore.The service saves the content in XML format. The size of an XML representation of a Imixs document is only slightly different in size from the serialized map object. This is the reason why we do not store the document map in a serialized object format.
The ClusterService creates a Core-KeySpace automatically which is used for the internal management.
- Author:
- rsoika
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ClusterService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateArchiveTableSchema(com.datastax.driver.core.Session session)This helper method creates the ImixsArchive document table schema if not yet existsprotected com.datastax.driver.core.SessioncreateKeySpace(String keySpace)This method creates a cassandra keySpace.com.datastax.driver.core.SessiongetSession()protected com.datastax.driver.core.ClusterinitCluster()This method creates a Cassandra Cluster object.booleanisValidKeyspaceName(String keySpace)Test if the keyspace name is valid.
-
-
-
Field Detail
-
KEYSPACE_REGEX
public static final String KEYSPACE_REGEX
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_CONTACTPOINTS
public static final String ENV_ARCHIVE_CLUSTER_CONTACTPOINTS
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_KEYSPACE
public static final String ENV_ARCHIVE_CLUSTER_KEYSPACE
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_AUTH_USER
public static final String ENV_ARCHIVE_CLUSTER_AUTH_USER
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_AUTH_PASSWORD
public static final String ENV_ARCHIVE_CLUSTER_AUTH_PASSWORD
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_SSL
public static final String ENV_ARCHIVE_CLUSTER_SSL
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_SSL_TRUSTSTOREPATH
public static final String ENV_ARCHIVE_CLUSTER_SSL_TRUSTSTOREPATH
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_SSL_TRUSTSTOREPASSWORD
public static final String ENV_ARCHIVE_CLUSTER_SSL_TRUSTSTOREPASSWORD
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_SSL_KEYSTOREPATH
public static final String ENV_ARCHIVE_CLUSTER_SSL_KEYSTOREPATH
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_SSL_KEYSTOREPASSWORD
public static final String ENV_ARCHIVE_CLUSTER_SSL_KEYSTOREPASSWORD
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_REPLICATION_FACTOR
public static final String ENV_ARCHIVE_CLUSTER_REPLICATION_FACTOR
- See Also:
- Constant Field Values
-
ENV_ARCHIVE_CLUSTER_REPLICATION_CLASS
public static final String ENV_ARCHIVE_CLUSTER_REPLICATION_CLASS
- See Also:
- Constant Field Values
-
ENV_WORKFLOW_SERVICE_ENDPOINT
public static final String ENV_WORKFLOW_SERVICE_ENDPOINT
- See Also:
- Constant Field Values
-
ENV_WORKFLOW_SERVICE_USER
public static final String ENV_WORKFLOW_SERVICE_USER
- See Also:
- Constant Field Values
-
ENV_WORKFLOW_SERVICE_PASSWORD
public static final String ENV_WORKFLOW_SERVICE_PASSWORD
- See Also:
- Constant Field Values
-
ENV_WORKFLOW_SERVICE_AUTHMETHOD
public static final String ENV_WORKFLOW_SERVICE_AUTHMETHOD
- See Also:
- Constant Field Values
-
TABLE_SCHEMA_SNAPSHOTS
public static final String TABLE_SCHEMA_SNAPSHOTS
- See Also:
- Constant Field Values
-
TABLE_SCHEMA_SNAPSHOTS_BY_UNIQUEID
public static final String TABLE_SCHEMA_SNAPSHOTS_BY_UNIQUEID
- See Also:
- Constant Field Values
-
TABLE_SCHEMA_SNAPSHOTS_BY_MODIFIED
public static final String TABLE_SCHEMA_SNAPSHOTS_BY_MODIFIED
- See Also:
- Constant Field Values
-
TABLE_SCHEMA_DOCUMENTS
public static final String TABLE_SCHEMA_DOCUMENTS
- See Also:
- Constant Field Values
-
TABLE_SCHEMA_SNAPSHOTS_BY_DOCUMENT
public static final String TABLE_SCHEMA_SNAPSHOTS_BY_DOCUMENT
- See Also:
- Constant Field Values
-
TABLE_SCHEMA_DOCUMENTS_DATA
public static final String TABLE_SCHEMA_DOCUMENTS_DATA
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSession
public com.datastax.driver.core.Session getSession()
-
initCluster
protected com.datastax.driver.core.Cluster initCluster() throws ArchiveExceptionThis method creates a Cassandra Cluster object. The cluster is defined by ContactPoints provided in the environmetn variable 'ARCHIVE_CLUSTER_CONTACTPOINTS' or in the imixs.property 'archive.cluster.contactpoints'- Returns:
- Cassandra Cluster instacne
- Throws:
ArchiveException
-
isValidKeyspaceName
public boolean isValidKeyspaceName(String keySpace)
Test if the keyspace name is valid.- Parameters:
keySpace-- Returns:
-
createKeySpace
protected com.datastax.driver.core.Session createKeySpace(String keySpace) throws ArchiveException
This method creates a cassandra keySpace.Depending on the KeyspaceType, the method creates the core table schema to store configurations, or the extended Archive table schcema which is used to store imixs documents.
- Parameters:
cluster-- Throws:
ArchiveException
-
createArchiveTableSchema
protected void createArchiveTableSchema(com.datastax.driver.core.Session session)
This helper method creates the ImixsArchive document table schema if not yet exists
-
-