public class RepositoryHelper extends Object
Session instances.| Constructor and Description |
|---|
RepositoryHelper()
Creates a repository helper with configuration from
repositoryStubImpl.properties file. |
RepositoryHelper(Map config)
Creates a repository helper with additional configuration parameters.
|
| Modifier and Type | Method and Description |
|---|---|
Principal |
getKnownPrincipal(javax.jcr.Session session)
Returns a
Principal identifying a known user. |
String |
getProperty(String name)
Returns the value of the configuration property with specified
name. |
javax.jcr.Credentials |
getReadOnlyCredentials()
Returns the read-only credentials created from the username
and password specified in the configuration properties.
|
javax.jcr.Session |
getReadOnlySession()
Returns a
Session of the default workspace with read only
access to the workspace. |
javax.jcr.Session |
getReadOnlySession(String workspaceName)
Returns a
Session of the workspace with name
workspaceName with read only access to the workspace. |
javax.jcr.Credentials |
getReadWriteCredentials()
Returns the read-write credentials created from the username
and password specified in the configuration properties.
|
javax.jcr.Session |
getReadWriteSession()
Returns a
Session of the default workspace with read and
write access to the workspace. |
javax.jcr.Session |
getReadWriteSession(String workspaceName)
Returns a
Session of the workspace with name
workspaceName with read and write access to the workspace. |
javax.jcr.Repository |
getRepository()
Returns the repository instance to test.
|
javax.jcr.Credentials |
getSuperuserCredentials()
Returns the superuser credentials created from the username
and password specified in the configuration properties.
|
javax.jcr.Session |
getSuperuserSession()
Returns a superuser
Session of the default workspace. |
javax.jcr.Session |
getSuperuserSession(String workspaceName)
Returns a superuser
Session of the workspace with name
workspaceName. |
Principal |
getUnknownPrincipal(javax.jcr.Session session)
Returns a
Principal identifiying an unknown user. |
public RepositoryHelper()
repositoryStubImpl.properties file.public RepositoryHelper(Map config)
config - configuration which overlays the values from the property
file.public javax.jcr.Repository getRepository()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - if the repository could not be obtained.public javax.jcr.Session getSuperuserSession()
throws javax.jcr.RepositoryException
Session of the default workspace. The
returned Session has read and write access to the whole
workspace.Session.javax.jcr.RepositoryException - if login to the repository failed.public javax.jcr.Session getSuperuserSession(String workspaceName) throws javax.jcr.RepositoryException
Session of the workspace with name
workspaceName. The returned Session has read
and write access to the whole workspace.Session.javax.jcr.RepositoryException - if login to the repository failed.public javax.jcr.Session getReadWriteSession()
throws javax.jcr.RepositoryException
Session of the default workspace with read and
write access to the workspace.Session with read and write access.javax.jcr.RepositoryException - if login to the repository failed.public javax.jcr.Session getReadWriteSession(String workspaceName) throws javax.jcr.RepositoryException
Session of the workspace with name
workspaceName with read and write access to the workspace.Session with read and write access.javax.jcr.RepositoryException - if login to the repository failed.public javax.jcr.Session getReadOnlySession()
throws javax.jcr.RepositoryException
Session of the default workspace with read only
access to the workspace.Session with read only.javax.jcr.RepositoryException - if login to the repository failed.public javax.jcr.Session getReadOnlySession(String workspaceName) throws javax.jcr.RepositoryException
Session of the workspace with name
workspaceName with read only access to the workspace.Session with read only access.javax.jcr.RepositoryException - if login to the repository failed.public String getProperty(String name) throws javax.jcr.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.javax.jcr.RepositoryException - if the configuration file cannot be found.public javax.jcr.Credentials getReadOnlyCredentials()
repositoryStubImpl.properties.Credentialspublic javax.jcr.Credentials getReadWriteCredentials()
repositoryStubImpl.properties.Credentialspublic javax.jcr.Credentials getSuperuserCredentials()
repositoryStubImpl.properties.Credentialspublic Principal getKnownPrincipal(javax.jcr.Session session) throws javax.jcr.RepositoryException
Principal identifying a known user.session - javax.jcr.RepositoryExceptionpublic Principal getUnknownPrincipal(javax.jcr.Session session) throws NotExecutableException, javax.jcr.RepositoryException
Principal identifiying an unknown user.session - NotExecutableExceptionjavax.jcr.RepositoryExceptionCopyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.