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 SessionFetcherThe default fetcher delegates to PersistentQuery and QueryScope -
Method Summary
Modifier and TypeMethodDescriptionintaddSession(ScriptSession newSession, ExportedObjectClient client) Add a session for the specified client.getQueryScope(int sessionId) Get theQueryScopefor the specified session idgetScriptSession(int sessionKey) Get theScriptSessionfor 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 theScriptSessionfor the given session key- Parameters:
sessionKey- the session key- Returns:
- the
ScriptSessionfor 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 theQueryScopefor the specified session id- Parameters:
sessionId- the session id- Returns:
- the queryScope
- Throws:
PersistentQuery.UnknownSessionException- if the session could not be found
-