public class SessionFactory extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
SessionFactory.Prefix |
Constructor and Description |
---|
SessionFactory()
Default constructor
|
SessionFactory(javax.jcr.Repository repo,
TransactionService transactionService)
Initialize a session factory for the given Repository
|
Modifier and Type | Method and Description |
---|---|
protected javax.jcr.Session |
createSession(javax.servlet.http.HttpServletRequest servletRequest)
Create a JCR session for the given HTTP servlet request with a
SecurityContext attached.
|
protected String |
getEmbeddedId(javax.servlet.http.HttpServletRequest servletRequest,
SessionFactory.Prefix prefix)
Extract the id embedded at the beginning of a request path
|
javax.jcr.Session |
getInternalSession()
Get a new JCR Session
|
javax.jcr.Session |
getSession(javax.servlet.http.HttpServletRequest servletRequest)
Get a JCR session for the given HTTP servlet request with a
SecurityContext attached
|
protected javax.jcr.Session |
getSessionFromTransaction(javax.servlet.http.HttpServletRequest servletRequest,
String txId)
Retrieve a JCR session from an active transaction
|
void |
init()
Validate the spring wiring
|
public SessionFactory()
public SessionFactory(javax.jcr.Repository repo, TransactionService transactionService)
repo
- the repositorytransactionService
- the transaction service@PostConstruct public void init()
public javax.jcr.Session getInternalSession()
public javax.jcr.Session getSession(javax.servlet.http.HttpServletRequest servletRequest)
servletRequest
- the servlet requestRuntimeException
- if the transaction could not be foundprotected javax.jcr.Session createSession(javax.servlet.http.HttpServletRequest servletRequest) throws javax.jcr.RepositoryException
servletRequest
- the servlet requestjavax.jcr.RepositoryException
- if the session could not be createdprotected javax.jcr.Session getSessionFromTransaction(javax.servlet.http.HttpServletRequest servletRequest, String txId)
servletRequest
- the servlet requesttxId
- the transaction idprotected String getEmbeddedId(javax.servlet.http.HttpServletRequest servletRequest, SessionFactory.Prefix prefix)
servletRequest
- the servlet requestprefix
- the prefix for the idCopyright © 2013–2016 DuraSpace, Inc.. All rights reserved.