public class YSessionCache extends java.util.concurrent.ConcurrentHashMap<java.lang.String,YSession> implements ISessionCache
java.util.concurrent.ConcurrentHashMap.KeySetView<K,V>
Constructor and Description |
---|
YSessionCache() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkConnection(java.lang.String handle)
Checks that a session handle represents an active session.
|
java.lang.String |
connect(java.lang.String name,
java.lang.String password,
long timeOutSeconds)
Creates and stores a new session between the the Engine and a custom service
or external application.
|
void |
disconnect(java.lang.String handle)
Ends an active session of a custom service or external application.
|
void |
disconnect(YClient client)
Ends an active session of a custom service or external application.
|
void |
expire(java.lang.String handle)
Removes a session from the set of active sessions after an idle timeout.
|
YSession |
getSession(java.lang.String handle)
Gets the session associated with a session handle.
|
boolean |
isClientConnected(YExternalClient client)
Checks that a particular external client has an active session with the Engine.
|
boolean |
isServiceConnected(java.lang.String uri)
Checks that a particular custom service has an active session with the Engine.
|
void |
shutdown()
Called when the hosting server shuts down to write a shutdown record for each
active session to the audit log.
|
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, put, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values
public java.lang.String connect(java.lang.String name, java.lang.String password, long timeOutSeconds)
connect
in interface ISessionCache
name
- the username of the external clientpassword
- the corresponding (hashed) passwordtimeOutSeconds
- the maximum idle time for this session (in seconds). A
value of 0 will default to 60 minutes; a value less than zero means this session
will never timeout.public boolean checkConnection(java.lang.String handle)
checkConnection
in interface ISessionCache
handle
- the session handle held by a client or service.public boolean isServiceConnected(java.lang.String uri)
uri
- the uri of the custom service.public boolean isClientConnected(YExternalClient client)
client
- the client.public YSession getSession(java.lang.String handle)
getSession
in interface ISessionCache
handle
- a session handle.public void expire(java.lang.String handle)
expire
in interface ISessionCache
handle
- the session handle of the session to remove.public void disconnect(YClient client)
client
- the service or application to disconnect from the Engine. Also
writes the disconnection to the session audit log.public void disconnect(java.lang.String handle)
disconnect
in interface ISessionCache
handle
- the session handle of a service or application to disconnect
from the Engine. Also writes the disconnection to the session audit log.public void shutdown()
shutdown
in interface ISessionCache
Copyright © 2004-2014 The YAWL Foundation.