|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.common.MCRSession
public class MCRSession
Instances of this class collect information kept during a session like the currently active user, the preferred language etc.
| Field Summary | |
|---|---|
(package private) AtomicInteger |
accessCount
|
(package private) AtomicInteger |
concurrentAccess
|
(package private) ThreadLocal<AtomicInteger> |
currentThreadCount
|
(package private) static Logger |
LOGGER
the logger |
| Constructor Summary | |
|---|---|
MCRSession()
The constructor of a MCRSession. |
|
| Method Summary | |
|---|---|
(package private) void |
activate()
Activate this session. |
void |
beginTransaction()
starts a new database transaction. |
void |
close()
|
void |
commitTransaction()
commits the database transaction. |
void |
debug()
Write data to the logger for debugging purposes |
void |
deleteObject(Object key)
|
(package private) void |
fireSessionEvent(MCRSessionEvent.Type type,
int concurrentAccessors)
Fire MCRSessionEvents. |
Object |
get(Object key)
Returns the object that was stored in the session under the given key * |
long |
getCreateTime()
|
String |
getCurrentDocumentID()
returns the current document ID |
String |
getCurrentIP()
Get the current ip value |
String |
getCurrentLanguage()
returns the current language |
String |
getCurrentUserID()
returns the current user ID |
String |
getCurrentUserName()
returns the current document ID |
String |
getID()
Returns the unique ID of this session |
long |
getLastAccessedTime()
|
static String |
getLocalIP()
Get the ip value to the local IP |
long |
getLoginTime()
|
List<Map.Entry<Object,Object>> |
getMapEntries()
Returns an unmodifiable list of all entries in this MCRSession This method is thread safe. |
Iterator<Object> |
getObjectsKeyList()
Returns a list of all stored object keys within MCRSession. |
long |
getThisAccessTime()
|
Principal |
getUserPrincipal()
|
boolean |
isPrincipalInRole(String role)
|
boolean |
isTransactionActive()
Is the transaction still alive? |
(package private) void |
passivate()
Passivate this session. |
Object |
put(Object key,
Object value)
Stores an object under the given key within the session * |
void |
rollbackTransaction()
forces the database transaction to roll back. |
void |
setCurrentDocumentID(String DocumentID)
sets the current document ID |
void |
setCurrentIP(String newip)
Set the ip to the given IP |
void |
setCurrentLanguage(String language)
sets the current language |
void |
setCurrentUserID(String userID)
sets the current user ID |
void |
setCurrentUserName(String userName)
sets the current user fullname |
void |
setLoginTime()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
AtomicInteger accessCount
AtomicInteger concurrentAccess
ThreadLocal<AtomicInteger> currentThreadCount
static Logger LOGGER
| Constructor Detail |
|---|
MCRSession()
| Method Detail |
|---|
public final void setLoginTime()
public String getID()
public Iterator<Object> getObjectsKeyList()
getMapEntries() instead.
public List<Map.Entry<Object,Object>> getMapEntries()
public final String getCurrentUserID()
public final void setCurrentUserID(String userID)
public final String getCurrentLanguage()
public final void setCurrentLanguage(String language)
public final String getCurrentDocumentID()
public final String getCurrentUserName()
public final void setCurrentUserName(String userName)
public final void setCurrentDocumentID(String DocumentID)
public final void debug()
public Object put(Object key,
Object value)
public Object get(Object key)
public void deleteObject(Object key)
public static final String getLocalIP()
public String getCurrentIP()
public final void setCurrentIP(String newip)
public final long getLoginTime()
public void close()
public String toString()
toString in class Objectpublic long getLastAccessedTime()
void activate()
MCRSessionMgr.setCurrentSession(MCRSession)void passivate()
MCRSessionMgr.releaseCurrentSession()
void fireSessionEvent(MCRSessionEvent.Type type,
int concurrentAccessors)
type - type of eventconcurrentAccessors - number of concurrentThreads (passivateEvent gets 0 for
singleThread)public long getThisAccessTime()
public long getCreateTime()
public Principal getUserPrincipal()
public boolean isPrincipalInRole(String role)
public void beginTransaction()
public void commitTransaction()
isTransactionActive() returns true.
public void rollbackTransaction()
isTransactionActive() returns true.
public boolean isTransactionActive()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||