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_DOCUMENTS |
static String |
STATEMENT_SELECT_DOCUMENTS_DATA |
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_DOCUMENTS_DATA |
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 |
|---|---|
long |
calculateSize(org.imixs.workflow.xml.XMLDocument xmldoc)
count total value size...
|
void |
deleteSnapshot(org.imixs.workflow.ItemCollection itemCol)
This method deletes a snapshot.
|
boolean |
existSnapshot(String snapshotID)
This method test if a snapshot recored with a given ID already exists.
|
org.imixs.workflow.ItemCollection |
getItemCollection(byte[] source)
Converts a byte array into a XMLDocument and returns the ItemCollection
object.
|
byte[] |
getRawData(org.imixs.workflow.ItemCollection itemCol)
Converts a ItemCollection into a XMLDocument and returns the byte data.
|
long |
getSnapshotTime(String snapshotID)
Returns the snapshot time n milis of a $SnapshotID
|
String |
getSyncPointISO(long point)
returns the date tiem from a date in iso format
|
String |
getUniqueID(String snapshotID)
Returns the $uniqueID from a $SnapshotID
|
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 |
byte[] |
loadFileContent(String md5)
This helper method loades the content of a document defned by its MD5
checksum.
|
org.imixs.workflow.FileData |
loadFileData(org.imixs.workflow.FileData fileData)
This helper method loades the content of a document defned by a FileData
object.
|
org.imixs.workflow.ItemCollection |
loadMetadata()
This method loads the metadata object represended by an ItemCollection.
|
org.imixs.workflow.ItemCollection |
loadSnapshot(String snapshotID)
This method loads a snapshot form the cassandra cluster.
|
org.imixs.workflow.ItemCollection |
loadSnapshot(String snapshotID,
boolean mergeDocuments)
Thist method loads a snapshot form the cassandra cluster.
|
List<String> |
loadSnapshotsByDate(LocalDate date)
This method loads all exsting snapshotIDs for a given date.
|
List<String> |
loadSnapshotsByUnqiueID(String uniqueID,
int maxCount)
This method loads all existing snapshotIDs for a given unqiueID.
|
void |
saveMetadata(org.imixs.workflow.ItemCollection metadata)
This method saves the metadata represented by an ItemCollection.
|
void |
saveSnapshot(org.imixs.workflow.ItemCollection snapshot)
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_DOCUMENTS_DATA
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_DOCUMENTS
public static final String STATEMENT_SELECT_DOCUMENTS_DATA
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)
throws ArchiveException
The method expects a valid session instance which must be closed by the client.
snapshot - - ItemCollection objectsession - - cassandra sessionArchiveExceptionpublic org.imixs.workflow.FileData loadFileData(org.imixs.workflow.FileData fileData)
throws ArchiveException
itemCol - ArchiveExceptionpublic byte[] loadFileContent(String md5) throws ArchiveException
itemCol - ArchiveExceptionpublic boolean existSnapshot(String snapshotID)
snapshotID - public org.imixs.workflow.ItemCollection loadSnapshot(String snapshotID) throws ArchiveException
snapshotID - - snapshot idsession - - cassandra sessionArchiveExceptionpublic org.imixs.workflow.ItemCollection loadSnapshot(String snapshotID, boolean mergeDocuments) 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()
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, int maxCount)
uniqueID - public List<String> loadSnapshotsByDate(LocalDate date)
date - public void saveMetadata(org.imixs.workflow.ItemCollection metadata)
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)
throws ArchiveException
The method also deletes the documents and all relations
itemCol - session - - cassandra sessionArchiveExceptionpublic byte[] getRawData(org.imixs.workflow.ItemCollection itemCol)
throws ArchiveException
itemCol - ArchiveExceptionpublic org.imixs.workflow.ItemCollection getItemCollection(byte[] source)
throws ArchiveException
ArchiveExceptionpublic boolean isSnapshotID(String uid)
We also need to support the old snapshto format
4832b09a1a-20c38abd-1519421083952
uid - public String getUniqueID(String snapshotID)
snapshotID - public long getSnapshotTime(String snapshotID)
snapshotID - public long calculateSize(org.imixs.workflow.xml.XMLDocument xmldoc)
xmldoc - public String getSyncPointISO(long point)
Copyright © 2016–2020 Imixs Software Solutions GmbH. All rights reserved.