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.javax.jcr.Repository
getRepository()
Returns the JCR-170 compliant repository object in use.RepositoryMap
getRepositoryMap(javax.jcr.Node node)
This call is not (yet) part of the API, but under evaluation.javax.transaction.UserTransaction
getUserTransaction(javax.jcr.Session session)
Get a UserTransaction from the JTA transaction manager through JNDI.javax.transaction.UserTransaction
getUserTransaction(javax.transaction.TransactionManager tm, javax.jcr.Session session)
Get a UserTransaction from the JTA transaction manager through JNDI.javax.jcr.Session
login()
Creates a new Session for the current user, which might involve opening an anonymous session.javax.jcr.Session
login(String username, char[] password)
Creates a new Session for the user identifier with the indicated username and password.javax.jcr.Session
login(javax.jcr.Credentials credentials)
Creates a new Session for the user identifier with the indicated credentials.javax.jcr.Session
login(javax.jcr.SimpleCredentials credentials)
Deprecated.since 2.26.00 use #login(javax.jcr.Credentials) instead
-
-
-
Method Detail
-
login
javax.jcr.Session login() throws javax.jcr.LoginException, javax.jcr.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:
javax.jcr.LoginException
javax.jcr.RepositoryException
- See Also:
Repository.login()
-
login
javax.jcr.Session login(String username, char[] password) throws javax.jcr.LoginException, javax.jcr.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:
javax.jcr.LoginException
javax.jcr.RepositoryException
- See Also:
Repository.login(javax.jcr.Credentials)
-
login
javax.jcr.Session login(javax.jcr.Credentials credentials) throws javax.jcr.LoginException, javax.jcr.RepositoryException
Creates a new Session for the user identifier with the indicated credentials.- Throws:
javax.jcr.LoginException
javax.jcr.RepositoryException
- See Also:
Repository.login(javax.jcr.Credentials)
-
login
@Deprecated javax.jcr.Session login(javax.jcr.SimpleCredentials credentials) throws javax.jcr.LoginException, javax.jcr.RepositoryException
Deprecated.since 2.26.00 use #login(javax.jcr.Credentials) insteadCreates a new Session for the user identifier with the indicated credentials.- Throws:
javax.jcr.LoginException
javax.jcr.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(javax.jcr.Session session) throws javax.jcr.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:
javax.jcr.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, javax.jcr.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
javax.jcr.Repository getRepository()
Returns the JCR-170 compliant repository object in use.- Returns:
- the JCR repository
-
getRepositoryMap
RepositoryMap getRepositoryMap(javax.jcr.Node node) throws javax.jcr.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:
javax.jcr.RepositoryException
- in case of a generic error occurs communicating with the repository
-
-