Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.storage.sql
Class RepositoryImpl

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.RepositoryImpl
All Implemented Interfaces:
Serializable, Referenceable, ConnectionFactory, Repository, RepositoryManagement

public class RepositoryImpl
extends Object
implements Repository

Repository implementation, to be extended by backend-specific initialization code.

See Also:
RepositoryBackend, Serialized Form

Nested Class Summary
static class RepositoryImpl.SessionPathResolver
           
 
Field Summary
 String repositoryId
          Transient id for this repository assigned by the server on first connection.
static String RUNTIME_SERVER_HOST
           
static String SERVER_PATH_BINARY
           
static String SERVER_PATH_VCS
           
 
Constructor Summary
RepositoryImpl(RepositoryDescriptor repositoryDescriptor)
           
 
Method Summary
 void activateServer()
          Activates the VCS server used for remote connections.
 int clearCaches()
          Clears all the caches.
 void close()
          Closes the repository and release all resources.
 void deactivateServer()
          Deactivates the VCS server used for remote connections.
 int getActiveSessionsCount()
          Gets the number of active sessions.
 BinaryGarbageCollector getBinaryGarbageCollector()
          Gets the binary GC for this repository.
 BinaryManager getBinaryManager()
           
 Collection<MapperClientInfo> getClientInfos()
          Get info about current VCS server clients
 SessionImpl getConnection()
          Gets a new connection by logging in to the repository with default credentials.
 SessionImpl getConnection(ConnectionSpec connectionSpec)
          Gets a new connection by logging in to the repository with given connection information (credentials).
 HttpClient getHttpClient()
           
 LockManager getLockManager()
           
 ResourceAdapterMetaData getMetaData()
           
 String getName()
          Gets the repository name.
 RecordFactory getRecordFactory()
           
 Reference getReference()
           
 RepositoryDescriptor getRepositoryDescriptor()
           
 String getServerURL()
          Which is the remote location ? TODO this info would be better served by a provisioning service.
 boolean isServerActivated()
          Is the server available remotely ?
 void markReferencedBinaries(BinaryGarbageCollector gc)
          Marks the binaries actually in use with the GC so that they won't be deleted.
 void processClusterInvalidationsNext()
          Makes sure that the next transaction will process cluster invalidations.
 void setReference(Reference reference)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RUNTIME_SERVER_HOST

public static final String RUNTIME_SERVER_HOST
See Also:
Constant Field Values

SERVER_PATH_VCS

public static final String SERVER_PATH_VCS
See Also:
Constant Field Values

SERVER_PATH_BINARY

public static final String SERVER_PATH_BINARY
See Also:
Constant Field Values

repositoryId

public String repositoryId
Transient id for this repository assigned by the server on first connection. This is not persisted.

Constructor Detail

RepositoryImpl

public RepositoryImpl(RepositoryDescriptor repositoryDescriptor)
               throws StorageException
Throws:
StorageException
Method Detail

getHttpClient

public HttpClient getHttpClient()

isServerActivated

public boolean isServerActivated()
Description copied from interface: RepositoryManagement
Is the server available remotely ?

Specified by:
isServerActivated in interface RepositoryManagement

getServerURL

public String getServerURL()
Description copied from interface: RepositoryManagement
Which is the remote location ? TODO this info would be better served by a provisioning service. The remote location is dependent to the context of access.

Specified by:
getServerURL in interface RepositoryManagement

activateServer

public void activateServer()
Description copied from interface: RepositoryManagement
Activates the VCS server used for remote connections.

Specified by:
activateServer in interface RepositoryManagement

deactivateServer

public void deactivateServer()
Description copied from interface: RepositoryManagement
Deactivates the VCS server used for remote connections.

Specified by:
deactivateServer in interface RepositoryManagement

getClientInfos

public Collection<MapperClientInfo> getClientInfos()
Description copied from interface: RepositoryManagement
Get info about current VCS server clients

Specified by:
getClientInfos in interface RepositoryManagement

getRepositoryDescriptor

public RepositoryDescriptor getRepositoryDescriptor()

getBinaryManager

public BinaryManager getBinaryManager()

getLockManager

public LockManager getLockManager()

getConnection

public SessionImpl getConnection()
                          throws StorageException
Gets a new connection by logging in to the repository with default credentials.

Specified by:
getConnection in interface ConnectionFactory
Specified by:
getConnection in interface Repository
Returns:
the session
Throws:
StorageException

getConnection

public SessionImpl getConnection(ConnectionSpec connectionSpec)
                          throws StorageException
Gets a new connection by logging in to the repository with given connection information (credentials).

Specified by:
getConnection in interface ConnectionFactory
Specified by:
getConnection in interface Repository
Parameters:
connectionSpec - the parameters to use to connnect
Returns:
the session
Throws:
StorageException

getMetaData

public ResourceAdapterMetaData getMetaData()
Specified by:
getMetaData in interface ConnectionFactory

getRecordFactory

public RecordFactory getRecordFactory()
Specified by:
getRecordFactory in interface ConnectionFactory

setReference

public void setReference(Reference reference)

getReference

public Reference getReference()
Specified by:
getReference in interface Referenceable

close

public void close()
           throws StorageException
Description copied from interface: Repository
Closes the repository and release all resources.

Specified by:
close in interface Repository
Throws:
StorageException

getName

public String getName()
Description copied from interface: RepositoryManagement
Gets the repository name.

Specified by:
getName in interface RepositoryManagement

getActiveSessionsCount

public int getActiveSessionsCount()
Description copied from interface: RepositoryManagement
Gets the number of active sessions.

Specified by:
getActiveSessionsCount in interface RepositoryManagement

clearCaches

public int clearCaches()
Description copied from interface: RepositoryManagement
Clears all the caches.

Specified by:
clearCaches in interface RepositoryManagement
Returns:
an indicative count of objects removed

processClusterInvalidationsNext

public void processClusterInvalidationsNext()
Description copied from interface: RepositoryManagement
Makes sure that the next transaction will process cluster invalidations.

Specified by:
processClusterInvalidationsNext in interface RepositoryManagement

getBinaryGarbageCollector

public BinaryGarbageCollector getBinaryGarbageCollector()
Description copied from interface: RepositoryManagement
Gets the binary GC for this repository.

Specified by:
getBinaryGarbageCollector in interface RepositoryManagement
Returns:
the binary garbage collector

markReferencedBinaries

public void markReferencedBinaries(BinaryGarbageCollector gc)
Description copied from interface: RepositoryManagement
Marks the binaries actually in use with the GC so that they won't be deleted.

The passed GC may or may not be the one returned by RepositoryManagement.getBinaryGarbageCollector() in case it's been determined that another repository's GC is pointing to the same binary data.

Specified by:
markReferencedBinaries in interface RepositoryManagement
Parameters:
gc - the binary garbage collector to use for this repository's binaries

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.