com.gentics.api.lib.datasource
Interface VersioningDatasource

All Superinterfaces:
java.lang.Cloneable, Datasource
All Known Implementing Classes:
AbstractVersioningDatasource

public interface VersioningDatasource
extends Datasource

Interface for datasource that may support versioning (although specific datasources using implementations of this interface may be configured not to use versioning). Generally, objects managed by versioning datasources should implement the Interface VersionedObject.
Implementation note: Do not implement this interface directly, but extend AbstractVersioningDatasource instead.


Nested Class Summary
static class VersioningDatasource.Version
          provides meta information about a single version of a dataset.
 
Nested classes/interfaces inherited from interface com.gentics.api.lib.datasource.Datasource
Datasource.Sorting
 
Field Summary
static VersioningDatasource.Version[] EMPTY_VERSIONLIST
          constant for an empty version list
 
Fields inherited from interface com.gentics.api.lib.datasource.Datasource
SORTORDER_ASC, SORTORDER_DESC, SORTORDER_NONE
 
Method Summary
 boolean checkRequirements()
          check the requirements for versioning
 Changeable create(java.util.Map objectParameters, int versionTimestamp)
          Create a datasource object with the given object data at the given timestamp
 int getCount(DatasourceFilter filter, int versionTimestamp)
          Get the number of resolvables matching the given filter at the versionTimestamp
 int getCount(DatasourceFilter filter, java.util.Map specificParameters, int versionTimestamp)
          Get the number of resolvables matching the given filter at the versionTimestamp
 java.util.Collection getResult(DatasourceFilter filter, java.lang.String[] prefillAttributes, int versionTimestamp)
          Get the resolvables matching the given datasource filter at the timestamp
 java.util.Collection getResult(DatasourceFilter filter, java.lang.String[] prefillAttributes, int start, int count, Datasource.Sorting[] sortedColumns, int versionTimestamp)
          Get the resolvables matching the given datasource filter at the timestamp
 java.util.Collection getResult(DatasourceFilter filter, java.lang.String[] prefillAttributes, int start, int count, Datasource.Sorting[] sortedColumns, java.util.Map specificParameters, int versionTimestamp)
          Get the resolvables matching the given datasource filter at the timestamp
 VersioningDatasource.Version[] getVersions(java.lang.String id)
          get the lst of available versions for the given contentid
 boolean isVersioning()
          return true when this datasource supports versioning, false if not
 void setVersionTimestamp(int timestamp)
          set the version timestamp to be used for querying, when the datasource is versioning.
 
Methods inherited from interface com.gentics.api.lib.datasource.Datasource
clone, createDatasourceFilter, getCount, getCount, getCount, getCount2, getHandlePool, getId, getResult, getResult, getResult, getResult, getResult, getResult, getResult, hasChanged, hasChanged, isValidAttribute, setAttributeNames, setRuleTree
 

Field Detail

EMPTY_VERSIONLIST

static final VersioningDatasource.Version[] EMPTY_VERSIONLIST
constant for an empty version list

Method Detail

isVersioning

boolean isVersioning()
return true when this datasource supports versioning, false if not

Returns:
true/false depending whether versioning is supported

setVersionTimestamp

void setVersionTimestamp(int timestamp)
set the version timestamp to be used for querying, when the datasource is versioning. when -1 is set as timestamp, queries will be done with the current versions

Parameters:
timestamp - timestamp to be used or -1 to reset versioned querying
See Also:
isVersioning()

checkRequirements

boolean checkRequirements()
check the requirements for versioning

Returns:
true when all requirements are met, false if not

getVersions

VersioningDatasource.Version[] getVersions(java.lang.String id)
get the lst of available versions for the given contentid

Parameters:
id - id of the object
Returns:
list of available versions (empty list if no versioning)

create

Changeable create(java.util.Map objectParameters,
                  int versionTimestamp)
                  throws DatasourceException
Create a datasource object with the given object data at the given timestamp

Parameters:
objectParameters - object data
versionTimestamp - version timestamp
Returns:
the created datasource object
Throws:
DatasourceException

getResult

java.util.Collection getResult(DatasourceFilter filter,
                               java.lang.String[] prefillAttributes,
                               int versionTimestamp)
                               throws DatasourceException
Get the resolvables matching the given datasource filter at the timestamp

Parameters:
filter - datasource filter
prefillAttributes - array of attribute names to prefill (null or empty for no prefilling)
versionTimestamp - version timestamp (-1 for current versions)
Returns:
collection of resolvables matching the datasource filter at the given versionTimestamp
Throws:
DatasourceException

getResult

java.util.Collection getResult(DatasourceFilter filter,
                               java.lang.String[] prefillAttributes,
                               int start,
                               int count,
                               Datasource.Sorting[] sortedColumns,
                               int versionTimestamp)
                               throws DatasourceException
Get the resolvables matching the given datasource filter at the timestamp

Parameters:
filter - datasource filter
prefillAttributes - array of attribute names to prefill (null or empty for no prefilling)
start - index of the first returned object
count - maximum number of objects returned, -1 for all objects
sortedColumns - sorted columns, may be null (no sorting used)
versionTimestamp - version timestamp (-1 for current versions)
Returns:
collection of resolvables matching the datasource filter at the given versionTimestamp
Throws:
DatasourceException

getResult

java.util.Collection getResult(DatasourceFilter filter,
                               java.lang.String[] prefillAttributes,
                               int start,
                               int count,
                               Datasource.Sorting[] sortedColumns,
                               java.util.Map specificParameters,
                               int versionTimestamp)
                               throws DatasourceException
Get the resolvables matching the given datasource filter at the timestamp

Parameters:
filter - datasource filter
prefillAttributes - array of attribute names to prefill (null or empty for no prefilling)
start - index of the first returned object
count - maximum number of objects returned, -1 for all objects
sortedColumns - sorted columns, may be null (no sorting used)
specificParameters - map of specific parameters, which will be interpreted by some specific Datasources, may be null or empty (no specific parameters)
versionTimestamp - version timestamp (-1 for current versions)
Returns:
collection of resolvables matching the datasource filter at the given versionTimestamp
Throws:
DatasourceException

getCount

int getCount(DatasourceFilter filter,
             int versionTimestamp)
             throws DatasourceException
Get the number of resolvables matching the given filter at the versionTimestamp

Parameters:
filter - datasource filter
versionTimestamp - version timestamp, -1 for current versions
Returns:
number of resolvables matching the datasource filter at the versionTimestamp
Throws:
DatasourceException

getCount

int getCount(DatasourceFilter filter,
             java.util.Map specificParameters,
             int versionTimestamp)
             throws DatasourceException
Get the number of resolvables matching the given filter at the versionTimestamp

Parameters:
filter - datasource filter
specificParameters - map of specific parameters, which will be interpreted by some specific Datasources, may be null or empty (no specific parameters)
versionTimestamp - version timestamp, -1 for current versions
Returns:
number of resolvables matching the datasource filter at the versionTimestamp
Throws:
DatasourceException


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.