public class DataService extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
COLUMN_DATA |
static String |
COLUMN_MD5 |
static String |
COLUMN_MODIFIED |
static String |
COLUMN_SNAPSHOT |
static String |
COLUMN_UNIQUEID |
protected javax.enterprise.event.Event<ArchiveEvent> |
events |
static String |
ITEM_MD5_CHECKSUM |
static String |
STATEMENT_SELECT_DOCUMENT |
static String |
STATEMENT_SELECT_MD5 |
static String |
STATEMENT_SELECT_METADATA |
static String |
STATEMENT_SELECT_SNAPSHOT |
static String |
STATEMENT_SELECT_SNAPSHOT_ID |
static String |
STATEMENT_SELECT_SNAPSHOTS_BY_MODIFIED |
static String |
STATEMENT_SELECT_SNAPSHOTS_BY_UNIQUEID |
static String |
STATEMENT_UPSET_DOCUMENTS |
static String |
STATEMENT_UPSET_SNAPSHOTS |
static String |
STATEMENT_UPSET_SNAPSHOTS_BY_DOCUMENT |
static String |
STATEMENT_UPSET_SNAPSHOTS_BY_MODIFIED |
static String |
STATEMENT_UPSET_SNAPSHOTS_BY_UNIQUEID |
| Constructor and Description |
|---|
DataService() |
| Modifier and Type | Method and Description |
|---|---|
static long |
calculateSize(org.imixs.workflow.xml.XMLDocument xmldoc)
count total value size...
|
void |
deleteSnapshot(org.imixs.workflow.ItemCollection itemCol,
com.datastax.driver.core.Session session)
This method deletes a snapshot.
|
boolean |
existSnapshot(String snapshotID,
com.datastax.driver.core.Session session)
This method test if a snapshot recored with a given ID already exists.
|
static org.imixs.workflow.ItemCollection |
getItemCollection(byte[] source)
Converts a byte array into a XMLDocument and returns the ItemCollection
object.
|
static byte[] |
getRawData(org.imixs.workflow.ItemCollection itemCol)
Converts a ItemCollection into a XMLDocument and returns the byte data.
|
static long |
getSnapshotTime(String snapshotID)
Returns the snapshot time n milis of a $SnapshotID
|
static String |
getUniqueID(String snapshotID)
Returns the $uniqueID from a $SnapshotID
|
static boolean |
isSnapshotID(String uid)
This method returns true if the given id is a valid Snapshot id (UUI +
timestamp
We also need to support the old snapshto format
4832b09a1a-20c38abd-1519421083952 |
org.imixs.workflow.ItemCollection |
loadMetadata(com.datastax.driver.core.Session session)
This method loads the metadata object represended by an ItemCollection.
|
org.imixs.workflow.ItemCollection |
loadSnapshot(String snapshotID,
boolean mergeDocuments,
com.datastax.driver.core.Session session)
Thist method loads a snapshot form the cassandra cluster.
|
org.imixs.workflow.ItemCollection |
loadSnapshot(String snapshotID,
com.datastax.driver.core.Session session)
This method loads a snapshot form the cassandra cluster.
|
List<String> |
loadSnapshotsByDate(Date date,
com.datastax.driver.core.Session session)
This method loads all exsting snapshotIDs for a given date.
|
List<String> |
loadSnapshotsByUnqiueID(String uniqueID,
com.datastax.driver.core.Session session)
This method loads all exsting snapshotIDs for a given unqiueID.
|
void |
saveMetadata(org.imixs.workflow.ItemCollection metadata,
com.datastax.driver.core.Session session)
This method saves the metadata represented by an ItemCollection.
|
void |
saveSnapshot(org.imixs.workflow.ItemCollection snapshot,
com.datastax.driver.core.Session session)
This method saves a ItemCollection into a specific KeySpace.
|
public static final String ITEM_MD5_CHECKSUM
public static final String COLUMN_SNAPSHOT
public static final String COLUMN_MODIFIED
public static final String COLUMN_UNIQUEID
public static final String COLUMN_DATA
public static final String COLUMN_MD5
public static final String STATEMENT_UPSET_SNAPSHOTS
public static final String STATEMENT_UPSET_SNAPSHOTS_BY_UNIQUEID
public static final String STATEMENT_UPSET_SNAPSHOTS_BY_MODIFIED
public static final String STATEMENT_UPSET_DOCUMENTS
public static final String STATEMENT_UPSET_SNAPSHOTS_BY_DOCUMENT
public static final String STATEMENT_SELECT_SNAPSHOT
public static final String STATEMENT_SELECT_METADATA
public static final String STATEMENT_SELECT_SNAPSHOT_ID
public static final String STATEMENT_SELECT_MD5
public static final String STATEMENT_SELECT_DOCUMENT
public static final String STATEMENT_SELECT_SNAPSHOTS_BY_UNIQUEID
public static final String STATEMENT_SELECT_SNAPSHOTS_BY_MODIFIED
@Inject protected javax.enterprise.event.Event<ArchiveEvent> events
public void saveSnapshot(org.imixs.workflow.ItemCollection snapshot,
com.datastax.driver.core.Session session)
throws ArchiveException
The method expects a valid session instance which must be closed by the client.
snapshot - - ItemCollection objectsession - - cassandra sessionArchiveExceptionpublic boolean existSnapshot(String snapshotID, com.datastax.driver.core.Session session)
snapshotID - public org.imixs.workflow.ItemCollection loadSnapshot(String snapshotID, com.datastax.driver.core.Session session) throws ArchiveException
snapshotID - - snapshot idsession - - cassandra sessionArchiveExceptionpublic org.imixs.workflow.ItemCollection loadSnapshot(String snapshotID, boolean mergeDocuments, com.datastax.driver.core.Session session) throws ArchiveException
snapshotID - - snapshot idmergeDocuments - - boolean, if true the accociated document data will be loaded and
merged into the snapshot data object.session - - cassandra sessionArchiveExceptionpublic org.imixs.workflow.ItemCollection loadMetadata(com.datastax.driver.core.Session session)
throws ArchiveException
If no metadata object yet exists, the method returns an empty ItemCollection.
The method expects a valid session instance which must be closed by the client.
ArchiveExceptionpublic List<String> loadSnapshotsByUnqiueID(String uniqueID, com.datastax.driver.core.Session session)
uniqueID - public List<String> loadSnapshotsByDate(Date date, com.datastax.driver.core.Session session)
date - public void saveMetadata(org.imixs.workflow.ItemCollection metadata,
com.datastax.driver.core.Session session)
throws ArchiveException
The method expects a valid session instance which must be closed by the client.
itemCol - - metadataArchiveExceptionpublic void deleteSnapshot(org.imixs.workflow.ItemCollection itemCol,
com.datastax.driver.core.Session session)
throws ArchiveException
The method also deletes the documents and all relations
itemCol - session - - cassandra sessionArchiveExceptionpublic static byte[] getRawData(org.imixs.workflow.ItemCollection itemCol)
throws ArchiveException
itemCol - ArchiveExceptionpublic static org.imixs.workflow.ItemCollection getItemCollection(byte[] source)
throws ArchiveException
ArchiveExceptionpublic static boolean isSnapshotID(String uid)
We also need to support the old snapshto format
4832b09a1a-20c38abd-1519421083952
uid - public static String getUniqueID(String snapshotID)
snapshotID - public static long getSnapshotTime(String snapshotID)
snapshotID - public static long calculateSize(org.imixs.workflow.xml.XMLDocument xmldoc)
xmldoc - Copyright © 2016–2019 Imixs Software Solutions GmbH. All rights reserved.