public class RepositoryImpl extends Object implements Repository
Repository
implementation, to be extended by backend-specific initialization code.RepositoryBackend
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
RepositoryImpl.SessionPathResolver |
Modifier and Type | Field and Description |
---|---|
protected Class<? extends FulltextParser> |
fulltextParserClass |
protected InvalidationsPropagator |
invalidationsPropagator
Propagator of invalidations to all mappers' caches.
|
protected com.codahale.metrics.MetricRegistry |
registry |
protected RepositoryDescriptor |
repositoryDescriptor |
String |
repositoryId
Transient id for this repository assigned by the server on first connection.
|
protected com.codahale.metrics.Counter |
repositoryUp |
protected boolean |
selfRegisteredLockManager |
protected com.codahale.metrics.Counter |
sessionCount |
Constructor and Description |
---|
RepositoryImpl(RepositoryDescriptor repositoryDescriptor) |
Modifier and Type | Method and Description |
---|---|
int |
cleanupDeletedDocuments(int max,
Calendar beforeTime)
Cleans up (hard-deletes) any documents that have been soft-deleted in the database.
|
int |
clearCaches()
Clears all the caches.
|
void |
close()
Closes the repository and release all resources.
|
protected void |
closeAllSessions() |
protected void |
closeSession(SessionImpl session) |
protected RepositoryBackend |
createBackend() |
protected Mapper |
createCachingMapper(Model model,
Mapper mapper) |
protected ClusterInvalidator |
createClusterInvalidator() |
protected void |
createMetricsGauges() |
int |
getActiveSessionsCount()
Gets the number of active sessions.
|
long |
getCacheMapperSize() |
long |
getCachePristineSize()
Evaluate number of elements in hier cache
|
long |
getCacheSelectionSize()
Evaluate number of elements in selection cache
|
long |
getCacheSize()
Evaluate number of elements in all caches
|
protected Class<? extends CachingMapper> |
getCachingMapperClass() |
SessionImpl |
getConnection()
Gets a new connection.
|
SessionImpl |
getConnection(javax.resource.cci.ConnectionSpec connectionSpec)
Gets a new connection.
|
Class<? extends FulltextParser> |
getFulltextParserClass() |
InvalidationsPropagator |
getInvalidationsPropagator() |
LockManager |
getLockManager() |
protected String |
getLockManagerName() |
javax.resource.cci.ResourceAdapterMetaData |
getMetaData() |
Model |
getModel() |
String |
getName()
Gets the repository name.
|
javax.resource.cci.RecordFactory |
getRecordFactory() |
Reference |
getReference() |
RepositoryDescriptor |
getRepositoryDescriptor() |
protected void |
initClusterInvalidator() |
protected void |
initLockManager() |
protected void |
initRepository() |
boolean |
isChangeTokenEnabled() |
void |
markReferencedBinaries()
Marks the binaries in use by passing them to the binary manager(s)'s GC mark() method.
|
Mapper |
newMapper(Session.PathResolver pathResolver,
boolean useInvalidations)
Creates a new mapper.
|
protected SessionImpl |
newSession(Model model,
Mapper mapper) |
void |
processClusterInvalidationsNext()
Makes sure that the next transaction will process cluster invalidations.
|
void |
setReference(Reference reference) |
protected final RepositoryDescriptor repositoryDescriptor
protected final Class<? extends FulltextParser> fulltextParserClass
protected final com.codahale.metrics.MetricRegistry registry
protected final com.codahale.metrics.Counter repositoryUp
protected final com.codahale.metrics.Counter sessionCount
protected boolean selfRegisteredLockManager
protected final InvalidationsPropagator invalidationsPropagator
public String repositoryId
public RepositoryImpl(RepositoryDescriptor repositoryDescriptor)
protected void createMetricsGauges()
protected RepositoryBackend createBackend()
protected Mapper createCachingMapper(Model model, Mapper mapper)
protected Class<? extends CachingMapper> getCachingMapperClass()
public RepositoryDescriptor getRepositoryDescriptor()
public LockManager getLockManager()
public InvalidationsPropagator getInvalidationsPropagator()
public Class<? extends FulltextParser> getFulltextParserClass()
public boolean isChangeTokenEnabled()
public SessionImpl getConnection(javax.resource.cci.ConnectionSpec connectionSpec)
getConnection
in interface javax.resource.cci.ConnectionFactory
getConnection
in interface Repository
connectionSpec
- the parameters to use to connect (unused)public SessionImpl getConnection()
getConnection
in interface javax.resource.cci.ConnectionFactory
getConnection
in interface Repository
public Mapper newMapper(Session.PathResolver pathResolver, boolean useInvalidations)
pathResolver
- the path resolver (for regular mappers)useInvalidations
- whether this mapper participates in invalidation propagation (false for lock manager /
cluster invalidator)protected void initRepository()
protected String getLockManagerName()
protected void initLockManager()
protected void initClusterInvalidator()
protected ClusterInvalidator createClusterInvalidator()
protected SessionImpl newSession(Model model, Mapper mapper)
public javax.resource.cci.ResourceAdapterMetaData getMetaData()
getMetaData
in interface javax.resource.cci.ConnectionFactory
public javax.resource.cci.RecordFactory getRecordFactory()
getRecordFactory
in interface javax.resource.cci.ConnectionFactory
public void setReference(Reference reference)
public Reference getReference()
getReference
in interface Referenceable
public void close()
Repository
close
in interface Repository
protected void closeAllSessions()
public String getName()
RepositoryManagement
getName
in interface RepositoryManagement
public int getActiveSessionsCount()
RepositoryManagement
getActiveSessionsCount
in interface RepositoryManagement
public int clearCaches()
RepositoryManagement
clearCaches
in interface RepositoryManagement
public long getCacheSize()
RepositoryManagement
getCacheSize
in interface RepositoryManagement
public long getCacheMapperSize()
public long getCachePristineSize()
RepositoryManagement
getCachePristineSize
in interface RepositoryManagement
public long getCacheSelectionSize()
RepositoryManagement
getCacheSelectionSize
in interface RepositoryManagement
public void processClusterInvalidationsNext()
RepositoryManagement
processClusterInvalidationsNext
in interface RepositoryManagement
public void markReferencedBinaries()
RepositoryManagement
markReferencedBinaries
in interface RepositoryManagement
public int cleanupDeletedDocuments(int max, Calendar beforeTime)
RepositoryManagement
cleanupDeletedDocuments
in interface RepositoryManagement
max
- the maximum number of documents to delete at a timebeforeTime
- the maximum deletion time of the documents to deleteprotected void closeSession(SessionImpl session)
Copyright © 2017 Nuxeo. All rights reserved.