|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.TransientRepository
public class TransientRepository
A repository proxy that automatically initializes and shuts down the underlying repository instance when the first session is opened or the last one closed. As long as all sessions are properly closed when no longer used, this class can be used to avoid having to explicitly shut down the repository.
| Nested Class Summary | |
|---|---|
static interface |
TransientRepository.RepositoryFactory
Factory interface for creating RepositoryImpl instances. |
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
TransientRepository()
Creates a transient repository proxy that will use the repository configuration file and home directory specified in system properties org.apache.jackrabbit.repository.conf and
org.apache.jackrabbit.repository.home. |
|
TransientRepository(File dir)
Creates a transient repository proxy based on the given repository home directory and the repository configuration file "repository.xml" contained in that directory. |
|
TransientRepository(File xml,
File dir)
Creates a transient repository proxy that will use the given repository configuration file and home directory paths to initialize the underlying repository instances. |
|
TransientRepository(RepositoryConfig config)
Creates a transient repository proxy that will use the given repository configuration to initialize the underlying repository instance. |
|
TransientRepository(String config,
String home)
Creates a transient repository proxy that will use the given repository configuration file and home directory paths to initialize the underlying repository instances. |
|
TransientRepository(TransientRepository.RepositoryFactory factory)
Creates a transient repository proxy that will use the given repository factory to initialize the underlying repository instances. |
|
| Method Summary | |
|---|---|
String |
getDescriptor(String key)
Returns the identified repository descriptor. |
String[] |
getDescriptorKeys()
Returns the available descriptor keys. |
Value |
getDescriptorValue(String key)
The value of a single-value descriptor is found by passing the key for that descriptor to this method. |
Value[] |
getDescriptorValues(String key)
The value array of a multi-value descriptor is found by passing the key for that descriptor to this method. |
boolean |
isSingleValueDescriptor(String key)
Returns true if key is a valid single-value
descriptor; otherwise returns false. |
boolean |
isStandardDescriptor(String key)
Returns true if key is a standard descriptor
defined by the string constants in this interface and false
if it is either a valid implementation-specific key or not a valid key. |
void |
loggedOut(SessionImpl session)
Removes the given session from the set of open sessions. |
void |
loggingOut(SessionImpl session)
Ignored. |
Session |
login()
Calls login(Credentials, String) with null login
credentials and a null workspace name. |
Session |
login(Credentials credentials)
Calls login(Credentials, String) with a null
workspace name. |
Session |
login(Credentials credentials,
String workspaceName)
Logs in to the content repository. |
Session |
login(String workspaceName)
Calls login(Credentials, String) with null login
credentials. |
void |
shutdown()
Forces all active sessions to logout. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransientRepository(TransientRepository.RepositoryFactory factory)
factory - repository factory
public TransientRepository()
throws IOException
org.apache.jackrabbit.repository.conf and
org.apache.jackrabbit.repository.home. If these properties
are not found, then the default values "repository.xml"
and "repository" are used.
IOException - not thrown, to be removed in Jackrabbit 2.0
public TransientRepository(RepositoryConfig config)
throws IOException
config - repository configuration
IOException - not thrown, to be removed in Jackrabbit 2.0
public TransientRepository(String config,
String home)
throws IOException
config - repository configuration filehome - repository home directory
IOException - not thrown, to be removed in Jackrabbit 2.0TransientRepository(File, File)public TransientRepository(File dir)
dir - repository home directory
public TransientRepository(File xml,
File dir)
If the given repository configuration file does not exist, then a default configuration file is copied to the given location when the first session starts. Similarly, if the given repository home directory does not exist, it is automatically created when the first session starts. This is a convenience feature designed to reduce the need for manual configuration.
xml - repository configuration filedir - repository home directory| Method Detail |
|---|
public String[] getDescriptorKeys()
getDescriptorKeys in interface RepositoryRepository#getDescriptorKeys()public String getDescriptor(String key)
getDescriptor in interface Repositorykey - descriptor key
Repository#getDescriptor(String)
public Session login(Credentials credentials,
String workspaceName)
throws RepositoryException
login in interface Repositorycredentials - login credentialsworkspaceName - workspace name
RepositoryException - if the session could not be createdRepository#login(Credentials,String)
public Session login(Credentials credentials)
throws RepositoryException
login(Credentials, String) with a null
workspace name.
login in interface Repositorycredentials - login credentials
RepositoryException - if the session could not be createdRepository#login(Credentials)
public Session login(String workspaceName)
throws RepositoryException
login(Credentials, String) with null login
credentials.
login in interface RepositoryworkspaceName - workspace name
RepositoryException - if the session could not be createdRepository#login(String)
public Session login()
throws RepositoryException
login(Credentials, String) with null login
credentials and a null workspace name.
login in interface RepositoryRepositoryException - if the session could not be createdRepository#login(Credentials)public Value getDescriptorValue(String key)
Repositorykey is the key of a
multi-value descriptor or not a valid key this method returns
null.
key - a descriptor key.
public Value[] getDescriptorValues(String key)
Repositorykey is the key of a
single-value descriptor then this method returns that value as an array
of size one. If key is not a valid key this method returns
null.
key - a descriptor key.
public boolean isSingleValueDescriptor(String key)
Repositorytrue if key is a valid single-value
descriptor; otherwise returns false.
key - a descriptor key.
public boolean isStandardDescriptor(String key)
Repositorytrue if key is a standard descriptor
defined by the string constants in this interface and false
if it is either a valid implementation-specific key or not a valid key.
key - a descriptor key.
key is a standard descriptor.public void shutdown()
shutdown in interface JackrabbitRepositorySession.logout()public void loggedOut(SessionImpl session)
loggedOut in interface SessionListenersession - closed sessionSessionListener.loggedOut(SessionImpl)public void loggingOut(SessionImpl session)
Session is about to be 'closed' by
calling Session.logout()
- Specified by:
loggingOut in interface SessionListener
- Parameters:
session - the Session that is about to be 'closed'
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||