|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.schemedit.SessionBean
public class SessionBean
A Session-scoped Bean for information that needs to be available to different controllers and their jsp pages. Encapsulates access to servlet context attributes as well as session scope attributes, and provides other session-oriented services, such as
getLock(String)
), and getPaigingParam()
)SessionRegistry
. Because they are
bound to the session context, SessionBeans are available to jsp pages.This class aims as much as possible to be a read-only structure that gets information from the application's form beans which are accessed via the session.
A tricky aspect of accessing Session attributes is that the session can be
invalidated at any time (e.g., when a session times out). Thus, accesses to
session attributes must be wrapped in a try statement that can catch a
IllegalStateException exception. When such an exception is encountered, the
SessionBean instance is destroyed
. As a HttpSessionBindingListener, receives notification when
attributes are bound to, or removed from, the session context.
Nested Class Summary | |
---|---|
static class |
SessionBean.IdComparator
Implements Comparator to enable sorting by session id. |
static class |
SessionBean.IdleTimeComparator
Implements Comparator to enable sorting SessionBeans by their sessions idle time |
Field Summary | |
---|---|
List |
creators
|
static String |
DEFAULT_REC_SORT
Specifies the default sort order for display of records. |
List |
editors
|
List |
indexedFormats
|
Constructor Summary | |
---|---|
SessionBean()
Argumentless Constructor for the SessionBean object. |
|
SessionBean(HttpSession session,
ServletContext servletContext)
Constructor for the SessionBean object |
Method Summary | |
---|---|
void |
clearSearchParams()
Wipes out information about the last search. |
void |
destroy()
Description of the Method |
List |
getAuthorizedCollections()
Get the keys of the collections the sessionUser is authorized to access. |
boolean |
getBatchLocks(RecordList records)
|
CollectionConfig |
getCollectionConfig(String collection)
Gets the collectionConfig attribute of the SessionBean object |
long |
getCollectionConfigMod()
|
org.apache.struts.util.LabelValueBean |
getCollectionFilter()
|
List |
getCollectionLabelValues()
Generate list of collections for use by jsp tags. |
CollectionRegistry |
getCollectionRegistry()
Gets the collectionRegistry attribute of the SessionBean object |
String |
getCollectionsQueryClause()
Return a query clause ORing together all the collections the current user is authorized to search over. |
List |
getCreators()
|
DcsDataRecord |
getDcsDataRecord(String id)
Get DcsDataRecord for the given id via the DcsDataManager |
List |
getEditors()
|
RecordList |
getFailedBatchLocks()
List of ids to records that could not be locked during getBatchLocks. |
String |
getFinalStatusLabel(String collection)
Gets the finalStatusLabel attribute of the SessionBean object |
String |
getId()
Gets the id of this session. |
String |
getInactiveIntervalRemaining()
Gets the inactiveIntervalRemaining attribute of the SessionBean object |
List |
getIndexedFormats()
|
long |
getIndexLastModified()
|
String |
getIp()
Gets the ip attribute of the SessionBean object |
Date |
getLastAccessedTime()
Gets the lastAccessedTime attribute of the session as a Date. |
boolean |
getLock(String recId)
Locks a record for this session through a call to SessionRegistry.getLock(String, String) . |
List |
getLockedRecords()
Gets the records locked by this session. |
int |
getNumSecsToTimeout()
Returns the number of seconds left until this session times out. |
int |
getPaigingParam()
Compute the start record index of the page on which the current record (recIndex) will be found. |
int |
getPaigingParam(String id)
Compute the start record index of the page on which the specified record will be found. |
String |
getQueryUrl()
Returns the url (decoded to preserve query string) that will reproduce the last query preformed on the search page. |
String |
getRecId()
Gets the recId attribute of the SessionBean object, which keeps track of the record the user has last edited so that particular record can be highlighted in lists of records. |
RecordList |
getRecords()
Provides access to current set of search results, which is updated by DCSQueryAction, but needed by other actions that need to operate over the results (e.g., BatchOperationsAction ). |
HttpServletRequest |
getRequest()
get the last request for this session - NOT currently used |
RoleManager |
getRoleManager()
Gets the roleManager attribute of the SessionBean object |
SearchHelper |
getSearchHelper()
|
String |
getSearchParams()
A string representation (http request's query parameters) of the last search performed by the user. |
List |
getServletContextAttributeNames()
Gets the AttributeNames defined in the servlet Context. |
HttpSession |
getSession()
Gets the session attribute of the SessionBean object |
List |
getSessionAttributeNames()
Gets the sessionAttributeNames of this session. |
SessionRegistry |
getSessionRegistry()
Gets the Global SessionRegistry from the
servlet context, |
List |
getSets()
Gets a List of SetInfo objects that
provide information about the collections known to RepositoryManager. |
Map |
getStatuses()
|
SyncService |
getSyncService()
|
String |
getTimeSinceCreation()
Gets the timeSinceCreation attribute of the session as a formatted string. |
String |
getTimeSinceLastAccessed()
Gets the timeSinceLastAccessed of the session as a formated String for use in jsp. |
User |
getUser()
|
boolean |
isAuthorized(String operation)
Gets the authorized attribute of the SessionBean object |
boolean |
isAuthorized(String operation,
String collection)
Gets the authorized attribute of the SessionBean object |
boolean |
isAuthorizedCollection(Roles.Role role,
String collection)
|
boolean |
isNew()
Gets the new attribute of the SessionBean object |
boolean |
isQuerySelectorsInitialized()
|
boolean |
ownsLock(String recId)
Does this session own the lock for the record? |
boolean |
releaseAllLocks()
Release all locks held by this session. |
boolean |
releaseLock(String recId)
Release lock for given record. |
void |
setCollectionConfigMod(long mod)
|
void |
setCreators(List creators)
|
void |
setEditors(List editors)
|
void |
setIndexedFormats(List formats)
|
void |
setIndexLastModified(long mod)
|
void |
setIp(String ip)
Sets the ip attribute of the SessionBean object |
void |
setQuerySelectorsInitialized(boolean b)
|
void |
setRecId(String id)
Sets the recId attribute of the SessionBean object |
void |
setRequest(HttpServletRequest request)
Sets the request attribute of the SessionBean object |
void |
setSets(List sets)
Sets the sets attribute of the SessionBean object |
void |
setStatuses(Map statusMap)
|
void |
setSyncService(SyncService svc)
|
void |
updateCollectionFilter(String column,
String value)
The collectionFilter is used to filter UI displays using dcsTables |
void |
valueBound(HttpSessionBindingEvent event)
Method called each time a attribute is bound to this SessionBean's session. |
void |
valueUnbound(HttpSessionBindingEvent event)
Method called each time any attribute is removed from this SessionBean's session. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String DEFAULT_REC_SORT
org.dlese.dpc.schemedit.action.form.DCSQueryForm#getSortRecsBy()
.
public List indexedFormats
public List editors
public List creators
Constructor Detail |
---|
public SessionBean(HttpSession session, ServletContext servletContext)
session
- Description of the ParameterservletContext
- Description of the Parameterpublic SessionBean()
Method Detail |
---|
public void updateCollectionFilter(String column, String value)
public org.apache.struts.util.LabelValueBean getCollectionFilter()
public HttpSession getSession()
public User getUser()
public HttpServletRequest getRequest()
public void setRequest(HttpServletRequest request)
request
- The new request valuepublic void setRecId(String id)
id
- The new recId valuepublic Date getLastAccessedTime()
public String getTimeSinceLastAccessed()
public int getNumSecsToTimeout()
public boolean isNew()
public String getInactiveIntervalRemaining()
public String getTimeSinceCreation()
public String getRecId()
public String getId()
public String getIp()
public void setIp(String ip)
ip
- The new ip valuepublic List getLockedRecords()
public void valueBound(HttpSessionBindingEvent event)
This method is not currently used ...
valueBound
in interface HttpSessionBindingListener
event
- Description of the Parameterpublic void valueUnbound(HttpSessionBindingEvent event)
This method is not currently used ...
valueUnbound
in interface HttpSessionBindingListener
event
- Description of the Parameterpublic DcsDataRecord getDcsDataRecord(String id)
id
- Description of the Parameter
public List getServletContextAttributeNames()
public boolean ownsLock(String recId)
recId
- Description of the Parameter
public boolean releaseLock(String recId)
recId
- Id of record to release
public boolean releaseAllLocks()
public boolean getLock(String recId)
SessionRegistry.getLock(String, String)
.
recId
- Description of the Parameter
public RecordList getFailedBatchLocks()
ResultDoc
instances.#getBatchLocks(ResultDoc[])
public boolean getBatchLocks(RecordList records)
public boolean isAuthorized(String operation)
operation
- Description of the Parameter
public boolean isAuthorized(String operation, String collection)
operation
- Description of the Parametercollection
- Description of the Parameter
public boolean isAuthorizedCollection(Roles.Role role, String collection)
public List getSessionAttributeNames()
public SessionRegistry getSessionRegistry()
SessionRegistry
from the
servlet context,
public RoleManager getRoleManager()
public CollectionRegistry getCollectionRegistry()
public CollectionConfig getCollectionConfig(String collection)
collection
- Description of the Parameter
public String getFinalStatusLabel(String collection)
collection
- Description of the Parameter
public SearchHelper getSearchHelper()
public RecordList getRecords()
BatchOperationsAction
).
public String getSearchParams()
Enables system to take user back to the last search they performed. For example,searchParams is used by the "Search" link in the page header, so when user returns to search it is as they left it. queryForm
public void clearSearchParams()
public int getPaigingParam()
public int getPaigingParam(String id)
id
- Description of the Parameter
public String getQueryUrl()
public List getSets()
SetInfo
objects that
provide information about the collections known to RepositoryManager.
NOTE: why isn't the set list encapsulated by CollectionRegistry, and the
SetInfo
s themselves by CollectionConfig.
Then, the CollectionRegistry would be accessed through the servlet context.
public void setSets(List sets)
sets
- The new sets valuepublic List getAuthorizedCollections()
sessionBean
- NOT YET DOCUMENTED
public String getCollectionsQueryClause()
sessionBean
- NOT YET DOCUMENTED
public boolean isQuerySelectorsInitialized()
public void setQuerySelectorsInitialized(boolean b)
public long getIndexLastModified()
public void setIndexLastModified(long mod)
public long getCollectionConfigMod()
public void setCollectionConfigMod(long mod)
public Map getStatuses()
public void setStatuses(Map statusMap)
public List getIndexedFormats()
public void setIndexedFormats(List formats)
public List getEditors()
public void setEditors(List editors)
public List getCreators()
public void setCreators(List creators)
public List getCollectionLabelValues()
public SyncService getSyncService()
public void setSyncService(SyncService svc)
public void destroy()
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |