public interface Mapper extends RowMapper, XAResource
Modifier and Type | Interface and Description |
---|---|
static class |
Mapper.Identification
Identifiers assigned by a server to identify a client mapper and its repository.
|
RowMapper.CopyResult, RowMapper.IdWithTypes, RowMapper.NodeInfo, RowMapper.RowBatch, RowMapper.RowUpdate
Modifier and Type | Field and Description |
---|---|
static String |
CLOSE |
static String |
GET_IDENTIFICATION |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
Modifier and Type | Method and Description |
---|---|
int |
cleanupDeletedRows(int max,
Calendar beforeTime)
Cleans up (hard-delete) any rows that have been soft-deleted in the database.
|
void |
close() |
void |
connect() |
String |
createClusterNode()
Informs the cluster that this node exists.
|
void |
createDatabase()
Creates the necessary structures in the database.
|
void |
disconnect() |
Set<Serializable> |
getAncestorsIds(Collection<Serializable> ids)
Gets the ids for all the ancestors of the given row ids.
|
Invalidations |
getClusterInvalidations(String nodeId)
Gets the invalidations from other cluster nodes.
|
Mapper.Identification |
getIdentification()
Returns the repository id and mapper id assigned.
|
Lock |
getLock(Serializable id)
Gets the lock state of a document.
|
Serializable |
getRootId(String repositoryId)
Gets the root id for a given repository, if registered.
|
int |
getTableSize(String tableName) |
void |
insertClusterInvalidations(Invalidations invalidations,
String nodeId)
Inserts the invalidation rows for the other cluster nodes.
|
boolean |
isConnected() |
void |
markReferencedBinaries(BinaryGarbageCollector gc)
Marks the binaries referenced by this mapper with the referenced binary garbage collector.
|
PartialList<Serializable> |
query(String query,
String queryType,
QueryFilter queryFilter,
boolean countTotal)
Makes a NXQL query to the database.
|
PartialList<Serializable> |
query(String query,
String queryType,
QueryFilter queryFilter,
long countUpTo)
Makes a NXQL query to the database.
|
IterableQueryResult |
queryAndFetch(String query,
String queryType,
QueryFilter queryFilter,
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.
|
Lock |
removeLock(Serializable id,
String owner,
boolean force)
Removes a lock from a document.
|
Lock |
setLock(Serializable id,
Lock lock)
Sets a lock on a document.
|
void |
setRootId(Serializable repositoryId,
Serializable id)
Records the newly generated root id for a given repository.
|
void |
updateReadAcls() |
clearCache, copy, generateNewId, getBinaryFulltext, getCacheSize, read, readCollectionRowArray, readSelectionRows, readSimpleRow, receiveInvalidations, remove, rollback, sendInvalidations, write
commit, end, forget, getTransactionTimeout, isSameRM, prepare, recover, rollback, setTransactionTimeout, start
static final String GET_IDENTIFICATION
static final String CLOSE
Mapper.Identification getIdentification() throws StorageException
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.
StorageException
- when initial connection failed (for a NetMapper)void close() throws StorageException
StorageException
int getTableSize(String tableName) throws StorageException
StorageException
void createDatabase() throws StorageException
StorageException
Serializable getRootId(String repositoryId) throws StorageException
repositoryId
- the repository idStorageException
void setRootId(Serializable repositoryId, Serializable id) throws StorageException
repositoryId
- the repository id, usually 0id
- the root idStorageException
PartialList<Serializable> query(String query, String queryType, QueryFilter queryFilter, boolean countTotal) throws StorageException
query
- the queryquery
- the query typequeryFilter
- the query filtercountTotal
- if true
, count the total size without limit/offsetStorageException
PartialList<Serializable> query(String query, String queryType, QueryFilter queryFilter, long countUpTo) throws StorageException
query
- the queryquery
- the query typequeryFilter
- the query filtercountUpTo
- if -1
, count the total size without offset/limit.0
, don't count the total size.n
, count the total number if there are less than n documents otherwise set the size to
-1
.StorageException
IterableQueryResult queryAndFetch(String query, String queryType, QueryFilter queryFilter, Object... params) throws StorageException
query
- the queryqueryType
- the query typequeryFilter
- the query filterparams
- optional query-type-dependent parametersStorageException
Set<Serializable> getAncestorsIds(Collection<Serializable> ids) throws StorageException
ids
- the idsStorageException
void updateReadAcls() throws StorageException
StorageException
void rebuildReadAcls() throws StorageException
StorageException
String createClusterNode() throws StorageException
StorageException
void removeClusterNode() throws StorageException
StorageException
void insertClusterInvalidations(Invalidations invalidations, String nodeId) throws StorageException
StorageException
Invalidations getClusterInvalidations(String nodeId) throws StorageException
StorageException
Lock getLock(Serializable id) throws StorageException
If the document does not exist, null
is returned.
id
- the document idnull
when there is no lockStorageException
Lock setLock(Serializable id, Lock lock) throws StorageException
If the document is already locked, returns its existing lock status (there is no re-locking, removeLock(java.io.Serializable, java.lang.String, boolean)
must be called first).
id
- the document idlock
- the lock object to setnull
if locking succeeded, or the existing lock if locking failed, or aStorageException
Lock removeLock(Serializable id, String owner, boolean force) throws StorageException
The previous lock is returned.
If owner
is null
then the lock is unconditionally removed.
If owner
is not null
, it must match the existing lock owner for the lock to be removed. If it
doesn't match, the returned lock will return true
for Lock.getFailed()
.
id
- the document idthe
- owner to check, or null
for no checkforce
- true
to just do the remove and not return the previous lockStorageException
void markReferencedBinaries(BinaryGarbageCollector gc) throws StorageException
gc
- the binary garbage collectorStorageException
int cleanupDeletedRows(int max, Calendar beforeTime) throws StorageException
max
- the maximum number of rows to delete at a timebeforeTime
- the maximum deletion time of the rows to deleteStorageException
boolean isConnected()
void connect() throws StorageException
StorageException
void disconnect()
Copyright © 2015 Nuxeo SA. All rights reserved.