|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.test.RepositoryHelper
public class RepositoryHelper
Utility class to get access to Session
instances.
Constructor Summary | |
---|---|
RepositoryHelper()
Creates a repository helper with configuration from repositoryStubImpl.properties file. |
|
RepositoryHelper(Map config)
Creates a repository helper with additional configuration parameters. |
Method Summary | |
---|---|
Principal |
getKnownPrincipal(Session session)
Returns a Principal identifiying a known user. |
String |
getProperty(String name)
Returns the value of the configuration property with specified name . |
Credentials |
getReadOnlyCredentials()
Returns the read-only credentials created from the username and password specified in the configuration properties. |
Session |
getReadOnlySession()
Returns a Session of the default workspace with read only
access to the workspace. |
Session |
getReadOnlySession(String workspaceName)
Returns a Session of the workspace with name
workspaceName with read only access to the workspace. |
Credentials |
getReadWriteCredentials()
Returns the read-write credentials created from the username and password specified in the configuration properties. |
Session |
getReadWriteSession()
Returns a Session of the default workspace with read and
write access to the workspace. |
Session |
getReadWriteSession(String workspaceName)
Returns a Session of the workspace with name
workspaceName with read and write access to the workspace. |
Repository |
getRepository()
Returns the repository instance to test. |
Credentials |
getSuperuserCredentials()
Returns the superuser credentials created from the username and password specified in the configuration properties. |
Session |
getSuperuserSession()
Returns a superuser Session of the default workspace. |
Session |
getSuperuserSession(String workspaceName)
Returns a superuser Session of the workspace with name
workspaceName . |
Principal |
getUnknownPrincipal(Session session)
Returns a Principal identifiying an unknown user. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RepositoryHelper()
repositoryStubImpl.properties
file.
public RepositoryHelper(Map config)
config
- configuration which overlays the values from the property
file.Method Detail |
---|
public Repository getRepository() throws RepositoryException
RepositoryException
- if the repository could not be obtained.public Session getSuperuserSession() throws RepositoryException
Session
of the default workspace. The
returned Session
has read and write access to the whole
workspace.
Session
.
RepositoryException
- if login to the repository failed.public Session getSuperuserSession(String workspaceName) throws RepositoryException
Session
of the workspace with name
workspaceName
. The returned Session
has read
and write access to the whole workspace.
Session
.
RepositoryException
- if login to the repository failed.public Session getReadWriteSession() throws RepositoryException
Session
of the default workspace with read and
write access to the workspace.
Session
with read and write access.
RepositoryException
- if login to the repository failed.public Session getReadWriteSession(String workspaceName) throws RepositoryException
Session
of the workspace with name
workspaceName
with read and write access to the workspace.
Session
with read and write access.
RepositoryException
- if login to the repository failed.public Session getReadOnlySession() throws RepositoryException
Session
of the default workspace with read only
access to the workspace.
Session
with read only.
RepositoryException
- if login to the repository failed.public Session getReadOnlySession(String workspaceName) throws RepositoryException
Session
of the workspace with name
workspaceName
with read only access to the workspace.
Session
with read only access.
RepositoryException
- if login to the repository failed.public String getProperty(String name) throws RepositoryException
name
. If the property does not exist null
is
returned.
Configuration properties are defined in the file:
repositoryStubImpl.properties
.
name
- the name of the property to retrieve.
null
if non existent.
RepositoryException
- if the configuration file cannot be found.public Credentials getReadOnlyCredentials()
repositoryStubImpl.properties
.
Credentials
public Credentials getReadWriteCredentials()
repositoryStubImpl.properties
.
Credentials
public Credentials getSuperuserCredentials()
repositoryStubImpl.properties
.
Credentials
public Principal getKnownPrincipal(Session session) throws RepositoryException
Principal
identifiying a known user.
session
-
RepositoryException
public Principal getUnknownPrincipal(Session session) throws NotExecutableException, RepositoryException
Principal
identifiying an unknown user.
session
-
NotExecutableException
RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |