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:
Repository
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
close()
Closes the repository connection.String
getLocation()
Get the location where the repository stores information.Repository
getRepository()
Returns the JCR-170 compliant repository object in use.RepositoryMap
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.Session
login()
Creates a new Session for the current user, which might involve opening an anonymous session.Session
login(String username, char[] password)
Creates a new Session for the user identifier with the indicated username and password.Session
login(Credentials credentials)
Creates a new Session for the user identifier with the indicated credentials.Session
login(SimpleCredentials credentials)
Deprecated.since 2.26.00 use #login(javax.jcr.Credentials) instead
-
-
-
Method Detail
-
login
Session login() throws LoginException, RepositoryException
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:
Repository.login()
-
login
Session login(String username, char[] password) throws LoginException, RepositoryException
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:
Repository.login(javax.jcr.Credentials)
-
login
Session login(Credentials credentials) throws LoginException, RepositoryException
Creates a new Session for the user identifier with the indicated credentials.- Throws:
LoginException
RepositoryException
- See Also:
Repository.login(javax.jcr.Credentials)
-
login
@Deprecated Session login(SimpleCredentials credentials) throws LoginException, RepositoryException
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:
Repository.login(javax.jcr.Credentials)
-
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
RepositoryMap getRepositoryMap(Node node) throws RepositoryException
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
-
-