public class Helper extends Object
Constructor and Description |
---|
Helper(omero.cmd.Request request,
omero.cmd.Status status,
SqlAction sql,
org.hibernate.Session session,
ServiceFactory sf) |
Modifier and Type | Method and Description |
---|---|
void |
assertResponse(int step)
Checks the given steps against the number of times that this method
has been called on this instance and then increments the call count.
|
void |
assertStep(int step)
Checks the given steps against the number of times that this method
has been called on this instance and then increments the call count.
|
void |
assertStep(int i,
int step)
Throws an exception if the current step is not the expected value.
|
HandleI.Cancel |
cancel(omero.cmd.ERR err,
Throwable t,
String name,
Map<String,String> params)
Like
#fail(ERR, String, String...) throws a
HandleI.Cancel exception. |
HandleI.Cancel |
cancel(omero.cmd.ERR err,
Throwable t,
String name,
String... paramList)
Calls
#cancel(ERR, Throwable, String, Map with
the output of params(String...) . |
void |
debug(String fmt,
Object... args) |
void |
error(String fmt,
Object... args) |
void |
error(Throwable t,
String fmt,
Object... args) |
void |
fail(omero.cmd.ERR err,
Throwable t,
String name,
Map<String,String> params)
Sets the status.flags and the ERR properties appropriately and also
stores the message and stacktrace of the throwable in the parameters.
|
void |
fail(omero.cmd.ERR err,
Throwable t,
String name,
String... paramList)
Calls
#fail(ERR, String, Map) with the output of
params(String...) . |
EventContext |
getEventContext()
Provides an
EventContext instance without reloading the session,
via LocalAdmin.getEventContextQuiet() . |
omero.cmd.Response |
getResponse() |
ServiceFactory |
getServiceFactory() |
org.hibernate.Session |
getSession() |
SqlAction |
getSql() |
omero.cmd.Status |
getStatus() |
int |
getSteps() |
HandleI.Cancel |
graphException(GraphException ge,
long step,
long id)
Deprecated.
|
void |
info(String fmt,
Object... args) |
boolean |
isLast(int step)
Returns true if this is the last step for the given request.
|
Map<String,String> |
params(String... paramList)
Converts pairs of values from the varargs list into a map.
|
boolean |
setResponseIfNull(omero.cmd.Response rsp)
Set the response if there is not currently run, in which case true
is returned.
|
void |
setSteps(int steps) |
Helper |
subhelper(omero.cmd.Request req,
omero.cmd.Status substatus)
Run
IRequest.init(Helper) on a sub-command by creating a new
Helper instance. |
void |
warn(String fmt,
Object... args) |
public Helper(omero.cmd.Request request, omero.cmd.Status status, SqlAction sql, org.hibernate.Session session, ServiceFactory sf)
public Helper subhelper(omero.cmd.Request req, omero.cmd.Status substatus)
IRequest.init(Helper)
on a sub-command by creating a new
Helper instance.ireq
- substatus
- public void setSteps(int steps)
public int getSteps()
public omero.cmd.Status getStatus()
public omero.cmd.Response getResponse()
public boolean setResponseIfNull(omero.cmd.Response rsp)
rsp
- Can be null.public ServiceFactory getServiceFactory()
public org.hibernate.Session getSession()
public SqlAction getSql()
public Map<String,String> params(String... paramList)
public void fail(omero.cmd.ERR err, Throwable t, String name, String... paramList)
#fail(ERR, String, Map)
with the output of
params(String...)
.err
- name
- paramList
- public void fail(omero.cmd.ERR err, Throwable t, String name, Map<String,String> params)
err
- name
- params
- public HandleI.Cancel cancel(omero.cmd.ERR err, Throwable t, String name, String... paramList)
#cancel(ERR, Throwable, String, Map)
with
the output of params(String...)
.
See the statement about the return value.err
- t
- name
- paramList
- public HandleI.Cancel cancel(omero.cmd.ERR err, Throwable t, String name, Map<String,String> params)
#fail(ERR, String, String...)
throws a
HandleI.Cancel
exception.
A HandleI.Cancel
is thrown, even though one is also specified as the
return value. This permits:
} catch (Throwable t) { throw helper.cancel(new ERR(), t); }since omitting the "throw" within the catch clauses forces one to enter a number of "return null; // Never reached" lines.
err
- t
- name
- params
- public void assertStep(int i, int step)
public boolean step(int i) { if (helper.assertStep(0, i)) { return null; }
i
- step
- public void assertStep(int step)
public void assertResponse(int step)
public boolean isLast(int step)
public EventContext getEventContext()
EventContext
instance without reloading the session,
via LocalAdmin.getEventContextQuiet()
.@Deprecated public HandleI.Cancel graphException(GraphException ge, long step, long id)
Version: 5.1.3-ice35-b52
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.