OmeroBlitz API
Home Previous Up Next Index

omero::api::ISession

Overview

[ "ami", "amd" ] interface ISession extends ServiceInterface

model::Session creation service for OMERO. Access to all other services is dependent upon a properly created and still active model::Session. The session uuid ({@code omero.model.Session.getUuid}) can be considered a capability token, or temporary single use password. Simply by possessing it the client has access to all information available to the model::Session. Note: Both the RMI ome.system.ServiceFactory as well as the Ice ServiceFactory use ISession to acquire a model::Session. In the Ice case, Glacier2 contacts ISession itself and returns a ServiceFactory remote proxy. From both ServiceFactory instances, it is possible but not necessary to access ISession.

Operation Index

createSession
Creates a new session and returns it to the user.
createUserSession
Allows a user to open up another session for him/herself with the given defaults without needing to re-enter password.
createSessionWithTimeout
Allows an admin to create a ome::model::meta::Session for the give sys::Principal.
createSessionWithTimeouts
Allows an admin to create a ome::model::meta::Session for the given sys::Principal.
getSession
Retrieves the session associated with this uuid, updating the last access time as well.
getReferenceCount
Retrieves the current reference count for the given uuid.
closeSession
Closes session and releases all resources.
getMyOpenSessions
Returns a list of open sessions for the current user.
getMyOpenAgentSessions
Like {@code getMyOpenSessions} but returns only those sessions with the given agent string.
getMyOpenClientSessions
Like {@code getMyOpenSessions} but returns only those sessions started by official OMERO clients.
getInput
Retrieves an entry from the given model::Session input environment.
getOutput
Retrieves an entry from the model::Session output environment.
setInput
Places an entry in the given model::Session input environment.
setOutput
Places an entry in the given model::Session output environment.
getInputKeys
Retrieves all keys in the model::Session input environment.
getOutputKeys
Retrieves all keys in the model::Session output environment.
getInputs
Retrieves all inputs from the given model::Session input environment.
getOutputs
Retrieves all outputs from the given model::Session input environment.

Operations

model::Session createSession(sys::Principal p, string credentials) throws ServerError, ::Glacier2::CannotCreateSessionException

Creates a new session and returns it to the user.

Exceptions

ApiUsageException
if principal is null
SecurityViolation
if the password check fails

model::Session createUserSession(long timeToLiveMilliseconds, long timeToIdleMilliseconds, string defaultGroup) throws ServerError, ::Glacier2::CannotCreateSessionException

Allows a user to open up another session for him/herself with the given defaults without needing to re-enter password.

model::Session createSessionWithTimeout(sys::Principal principal, long timeToLiveMilliseconds) throws ServerError, ::Glacier2::CannotCreateSessionException

Allows an admin to create a ome::model::meta::Session for the give sys::Principal.

Parameters

principal
Non-null sys::Principal with the target user's name
timeToLiveMilliseconds
The time that this ome::model::meta::Session has until destruction. This is useful to override the server default so that an initial delay before the user is given the token will not be construed as idle time. A value less than 1 will cause the default max timeToLive to be used; but timeToIdle will be disabled.

model::Session createSessionWithTimeouts(sys::Principal principal, long timeToLiveMilliseconds, long timeToIdleMilliseconds) throws ServerError, ::Glacier2::CannotCreateSessionException

Allows an admin to create a ome::model::meta::Session for the given sys::Principal.

Parameters

principal
Non-null sys::Principal with the target user's name
timeToLiveMilliseconds
The time that this ome::model::meta::Session has until destruction. Setting the value to 0 will prevent destruction unless the session remains idle.
timeToIdleMilliseconds
The time that this ome::model::meta::Session can remain idle before being destroyed. Setting the value to 0 will prevent idleness based destruction.

model::Session getSession(string sessionUuid) throws ServerError

Retrieves the session associated with this uuid, updating the last access time as well. Throws a RemovedSessionException if not present, or a SessionTimeoutException if expired. This method can be used as a ome::model::meta::Session ping.

int getReferenceCount(string sessionUuid) throws ServerError

Retrieves the current reference count for the given uuid. Has the same semantics as {@code getSession}.

int closeSession(model::Session sess) throws ServerError

Closes session and releases all resources. It is preferred that all clients call this method as soon as possible to free memory, but it is possible to not call close, and rejoin a session later. The current reference count for the session is returned. If the session does not exist, -1. If this call caused the death of the session, then -2.

SessionList getMyOpenSessions() throws ServerError

Returns a list of open sessions for the current user. The list is ordered by session creation time, so that the last item was created last.

SessionList getMyOpenAgentSessions(string agent) throws ServerError

Like {@code getMyOpenSessions} but returns only those sessions with the given agent string.

SessionList getMyOpenClientSessions() throws ServerError

Like {@code getMyOpenSessions} but returns only those sessions started by official OMERO clients.

RType getInput(string sess, string key) throws ServerError

Retrieves an entry from the given model::Session input environment.

RType getOutput(string sess, string key) throws ServerError

Retrieves an entry from the model::Session output environment.

void setInput(string sess, string key, RType value) throws ServerError

Places an entry in the given model::Session input environment. If the value is null, the key will be removed.

void setOutput(string sess, string key, RType value) throws ServerError

Places an entry in the given model::Session output environment. If the value is null, the key will be removed.

StringSet getInputKeys(string sess) throws ServerError

Retrieves all keys in the model::Session input environment.

Return Value

a java::util::Set of keys

StringSet getOutputKeys(string sess) throws ServerError

Retrieves all keys in the model::Session output environment.

RTypeDict getInputs(string sess) throws ServerError

Retrieves all inputs from the given model::Session input environment.

RTypeDict getOutputs(string sess) throws ServerError

Retrieves all outputs from the given model::Session input environment.


Home Previous Up Next Index