com.gentics.api.lib.datasource
Class AbstractVersioningDatasource

java.lang.Object
  extended by com.gentics.api.lib.datasource.AbstractDatasource
      extended by com.gentics.api.lib.datasource.AbstractVersioningDatasource
All Implemented Interfaces:
Datasource, VersioningDatasource, Cloneable

public abstract class AbstractVersioningDatasource
extends AbstractDatasource
implements VersioningDatasource

Abstract basic implementation for versioning datasources. Implementors should rather override this class than implement the interface Datasource directly in order to


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.gentics.api.lib.datasource.VersioningDatasource
VersioningDatasource.Version
 
Nested classes/interfaces inherited from interface com.gentics.api.lib.datasource.Datasource
Datasource.Sorting
 
Field Summary
 
Fields inherited from interface com.gentics.api.lib.datasource.VersioningDatasource
EMPTY_VERSIONLIST
 
Fields inherited from interface com.gentics.api.lib.datasource.Datasource
SORTORDER_ASC, SORTORDER_DESC, SORTORDER_NONE
 
Constructor Summary
AbstractVersioningDatasource(String id)
           
 
Method Summary
 int getCount(DatasourceFilter filter)
          Get the number of objects in the datasource that match the given filter
 int getCount(DatasourceFilter filter, int versionTimestamp)
          Get the number of resolvables matching the given filter at the versionTimestamp
 int getCount(DatasourceFilter filter, Map specificParameters)
          Get the number of objects in the datasource that match the given filter
 Collection getResult(DatasourceFilter filter, String[] prefillAttributes, int versionTimestamp)
          Get the resolvables matching the given datasource filter at the timestamp
 Collection getResult(DatasourceFilter filter, String[] prefillAttributes, int start, int count, Datasource.Sorting[] sortedColumns, int versionTimestamp)
          Get the resolvables matching the given datasource filter at the timestamp
 Collection getResult(DatasourceFilter filter, String[] prefillAttributes, int start, int count, Datasource.Sorting[] sortedColumns, Map specificParameters)
          Get the resolvables from the datasource that match the given datasource filter.
 
Methods inherited from class com.gentics.api.lib.datasource.AbstractDatasource
clone, getCount, getId, getResult, getResult, getResult, getResult, getResult, hasChanged, isValidAttribute, setId
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.gentics.api.lib.datasource.VersioningDatasource
checkRequirements, create, getCount, getResult, getVersions, isVersioning, setVersionTimestamp
 
Methods inherited from interface com.gentics.api.lib.datasource.Datasource
clone, createDatasourceFilter, getCount, getCount2, getHandlePool, getId, getResult, getResult, getResult, getResult, getResult, getResult, hasChanged, hasChanged, isValidAttribute, setAttributeNames, setRuleTree
 

Constructor Detail

AbstractVersioningDatasource

public AbstractVersioningDatasource(String id)
Method Detail

getCount

public int getCount(DatasourceFilter filter,
                    Map specificParameters)
             throws DatasourceException
Description copied from interface: Datasource
Get the number of objects in the datasource that match the given filter

Specified by:
getCount in interface Datasource
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)
Returns:
number of objects that match the filter
Throws:
DatasourceException
See Also:
Datasource.createDatasourceFilter(Expression)

getCount

public int getCount(DatasourceFilter filter)
             throws DatasourceException
Description copied from interface: Datasource
Get the number of objects in the datasource that match the given filter

Specified by:
getCount in interface Datasource
Overrides:
getCount in class AbstractDatasource
Parameters:
filter - datasource filter
Returns:
number of objects that match the filter
Throws:
DatasourceException
See Also:
Datasource.createDatasourceFilter(Expression)

getCount

public int getCount(DatasourceFilter filter,
                    int versionTimestamp)
             throws DatasourceException
Description copied from interface: VersioningDatasource
Get the number of resolvables matching the given filter at the versionTimestamp

Specified by:
getCount in interface VersioningDatasource
Parameters:
filter - datasource filter
versionTimestamp - version timestamp, -1 for current versions
Returns:
number of resolvables matching the datasource filter at the versionTimestamp
Throws:
DatasourceException

getResult

public Collection getResult(DatasourceFilter filter,
                            String[] prefillAttributes,
                            int versionTimestamp)
                     throws DatasourceException
Description copied from interface: VersioningDatasource
Get the resolvables matching the given datasource filter at the timestamp

Specified by:
getResult in interface VersioningDatasource
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

public Collection getResult(DatasourceFilter filter,
                            String[] prefillAttributes,
                            int start,
                            int count,
                            Datasource.Sorting[] sortedColumns,
                            int versionTimestamp)
                     throws DatasourceException
Description copied from interface: VersioningDatasource
Get the resolvables matching the given datasource filter at the timestamp

Specified by:
getResult in interface VersioningDatasource
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

public Collection getResult(DatasourceFilter filter,
                            String[] prefillAttributes,
                            int start,
                            int count,
                            Datasource.Sorting[] sortedColumns,
                            Map specificParameters)
                     throws DatasourceException
Description copied from interface: Datasource
Get the resolvables from the datasource that match the given datasource filter.

Specified by:
getResult in interface Datasource
Parameters:
filter - datasource filter
prefillAttributes - array of attribute names to prefill (null or empty for no prefilling)
start - index of the first object to return
count - maximum number of objects to return (-1 for all objects).
sortedColumns - possible sorting (may be null for "no sorting")
specificParameters - map of specific parameters, which will be interpreted by some specific Datasources, may be null or empty (no specific parameters)
Returns:
collection of resolvables matching the filter
Throws:
DatasourceException
See Also:
Datasource.createDatasourceFilter(Expression)


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.