Class CassandraDataStore
java.lang.Object
org.apache.wicket.pageStore.AbstractPersistentPageStore
org.wicketstuff.datastores.cassandra.CassandraDataStore
- All Implemented Interfaces:
IPageStore,IPersistentPageStore
A store that saves serialiazed pages in Apache Cassandra.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.wicket.pageStore.AbstractPersistentPageStore
AbstractPersistentPageStore.PersistedPage -
Constructor Summary
ConstructorsConstructorDescriptionCassandraDataStore(String applicationName, com.datastax.driver.core.Cluster cluster, ICassandraSettings settings) Constructor.CassandraDataStore(String applicationName, ICassandraSettings settings) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddPersistedPage(String identifier, IManageablePage page) protected com.datastax.driver.core.KeyspaceMetadatacreateKeyspaceIfNecessary(String keyspaceName, com.datastax.driver.core.Metadata metadata) Creates the Cassandra keyspace where the data will be stored if it doesn't exists alreadyprotected voidcreateTableIfNecessary(String keyspaceName, com.datastax.driver.core.KeyspaceMetadata keyspaceMetadata) Creates the table where the data will be stored if it doesn't exists alreadyvoiddestroy()protected IManageablePagegetPersistedPage(String sessionIdentifier, int pageId) getPersistedPages(String contextIdentifier) protected voidremoveAllPersistedPages(String identifier) protected voidremovePersistedPage(String identifier, IManageablePage page) booleanPages are always serialized, so versioning is supported.Methods inherited from class org.apache.wicket.pageStore.AbstractPersistentPageStore
addPage, canBeAsynchronous, createSessionIdentifier, getPage, getSessionIdentifier, removeAllPages, removePageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.wicket.pageStore.IPageStore
addPage, canBeAsynchronous, detach, end, getPage, removeAllPages, removePage, revertPageMethods inherited from interface org.apache.wicket.pageStore.IPersistentPageStore
getSessionIdentifier
-
Constructor Details
-
CassandraDataStore
Constructor. Creates a Cluster based on the contact points provided by the passed settings- Parameters:
settings- The various settings
-
CassandraDataStore
public CassandraDataStore(String applicationName, com.datastax.driver.core.Cluster cluster, ICassandraSettings settings) Constructor. Initializes the connection to the Cassandra cluster and creates the keyspace and/or table if necessary.- Parameters:
cluster- The Cassandra clustersettings- The various settings
-
-
Method Details
-
getPersistedPage
- Specified by:
getPersistedPagein classAbstractPersistentPageStore
-
removePersistedPage
- Specified by:
removePersistedPagein classAbstractPersistentPageStore
-
removeAllPersistedPages
- Specified by:
removeAllPersistedPagesin classAbstractPersistentPageStore
-
addPersistedPage
- Specified by:
addPersistedPagein classAbstractPersistentPageStore
-
destroy
public void destroy()- Specified by:
destroyin interfaceIPageStore- Overrides:
destroyin classAbstractPersistentPageStore
-
supportsVersioning
public boolean supportsVersioning()Pages are always serialized, so versioning is supported.- Specified by:
supportsVersioningin interfaceIPageStore
-
createTableIfNecessary
protected void createTableIfNecessary(String keyspaceName, com.datastax.driver.core.KeyspaceMetadata keyspaceMetadata) Creates the table where the data will be stored if it doesn't exists already- Parameters:
keyspaceName- The name of the keyspace where to create the tablekeyspaceMetadata- The keyspace metadata. May benullif this is the first usage of this store with these settings
-
createKeyspaceIfNecessary
protected com.datastax.driver.core.KeyspaceMetadata createKeyspaceIfNecessary(String keyspaceName, com.datastax.driver.core.Metadata metadata) Creates the Cassandra keyspace where the data will be stored if it doesn't exists already- Parameters:
keyspaceName- The name of the keyspacemetadata- The cluster metadata- Returns:
- The keyspace metadata. May be
nullif the the metadata doesn't exists yet.
-
getSessionIdentifiers
- Specified by:
getSessionIdentifiersin interfaceIPersistentPageStore
-
getTotalSize
- Specified by:
getTotalSizein interfaceIPersistentPageStore
-
getPersistedPages
- Specified by:
getPersistedPagesin interfaceIPersistentPageStore
-