Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.storage.sql
Interface Mapper

All Superinterfaces:
RowMapper, javax.transaction.xa.XAResource
All Known Implementing Classes:
CachingMapper, JDBCMapper

public interface Mapper
extends RowMapper, javax.transaction.xa.XAResource

A Mapper maps Rows to and from the database.


Nested Class Summary
static class Mapper.Identification
          Identifiers assigned by a server to identify a client mapper and its repository.
 
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.storage.sql.RowMapper
RowMapper.CopyHierarchyResult, RowMapper.RowBatch, RowMapper.RowUpdate
 
Field Summary
static java.lang.String CLOSE
           
static java.lang.String GET_IDENTIFICATION
           
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Method Summary
 void close()
           
 void createClusterNode()
          Informs the cluster that this node exists.
 void createDatabase()
          Creates the necessary structures in the database.
 Invalidations getClusterInvalidations()
          Gets the invalidations from other cluster nodes.
 Mapper.Identification getIdentification()
          Returns the repository id and mapper id assigned.
 java.io.Serializable getLastVersionId(java.io.Serializable versionSeriesId)
          Gets the id of the last version given a version series id.
 java.io.Serializable getRootId(java.io.Serializable repositoryId)
          Gets the root id for a given repository, if registered.
 int getTableSize(java.lang.String tableName)
           
 java.io.Serializable getVersionIdByLabel(java.io.Serializable versionSeriesId, java.lang.String label)
          Gets the id of a version given a version series id and a label.
 void insertClusterInvalidations(Invalidations invalidations)
          Inserts the invalidation rows for the other cluster nodes.
 PartialList<java.io.Serializable> query(java.lang.String query, QueryFilter queryFilter, boolean countTotal)
          Makes a NXQL query to the database.
 IterableQueryResult queryAndFetch(java.lang.String query, java.lang.String queryType, QueryFilter queryFilter, java.lang.Object... params)
          Makes a query to the database and returns an iterable (which must be closed when done).
 void rebuildReadAcls()
           
 void removeClusterNode()
          Removes this node from the cluster.
 void setRootId(java.io.Serializable repositoryId, java.io.Serializable id)
          Records the newly generated root id for a given repository.
 void updateReadAcls()
           
 
Methods inherited from interface org.nuxeo.ecm.core.storage.sql.RowMapper
clearCache, copyHierarchy, getProxyRows, getVersionRows, read, readChildHierRow, readChildHierRows, readCollectionRowArray, readSimpleRow, receiveInvalidations, rollback, sendInvalidations, write
 
Methods inherited from interface javax.transaction.xa.XAResource
commit, end, forget, getTransactionTimeout, isSameRM, prepare, recover, rollback, setTransactionTimeout, start
 

Field Detail

GET_IDENTIFICATION

static final java.lang.String GET_IDENTIFICATION
See Also:
Constant Field Values

CLOSE

static final java.lang.String CLOSE
See Also:
Constant Field Values
Method Detail

getIdentification

Mapper.Identification getIdentification()
                                        throws StorageException
Returns the repository id and mapper id assigned.

This is used in remote stateless mode to be able to identify to which mapper an incoming connection is targeted, and from which repository instance.

Returns:
the repository and mapper identification
Throws:
StorageException - when initial connection failed (for a NetMapper)

close

void close()
           throws StorageException
Throws:
StorageException

getTableSize

int getTableSize(java.lang.String tableName)
                 throws StorageException
Throws:
StorageException

createDatabase

void createDatabase()
                    throws StorageException
Creates the necessary structures in the database.

Throws:
StorageException

getRootId

java.io.Serializable getRootId(java.io.Serializable repositoryId)
                               throws StorageException
Gets the root id for a given repository, if registered.

Parameters:
repositoryId - the repository id, usually 0
Returns:
the root id, or null if not found
Throws:
StorageException

setRootId

void setRootId(java.io.Serializable repositoryId,
               java.io.Serializable id)
               throws StorageException
Records the newly generated root id for a given repository.

Parameters:
repositoryId - the repository id, usually 0
id - the root id
Throws:
StorageException

getVersionIdByLabel

java.io.Serializable getVersionIdByLabel(java.io.Serializable versionSeriesId,
                                         java.lang.String label)
                                         throws StorageException
Gets the id of a version given a version series id and a label.

Parameters:
versionSeriesId - the version series id
label - the label
Returns:
the id of the version, or null if not found
Throws:
StorageException

getLastVersionId

java.io.Serializable getLastVersionId(java.io.Serializable versionSeriesId)
                                      throws StorageException
Gets the id of the last version given a version series id.

Parameters:
versionSeriesId - the version series id
Returns:
the id of the last version, or null if not found
Throws:
StorageException

query

PartialList<java.io.Serializable> query(java.lang.String query,
                                        QueryFilter queryFilter,
                                        boolean countTotal)
                                        throws StorageException
Makes a NXQL query to the database.

Parameters:
query - the query
queryFilter - the query filter
countTotal - if true, count the total size without limit/offset
Returns:
the list of matching document ids
Throws:
StorageException

queryAndFetch

IterableQueryResult queryAndFetch(java.lang.String query,
                                  java.lang.String queryType,
                                  QueryFilter queryFilter,
                                  java.lang.Object... params)
                                  throws StorageException
Makes a query to the database and returns an iterable (which must be closed when done).

Parameters:
query - the query
queryType - the query type
queryFilter - the query filter
params - optional query-type-dependent parameters
Returns:
an iterable, which must be closed when done
Throws:
StorageException

updateReadAcls

void updateReadAcls()
                    throws StorageException
Throws:
StorageException

rebuildReadAcls

void rebuildReadAcls()
                     throws StorageException
Throws:
StorageException

createClusterNode

void createClusterNode()
                       throws StorageException
Informs the cluster that this node exists.

Throws:
StorageException

removeClusterNode

void removeClusterNode()
                       throws StorageException
Removes this node from the cluster.

Throws:
StorageException

insertClusterInvalidations

void insertClusterInvalidations(Invalidations invalidations)
                                throws StorageException
Inserts the invalidation rows for the other cluster nodes.

Throws:
StorageException

getClusterInvalidations

Invalidations getClusterInvalidations()
                                      throws StorageException
Gets the invalidations from other cluster nodes.

Throws:
StorageException

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.