Package org.hippoecm.repository
Interface HippoRepository
public interface HippoRepository
Instances of this class represent a connection to the Repository. This interface is mainly provided to add some
convenience methods, additional functionality and provide a basis for starting transactional access to the
repository. The primary usage is to use create an authenticated session which can be used to retrieve
and store data. For this usage, some convenience login() methods are accessible though this interface, but these
are essentially the same as implemented in the JSR-170 based JCR repository, as would be returned by the method
getRepository().
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the repository connection.Get the location where the repository stores information.Returns the JCR-170 compliant repository object in use.getRepositoryMap
(Node node) This call is not (yet) part of the API, but under evaluation.javax.transaction.UserTransaction
getUserTransaction
(Session session) Get a UserTransaction from the JTA transaction manager through JNDI.javax.transaction.UserTransaction
getUserTransaction
(javax.transaction.TransactionManager tm, Session session) Get a UserTransaction from the JTA transaction manager through JNDI.login()
Creates a new Session for the current user, which might involve opening an anonymous session.Creates a new Session for the user identifier with the indicated username and password.login
(Credentials credentials) Creates a new Session for the user identifier with the indicated credentials.login
(SimpleCredentials credentials) Deprecated.since 2.26.00 use #login(javax.jcr.Credentials) instead
-
Method Details
-
login
Creates a new Session for the current user, which might involve opening an anonymous session. If a user identity and credentials are available through the application container, then use JAAS to obtain the credentials and use login(SimpleCredentials).- Throws:
LoginException
RepositoryException
- See Also:
-
login
Creates a new Session for the user identifier with the indicated username and password.- Parameters:
username
- the username to use as part of the credentialspassword
- the password to use as part of the credentials- Throws:
LoginException
RepositoryException
- See Also:
-
login
Creates a new Session for the user identifier with the indicated credentials.- Throws:
LoginException
RepositoryException
- See Also:
-
login
Deprecated.since 2.26.00 use #login(javax.jcr.Credentials) insteadCreates a new Session for the user identifier with the indicated credentials.- Throws:
LoginException
RepositoryException
- See Also:
-
close
void close()Closes the repository connection. When the repository is running locally, this also involves shutting down the repository. -
getUserTransaction
javax.transaction.UserTransaction getUserTransaction(Session session) throws RepositoryException, javax.transaction.NotSupportedException Get a UserTransaction from the JTA transaction manager through JNDI.- Parameters:
session
- the session for which the transaction support is requested- Returns:
- a new JTA UserTransaction object
- Throws:
RepositoryException
- generic error such as a connection errorjavax.transaction.NotSupportedException
- indicates transactions are not supported in the set up
-
getUserTransaction
javax.transaction.UserTransaction getUserTransaction(javax.transaction.TransactionManager tm, Session session) throws javax.transaction.NotSupportedException Get a UserTransaction from the JTA transaction manager through JNDI.- Parameters:
tm
- the JTA transaction manager to usesession
- the JCR session for which to start the transaction- Returns:
- a new UserTransaction object
- Throws:
javax.transaction.NotSupportedException
- indicates transactions are not supported in the set up
-
getLocation
String getLocation()Get the location where the repository stores information.- Returns:
- the URL of direct file path which is used to store information by the repository.
-
getRepository
Repository getRepository()Returns the JCR-170 compliant repository object in use.- Returns:
- the JCR repository
-
getRepositoryMap
This call is not (yet) part of the API, but under evaluation. Returns a java.util.Map representation of the subtree starting with the indicated node in the repository.- Parameters:
node
- the starting node of the subtree to map as a java.util.Map- Returns:
- a map representation of the content in the repository
- Throws:
RepositoryException
- in case of a generic error occurs communicating with the repository
-