public class ScriptI extends AbstractAmdServant implements _IScriptOperations, ServiceFactoryAware, BlitzOnly
| Modifier and Type | Field and Description |
|---|---|
protected ome.security.ACLVoter |
aclVoter |
protected ParamsCache |
cache |
protected ome.util.checksum.ChecksumProviderFactory |
cpf |
protected ServiceFactoryI |
factory |
protected ome.security.basic.OmeroInterceptor |
interceptor |
protected ome.services.scripts.ScriptRepoHelper |
scripts |
| Constructor and Description |
|---|
ScriptI(BlitzExecutor be,
ome.services.scripts.ScriptRepoHelper scripts,
ome.security.ACLVoter aclVoter,
ome.security.basic.OmeroInterceptor interceptor,
ome.util.checksum.ChecksumProviderFactory cpf,
ParamsCache cache) |
| Modifier and Type | Method and Description |
|---|---|
protected ParamsHelper.Acquirer |
acquirer() |
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 id,
Ice.Current __current)
Delete the script with id from the server.
|
void |
editScript_async(AMD_IScript_editScript __cb,
OriginalFile fileObject,
java.lang.String scriptText,
Ice.Current __current)
Modify the text for the given script object.
|
void |
getParams_async(AMD_IScript_getParams __cb,
long id,
Ice.Current __current)
Get the Parameters of the script.
|
void |
getScriptID_async(AMD_IScript_getScriptID __cb,
java.lang.String scriptPath,
Ice.Current __current)
Get the id of the official script with given path.
|
void |
getScripts_async(AMD_IScript_getScripts __cb,
Ice.Current __current)
Get Scripts will return all the scripts by id and name available on the
server.
|
void |
getScriptsByMimetype_async(AMD_IScript_getScriptsByMimetype __cb,
java.lang.String mimetype,
Ice.Current __current)
Get Scripts will return all the scripts by id and name available on the
server.
|
void |
getScriptText_async(AMD_IScript_getScriptText __cb,
long id,
Ice.Current __current)
Return the script with the name to the user.
|
void |
getScriptWithDetails_async(AMD_IScript_getScriptWithDetails __cb,
long id,
Ice.Current __current)
Return the script with the name to the user.
|
void |
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.
|
void |
runScript_async(AMD_IScript_runScript __cb,
long scriptID,
java.util.Map<java.lang.String,RType> inputs,
RInt waitSecs,
Ice.Current __current)
If
ResourceError is thrown, then no
Processor is available. |
void |
setServiceFactory(ServiceFactoryI sf) |
void |
uploadOfficialScript_async(AMD_IScript_uploadOfficialScript __cb,
java.lang.String path,
java.lang.String scriptText,
Ice.Current __current)
Like
uploadScript 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 script to the server.
|
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 the
Job has a valid script
attached, based on the acceptsList and the current
security context. |
activate_async, applyHardWiredInterceptors, callInvokerOnMappedArgs, callInvokerOnRawArgs, executorWorkCall, getCurrentEventContext_async, onSetOmeroContext, passivate_async, runnableCall, safeRunnableCall, setApplicationContext, setHolderprotected ServiceFactoryI factory
protected ParamsCache cache
protected final ome.services.scripts.ScriptRepoHelper scripts
protected final ome.security.ACLVoter aclVoter
protected final ome.security.basic.OmeroInterceptor interceptor
protected final ome.util.checksum.ChecksumProviderFactory cpf
public ScriptI(BlitzExecutor be, ome.services.scripts.ScriptRepoHelper scripts, ome.security.ACLVoter aclVoter, ome.security.basic.OmeroInterceptor interceptor, ome.util.checksum.ChecksumProviderFactory cpf, ParamsCache cache)
public void setServiceFactory(ServiceFactoryI sf) throws ServerError
setServiceFactory in interface ServiceFactoryAwareServerErrorprotected ParamsHelper.Acquirer acquirer() throws ServerError
ServerErrorpublic void runScript_async(AMD_IScript_runScript __cb, long scriptID, java.util.Map<java.lang.String,RType> inputs, RInt waitSecs, Ice.Current __current) throws ServerError
_IScriptOperationsResourceError is thrown, then no
Processor is available. Use scheduleJob
to create a ScriptJob in the
Waiting state. A Processor may become
available.
try:
proc = scriptService.runScript(1, {}, None)
except ResourceError:
job = scriptService.scheduleScript(1, {}, None)
The ScriptProcess proxy MUST be closed before
exiting. If you would like the script execution to continue
in the background, pass True 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.
runScript_async in interface _IScriptOperations__cb - The callback object for the operation.__current - The Current object for the invocation.ServerErrorpublic void canRunScript_async(AMD_IScript_canRunScript __cb, long scriptID, Ice.Current __current) throws ServerError
_IScriptOperations
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.
canRunScript_async in interface _IScriptOperations__cb - The callback object for the operation.__current - The Current object for the invocation.ServerErrorpublic void getScriptID_async(AMD_IScript_getScriptID __cb, java.lang.String scriptPath, Ice.Current __current) throws ServerError
getScriptID_async in interface _IScriptOperations__cb - The script context.scriptPath - OriginalFile.getPath() of the script to find id for.__current - ice context.ServerErrorpublic void uploadScript_async(AMD_IScript_uploadScript __cb, java.lang.String path, java.lang.String scriptText, Ice.Current __current) throws ServerError
uploadScript_async in interface _IScriptOperationspath - the path to the scriptscriptText - the content for the new script__current - ice context.__cb - The callback object for the operation.ServerErrorpublic void uploadOfficialScript_async(AMD_IScript_uploadOfficialScript __cb, java.lang.String path, java.lang.String scriptText, Ice.Current __current) throws ServerError
_IScriptOperationsuploadScript but is only callable by
administrators. The parameters for the script are also
checked.uploadOfficialScript_async in interface _IScriptOperations__cb - The callback object for the operation.__current - The Current object for the invocation.ServerErrorpublic void editScript_async(AMD_IScript_editScript __cb, OriginalFile fileObject, java.lang.String scriptText, Ice.Current __current) throws ServerError
_IScriptOperationseditScript_async in interface _IScriptOperations__cb - The callback object for the operation.fileObject - see above.__current - The Current object for the invocation.ServerErrorpublic void getScriptWithDetails_async(AMD_IScript_getScriptWithDetails __cb, long id, Ice.Current __current) throws ServerError
getScriptWithDetails_async in interface _IScriptOperationsid - see above.__current - ice context.__cb - The callback object for the operation.ServerError - validation, api usage.public void getScriptText_async(AMD_IScript_getScriptText __cb, long id, Ice.Current __current) throws ServerError
getScriptText_async in interface _IScriptOperationsid - see above.__current - ice context.__cb - The callback object for the operation.ServerError - validation, api usage.public void getParams_async(AMD_IScript_getParams __cb, long id, Ice.Current __current) throws ServerError
getParams_async in interface _IScriptOperationsid - see above.__current - Ice context__cb - The callback object for the operation.ServerError - validation, api usage.public void getScripts_async(AMD_IScript_getScripts __cb, Ice.Current __current) throws ServerError
getScripts_async in interface _IScriptOperations__current - ice context,__cb - The callback object for the operation.ServerError - validation, api usage.public void getScriptsByMimetype_async(AMD_IScript_getScriptsByMimetype __cb, java.lang.String mimetype, Ice.Current __current) throws ServerError
getScriptsByMimetype_async in interface _IScriptOperationsmimetype - The mimetype of the scripts to retrieve.__current - ice context,__cb - The callback object for the operation.ServerError - validation, api usage.public void getUserScripts_async(AMD_IScript_getUserScripts __cb, java.util.List<IObject> acceptsList, Ice.Current __current) throws ServerError
_IScriptOperationsgetUserScripts_async in interface _IScriptOperations__cb - The callback object for the operation.__current - The Current object for the invocation.ServerErrorpublic void validateScript_async(AMD_IScript_validateScript __cb, Job j, java.util.List<IObject> acceptsList, Ice.Current __current) throws ServerError
_IScriptOperationsJob has a valid script
attached, based on the acceptsList and the current
security context.
An example of an acceptsList might be Experimenter(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.
validateScript_async in interface _IScriptOperations__cb - The callback object for the operation.__current - The Current object for the invocation.ServerErrorpublic void deleteScript_async(AMD_IScript_deleteScript cb, long id, Ice.Current __current) throws ServerError
deleteScript_async in interface _IScriptOperationsid - the id of the script to delete.cb - The callback object for the operation.__current - The Current object for the invocation.ServerError