public class RepositorySessionManager extends BaseFacesSessionBean
Modifier and Type | Field and Description |
---|---|
protected javax.jcr.Credentials |
fCredentials
Holds reference to the user credentials.
|
protected javax.jcr.Session |
fCurrentSession
Holds the current JCR session
|
protected String |
fImpersonatedUser
Holds the id of the impersonated user
|
protected javax.jcr.Repository |
fRepository
Holds reference to the JCR Repository
|
protected String |
fRepositoryJNDIName
Holds the JNDI name to get a reference to the Repository
|
protected String |
fWorkspaceName
Holds the current workspace name
|
protected String |
fWorkspaceNameJNDIName
Holds the JNDI name of the workspace name
|
fExpireWithPageFlow
DATA_BINDING_CLIENTS, EMPTY_RESOURCES, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
Constructor and Description |
---|
RepositorySessionManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Overrides the default to logout the current JCR session
|
javax.jcr.Credentials |
getCredentials()
Return the credentials used to create a JCR session
|
javax.jcr.Session |
getCurrentSession()
Return the currently active session is it exists and is still live,
otherwise a new JCR session is created and returned.
|
String |
getImpersonatedUser()
Returns the user that the current session will impersonate
|
javax.jcr.Repository |
getRepository()
Get the handle to the repository by using a JNDI lookup
|
String |
refreshDiscardUnsaved()
This is a convenience method to expose the
Session.refresh(boolean) API
for use in a MethodBinding expression. |
String |
refreshKeepUnsaved()
This is a convenience method to expose the
Session.refresh(boolean) API
for use in a MethodBinding expression. |
protected void |
release()
Overrides the default to logout the current JCR session
|
String |
save()
This is a convenience method to expose the
Session.save() API
for use in a MethodBinding expression. |
void |
setCredentials(javax.jcr.Credentials credentials)
Sets the credentials to use
|
void |
setImpersonatedUser(String impersonatedUser)
Sets the user that the session will attempt to impersonate
|
String |
startNewSession()
This is a convenience method to throw away the current JCR session.
|
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound
createMethodBinding, createMethodExpression, createValueBinding, createValueExpression, createValueExpression, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue
protected String fRepositoryJNDIName
protected String fWorkspaceNameJNDIName
protected String fWorkspaceName
protected javax.jcr.Session fCurrentSession
protected String fImpersonatedUser
protected javax.jcr.Repository fRepository
protected javax.jcr.Credentials fCredentials
public javax.jcr.Repository getRepository()
public javax.jcr.Credentials getCredentials()
public void setCredentials(javax.jcr.Credentials credentials)
credentials
- the credentials to setpublic javax.jcr.Session getCurrentSession()
protected void release()
release
in class BaseFacesSessionBean
BaseFacesSessionBean.release()
protected void finalize() throws Throwable
finalize
in class Object
Throwable
Object.finalize()
public String startNewSession()
public String save()
Session.save()
API
for use in a MethodBinding expression. Any RepositoryException is caught
and exposed as a FacesMessage.public String refreshDiscardUnsaved()
Session.refresh(boolean)
API
for use in a MethodBinding expression. Any RepositoryException is caught
and exposed as a FacesMessage.
Refreshes the state in the current session. All unsaved transient
nodes/properties will be discarded.public String refreshKeepUnsaved()
Session.refresh(boolean)
API
for use in a MethodBinding expression. Any RepositoryException is caught
and exposed as a FacesMessage.
Refresh the state in the current session. All unsaved transient
nodes/properties will be preserved.public String getImpersonatedUser()
public void setImpersonatedUser(String impersonatedUser)
impersonatedUser
- the userid to impersonate