Package omero.api
Class _IScriptTie
- java.lang.Object
-
- Ice.ObjectImpl
-
- omero.api._IScriptDisp
-
- omero.api._IScriptTie
-
- All Implemented Interfaces:
Ice.Object
,Ice.TieBase
,java.io.Serializable
,java.lang.Cloneable
,_IScriptOperations
,_IScriptOperationsNC
,_ServiceInterfaceOperations
,_ServiceInterfaceOperationsNC
,IScript
,ServiceInterface
public class _IScriptTie extends _IScriptDisp implements Ice.TieBase
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static long
serialVersionUID
-
Fields inherited from class omero.api._IScriptDisp
__ids
-
Fields inherited from interface omero.api.IScript
ice_staticId
-
-
Constructor Summary
Constructors Constructor Description _IScriptTie()
_IScriptTie(_IScriptOperations delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
canRunScript_async(AMD_IScript_canRunScript __cb, long scriptID, Ice.Current __current)
Returns true if there is a processor which will run the given script.void
deleteScript_async(AMD_IScript_deleteScript __cb, long scriptID, Ice.Current __current)
Delete the script on the server with id.void
editScript_async(AMD_IScript_editScript __cb, OriginalFile fileObject, java.lang.String scriptText, Ice.Current __current)
Modify the text for the given script object.boolean
equals(java.lang.Object rhs)
void
getParams_async(AMD_IScript_getParams __cb, long scriptID, Ice.Current __current)
Get the parameters that the script takes and returns, along with other metadata available from the script.void
getScriptID_async(AMD_IScript_getScriptID __cb, java.lang.String path, Ice.Current __current)
Get the id of an official script by the script path.void
getScripts_async(AMD_IScript_getScripts __cb, Ice.Current __current)
This method returns official server scripts as a list ofOriginalFile
objects.void
getScriptsByMimetype_async(AMD_IScript_getScriptsByMimetype __cb, java.lang.String mimetype, Ice.Current __current)
This method returns official server scripts identified with the specified extension as a list ofOriginalFile
objects.void
getScriptText_async(AMD_IScript_getScriptText __cb, long scriptID, Ice.Current __current)
Get the text from the server for the script with given id.void
getScriptWithDetails_async(AMD_IScript_getScriptWithDetails __cb, long scriptID, Ice.Current __current)
Get the script from the server with details from OriginalFilevoid
getUserScripts_async(AMD_IScript_getUserScripts __cb, java.util.List<IObject> acceptsList, Ice.Current __current)
Returns non-official scripts which have been uploaded by individual users.int
hashCode()
java.lang.Object
ice_delegate()
void
ice_delegate(java.lang.Object delegate)
void
runScript_async(AMD_IScript_runScript __cb, long scriptID, java.util.Map<java.lang.String,RType> inputs, RInt waitSecs, Ice.Current __current)
IfResourceError
is thrown, then noProcessor
is available.void
uploadOfficialScript_async(AMD_IScript_uploadOfficialScript __cb, java.lang.String path, java.lang.String scriptText, Ice.Current __current)
LikeuploadScript
but is only callable by administrators.void
uploadScript_async(AMD_IScript_uploadScript __cb, java.lang.String path, java.lang.String scriptText, Ice.Current __current)
Upload a user script to the server and return the id.void
validateScript_async(AMD_IScript_validateScript __cb, Job j, java.util.List<IObject> acceptsList, Ice.Current __current)
Used internally by processor.py to check if the script attached to theJob
has a valid script attached, based on theacceptsList
and the current security context.-
Methods inherited from class omero.api._IScriptDisp
___canRunScript, ___deleteScript, ___editScript, ___getParams, ___getScriptID, ___getScripts, ___getScriptsByMimetype, ___getScriptText, ___getScriptWithDetails, ___getUserScripts, ___runScript, ___uploadOfficialScript, ___uploadScript, ___validateScript, __dispatch, __readImpl, __writeImpl, canRunScript_async, deleteScript_async, editScript_async, getParams_async, getScriptID_async, getScripts_async, getScriptsByMimetype_async, getScriptText_async, getScriptWithDetails_async, getUserScripts_async, ice_copyStateFrom, ice_id, ice_id, ice_ids, ice_ids, ice_isA, ice_isA, ice_staticId, runScript_async, uploadOfficialScript_async, uploadScript_async, validateScript_async
-
Methods inherited from class Ice.ObjectImpl
___ice_id, ___ice_ids, ___ice_isA, ___ice_ping, __checkMode, __read, __read, __readImpl, __write, __write, __writeImpl, clone, ice_dispatch, ice_dispatch, ice_operationAttributes, ice_ping, ice_ping, ice_postUnmarshal, ice_preMarshal
-
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
_IScriptTie
public _IScriptTie()
-
_IScriptTie
public _IScriptTie(_IScriptOperations delegate)
-
-
Method Detail
-
ice_delegate
public java.lang.Object ice_delegate()
- Specified by:
ice_delegate
in interfaceIce.TieBase
-
ice_delegate
public void ice_delegate(java.lang.Object delegate)
- Specified by:
ice_delegate
in interfaceIce.TieBase
-
equals
public boolean equals(java.lang.Object rhs)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
canRunScript_async
public void canRunScript_async(AMD_IScript_canRunScript __cb, long scriptID, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
Returns true if there is a processor which will run the given script.Either the script is an official script and this method will return true (though an individual invocation may fail with an
ResourceError
for some reason) or this is a user script, and a usermode processor must be active which takes the scripts user or group.- Specified by:
canRunScript_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
deleteScript_async
public void deleteScript_async(AMD_IScript_deleteScript __cb, long scriptID, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
Delete the script on the server with id. The file will also be removed from disk.- Specified by:
deleteScript_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.scriptID
- Id of the script to delete.__current
- The Current object for the invocation.- Throws:
ServerError
-
editScript_async
public void editScript_async(AMD_IScript_editScript __cb, OriginalFile fileObject, java.lang.String scriptText, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
Modify the text for the given script object.- Specified by:
editScript_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.fileObject
- see above.__current
- The Current object for the invocation.- Throws:
ServerError
-
getParams_async
public void getParams_async(AMD_IScript_getParams __cb, long scriptID, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
Get the parameters that the script takes and returns, along with other metadata available from the script.- Specified by:
getParams_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.scriptID
- see above.__current
- The Current object for the invocation.- Throws:
ServerError
-
getScriptID_async
public void getScriptID_async(AMD_IScript_getScriptID __cb, java.lang.String path, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
Get the id of an official script by the script path. The script service ensures that all script paths are unique. Note: there is no similar method for user scripts (e.g.getUserScriptID
) since the path is not guaranteed to be unique.- Specified by:
getScriptID_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.path
- The name of the script.__current
- The Current object for the invocation.- Throws:
ServerError
-
getScriptText_async
public void getScriptText_async(AMD_IScript_getScriptText __cb, long scriptID, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
Get the text from the server for the script with given id.- Specified by:
getScriptText_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.scriptID
- see above.__current
- The Current object for the invocation.- Throws:
ServerError
-
getScriptWithDetails_async
public void getScriptWithDetails_async(AMD_IScript_getScriptWithDetails __cb, long scriptID, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
Get the script from the server with details from OriginalFile- Specified by:
getScriptWithDetails_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.scriptID
- see above__current
- The Current object for the invocation.- Throws:
ServerError
-
getScripts_async
public void getScripts_async(AMD_IScript_getScripts __cb, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
This method returns official server scripts as a list ofOriginalFile
objects. These scripts will be executed by the server if submitted viarunScript
. The input parameters necessary for proper functioning can be retrieved viagetParams
. TheOriginalFile.path
value can be used in other official scripts via the language specific import command, since the script directory will be placed on the appropriate environment path variable.scripts = scriptService.getScripts() for script in scripts: text = scriptService.getScriptText(script.id.val) # First character is a "/" symbol path = script.path.val\[1:\] path = path.replace("/",".") print "Possible import: %s" % path
- Specified by:
getScripts_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
getScriptsByMimetype_async
public void getScriptsByMimetype_async(AMD_IScript_getScriptsByMimetype __cb, java.lang.String mimetype, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
This method returns official server scripts identified with the specified extension as a list ofOriginalFile
objects. These scripts will be executed by the server if submitted viarunScript
. The input parameters necessary for proper functioning can be retrieved viagetParams
. TheOriginalFile.path
value can be used in other official scripts via the language specific import command, since the script directory will be placed on the appropriate environment path variable.scripts = scriptService.getScripts("py") for script in scripts: text = scriptService.getScriptText(script.id.val) path = script.path.val\[1:\] # First symbol is a "/" path = path.replace("/",".") print "Possible import: %s" % path
- Specified by:
getScriptsByMimetype_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.mimetype
- the mimetype identifying the scripts.__current
- The Current object for the invocation.- Throws:
ServerError
-
getUserScripts_async
public void getUserScripts_async(AMD_IScript_getUserScripts __cb, java.util.List<IObject> acceptsList, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
Returns non-official scripts which have been uploaded by individual users. These scripts will not be run by the server, though a user can start a personal usermode processor which will allow the scripts to be executed. This is particularly useful for testing new scripts.- Specified by:
getUserScripts_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
runScript_async
public void runScript_async(AMD_IScript_runScript __cb, long scriptID, java.util.Map<java.lang.String,RType> inputs, RInt waitSecs, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
IfResourceError
is thrown, then noProcessor
is available. UsescheduleJob
to create aScriptJob
in the Waiting state. AProcessor
may become available.try: proc = scriptService.runScript(1, {}, None) except ResourceError: job = scriptService.scheduleScript(1, {}, None)
ScriptProcess
proxy MUST be closed before exiting. If you would like the script execution to continue in the background, passTrue
as the argument.try: proc.poll() # See if process is finished finally: proc.close(True) # Detach and execution can continue # proc.close(False) # OR script is immediately stopped.
- Specified by:
runScript_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
uploadOfficialScript_async
public void uploadOfficialScript_async(AMD_IScript_uploadOfficialScript __cb, java.lang.String path, java.lang.String scriptText, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
LikeuploadScript
but is only callable by administrators. The parameters for the script are also checked.- Specified by:
uploadOfficialScript_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
uploadScript_async
public void uploadScript_async(AMD_IScript_uploadScript __cb, java.lang.String path, java.lang.String scriptText, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
Upload a user script to the server and return the id. This method checks that a script with that names does not exist and that the script has parameters if possible, i.e. a usermode processor is running which for the current user.- Specified by:
uploadScript_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.path
- see above.__current
- The Current object for the invocation.- Throws:
ServerError
-
validateScript_async
public void validateScript_async(AMD_IScript_validateScript __cb, Job j, java.util.List<IObject> acceptsList, Ice.Current __current) throws ServerError
Description copied from interface:_IScriptOperations
Used internally by processor.py to check if the script attached to theJob
has a valid script attached, based on theacceptsList
and the current security context. An example of an acceptsList might beExperimenter(myUserId, False)
, meaning that only scripts belonging to me should be trusted. An empty list implies that the server should return what it would by default trust. A valid script will be returned if it exists; otherwise null.- Specified by:
validateScript_async
in interface_IScriptOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
-