|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.faces.bean.BaseFacesBean
com.webmethods.caf.faces.bean.BaseFacesSessionBean
com.webmethods.caf.jcr.faces.bean.RepositorySessionManager
public class RepositorySessionManager
Wrapper around a JCR session that takes care of cleaning up when the http session is invalidated. Also exposes a few JCR session methods in a JSF friendly way.
Field Summary | |
---|---|
protected Credentials |
fCredentials
Holds reference to the user credentials. |
protected Session |
fCurrentSession
Holds the current JCR session |
protected String |
fImpersonatedUser
Holds the id of the impersonated user |
protected 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 |
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean |
---|
fExpireWithPageFlow |
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesBean |
---|
DATA_BINDING_CLIENTS, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders |
Constructor Summary | |
---|---|
RepositorySessionManager()
|
Method Summary | |
---|---|
protected void |
finalize()
Overrides the default to logout the current JCR session |
Credentials |
getCredentials()
Return the credentials used to create a JCR session |
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 |
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(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. |
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean |
---|
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound |
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesBean |
---|
createMethodBinding, createValueBinding, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String fRepositoryJNDIName
protected String fWorkspaceNameJNDIName
protected String fWorkspaceName
protected Session fCurrentSession
protected String fImpersonatedUser
protected Repository fRepository
protected Credentials fCredentials
Constructor Detail |
---|
public RepositorySessionManager()
Method Detail |
---|
public Repository getRepository()
public Credentials getCredentials()
public void setCredentials(Credentials credentials)
credentials
- the credentials to setpublic 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |