ome.services.scripts
Class ScriptFinder

java.lang.Object
  extended by ome.services.scripts.ScriptFinder
Direct Known Subclasses:
PopulateRoiJob

public abstract class ScriptFinder
extends Object

Looks up an official script based on path for internal use. The strategy here is to not only check for name, but also for the sha1 of the file, meaning that if a new version is published, it will be used. Also provides #createJob() method in order to allow simple creation of processors.

Since:
Beta4.1

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
ScriptFinder(Roles roles, Principal principal, Executor executor, File source)
           
ScriptFinder(Roles roles, String uuid, Executor executor, File source)
           
 
Method Summary
 omero.model.ScriptJob createJob(ServiceFactory sf)
          Returns a fresh (unsaved) ScriptJob which can be passed to acquireProcessor for background processing.
 omero.model.OriginalFileI getFile(ServiceFactory sf)
           
abstract  String getName()
          Subclasses should override to return the name of the file under scripts/ which should be uploaded.
protected  List<ome.model.core.OriginalFile> loadScripts(ServiceFactory sf, ome.parameters.Parameters p)
          Load all scripts that match the name, sha1, and format for script
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

ScriptFinder

public ScriptFinder(Roles roles,
                    String uuid,
                    Executor executor,
                    File source)

ScriptFinder

public ScriptFinder(Roles roles,
                    Principal principal,
                    Executor executor,
                    File source)
Method Detail

getName

public abstract String getName()
Subclasses should override to return the name of the file under scripts/ which should be uploaded.


getFile

public omero.model.OriginalFileI getFile(ServiceFactory sf)

loadScripts

protected List<ome.model.core.OriginalFile> loadScripts(ServiceFactory sf,
                                                        ome.parameters.Parameters p)
Load all scripts that match the name, sha1, and format for script


createJob

public omero.model.ScriptJob createJob(ServiceFactory sf)
Returns a fresh (unsaved) ScriptJob which can be passed to acquireProcessor for background processing.



OmeroJava Api

Version: Beta4.2.1-r8614-Beta4.2-b41

Copyright © 2009 The University of Dundee. All Rights Reserved.