Interface SessionFetcher
public interface SessionFetcher
An interface that allows redirection of the various PersistentQuery methods. This simplifies unit testing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SessionFetcher
The default fetcher delegates to PersistentQuery and QueryScope -
Method Summary
Modifier and TypeMethodDescriptionint
addSession
(ScriptSession newSession, ExportedObjectClient client) Add a session for the specified client.getQueryScope
(int sessionId) Get theQueryScope
for the specified session idgetScriptSession
(int sessionKey) Get theScriptSession
for the given session key
-
Field Details
-
DEFAULT
The default fetcher delegates to PersistentQuery and QueryScope
-
-
Method Details
-
getScriptSession
@Nullable ScriptSession getScriptSession(int sessionKey) throws PersistentQuery.UnknownSessionException Get theScriptSession
for the given session key- Parameters:
sessionKey
- the session key- Returns:
- the
ScriptSession
for the key - Throws:
PersistentQuery.UnknownSessionException
- if the session can not be found
-
addSession
Add a session for the specified client.- Parameters:
newSession
- the session to addclient
- the client to associate with- Returns:
- the unique ID of the session
-
getQueryScope
Get theQueryScope
for the specified session id- Parameters:
sessionId
- the session id- Returns:
- the queryScope
- Throws:
PersistentQuery.UnknownSessionException
- if the session could not be found
-