public interface ProjectManager
| Modifier and Type | Field and Description |
|---|---|
static int |
JOB_CANCELLED
Job status cancelled.
|
static int |
JOB_EXPIRED
Job status expired.
|
static int |
JOB_READY
Job status ready.
|
static int |
JOB_WAITING
Job status waiting.
|
static int |
JOB_WORKING
Job status working.
|
static int |
PRIORITY_ABOVE_NORMAL
Above normal priority.
|
static int |
PRIORITY_BELOW_NORMAL
Below normal priority.
|
static int |
PRIORITY_HIGH
High priority.
|
static int |
PRIORITY_HIGHEST
Highest priority.
|
static int |
PRIORITY_LOW
Low priority.
|
static int |
PRIORITY_LOWEST
Lowest priority, running jobs may be removed if necessary.
|
static int |
PRIORITY_NORMAL
Normal priority.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
actionWait(long timeout)
Wait for activity in the projects.
|
int |
addUserClientsToProject(int handle)
Add all user assigned clients to the project.
|
int |
createCachedJob(int handle,
java.util.Hashtable<java.lang.String,java.lang.String> params)
Create an internally cached job.
|
int |
createCachedJob(int handle,
java.lang.String[] params)
Create an internally cached job.
|
int |
createJob(int handle,
java.util.Hashtable<java.lang.String,java.lang.String> params)
Create a job for the project associated with the specified handle.
|
int |
createJob(int handle,
java.lang.String[] params)
Create a job for the project associated with the specified handle.
|
int |
createProject(int handle,
int priority,
java.lang.String description)
Create an empty project.
|
int |
createProject(int handle,
int priority,
java.lang.String description,
java.util.Hashtable<java.lang.String,java.lang.String> params)
Create a project, create jobs with given parameters, assign clients
and start the project.
|
int |
createProject(int handle,
int priority,
java.lang.String description,
java.lang.String[] params)
Create a project, create jobs with given parameters (using a splitter),
assign clients and start the project.
|
int |
createProjectJobs(int handle,
java.util.Hashtable<java.lang.String,java.lang.String> params)
Create jobs for the project using given parameters.
|
int |
createProjectJobs(int handle,
java.util.Hashtable<java.lang.String,java.lang.String> commonParams,
java.util.Vector<java.util.Hashtable<java.lang.String,java.lang.String>> jobParams)
Create jobs for the project using given parameters.
|
int |
createProjectJobs(int handle,
java.lang.String[] params)
Create jobs for the project using given parameters.
|
int |
flushCachedJobs(int handle)
Flush cached jobs from internal list and create them on the server.
|
java.util.Vector |
getActiveProjects()
Get a list of currently active projects.
|
java.lang.String |
getErrorFile(int handle)
Get the file name where the errors have been stored (XML).
|
long[] |
getErrorJobIds(int handle)
Get a list of job ids which have errors.
|
int |
getErrors(int handle)
Download project errors to a local file.
|
int |
getErrors(int handle,
boolean incremental)
Download project errors to a local file, optinally incrementally.
|
int |
getJobErrorCount(int handle,
long jobid)
Get the number of errors for given job.
|
java.lang.String |
getJobErrorMessage(int handle,
long jobid,
int msgIndex)
Get the error message for a given job at specified index.
|
Message |
getJobErrorMessageObject(int handle,
long jobid,
int msgIndex)
Get the message object for an error.
|
java.util.Hashtable |
getJobInfo(int handle,
long jobid)
Get information of given job.
|
int |
getLastError(int handle)
Get the error / status code of the last background poll operation.
|
java.lang.String |
getProjectDescription(int handle)
Get the project description.
|
int |
getProjectId(int handle)
Get the project id associated with the specified handle.
|
java.util.Vector |
getProjectJobsByStatus(int handle,
int status)
Get list of project jobs having given status.
|
int |
getProjectParamCount(int handle)
Get count of project parameters.
|
java.lang.String |
getProjectParamName(int handle,
int index)
Get project parameter name in specified index.
|
java.util.Hashtable<java.lang.String,java.lang.String> |
getProjectParams(int handle)
Get project's parameters.
|
java.lang.String |
getProjectParamValue(int handle,
java.lang.String key)
Get value of project parameter.
|
int |
getProjectPriority(int projectid)
Get project priority for the given project id.
|
java.lang.String |
getProjectStatistic(int handle,
java.lang.String key)
Get project's statistic.
|
java.util.Hashtable<java.lang.String,java.lang.String> |
getProjectStatistics(int handle)
Get project's statistics.
|
int |
getProjectStatus(int handle)
Get the project status associated with the handle.
Example:
ProjectManager projectManager = techila.projectManager(); |
java.lang.String |
getStatisticsString(int handle)
Get the statistics as a String.
|
long |
getUsedCpuTime(int handle)
Get the used CPU time for the project.
|
long |
getUsedTime(int handle)
Get the used wall clock time for the project.
|
java.util.Vector |
getWaitingProjects()
Get a list of currently waiting projects.
|
boolean |
isCompleted(int handle)
Is the project associated with the handle completed.
|
boolean |
isFailed(int handle)
Has the project associated with the handle failed.
Example:
ProjectManager projectManager = techila.projectManager(); |
boolean |
isJobCompleted(int handle)
Is the job completed...
|
int |
markAllJobsCreated(int handle)
Mark all jobs in the project created.
|
int |
modifyPerm(int projectid,
java.lang.String username,
java.lang.String perms)
Modify project permissions.
|
int |
parseErrors(int handle)
Parse the errors in the errors file into internal format.
|
int |
postProcessed(int handle,
int count) |
void |
printStatistics(int handle)
Print project statistics into System.out.
|
void |
printStatistics(int handle,
java.io.PrintStream out)
Print project statistics into given stream.
|
int |
ready(int handle)
Get the percentage of ready jobs in the project as an integer.
|
int |
registerHandleCallback(int handle,
Handle.HandleCallbackType type,
HandleCallback callback) |
int |
registerHandleCallback(int handle,
java.lang.String type,
HandleCallback callback) |
int |
removeProject(int handle)
Remove the project.
|
int |
sendJobCommand(int handle,
long jobid,
java.lang.String command)
Send given command to stdin of job.
|
int |
sendJobCommand(long jobid,
java.lang.String command)
Send given command to stdin of job.
|
int |
sendJobPostParameter(int handle,
long jobid,
java.lang.String command)
Execute given command as parsed job parameter.
|
int |
sendJobPostParameter(int handle,
java.lang.String[] jobids,
java.lang.String command)
Execute given command as parsed job parameter.
|
int |
sendJobPostParameter(long jobid,
java.lang.String command)
Execute given command as parsed job parameter.
|
int |
sendJobPostParameter(java.lang.String[] jobids,
java.lang.String command)
Execute given command as parsed job parameter.
|
int |
setProjectId(int handle,
int projectId)
Set project id for the specified handle.
|
int |
setProjectParams(int handle,
java.util.Hashtable<java.lang.String,java.lang.String> pparams)
Set project's control parameters.
|
int |
setProjectParams(int handle,
java.lang.String[] pparams)
Set project's control parameters.
|
int |
setProjectPriority(int projectid,
int priority)
Set project priority for the given project id.
|
int |
startProject(int handle)
Start the project.
|
int |
stopProject(int handle)
Stop the project.
|
int |
stopWaitingBG(int handle)
Stop the polling for the project status in the background thread.
|
int |
unregisterHandleCallback(int handle,
Handle.HandleCallbackType type,
HandleCallback callback) |
int |
unregisterHandleCallback(int handle,
java.lang.String type,
HandleCallback callback) |
int |
waitCompletion(int handle)
Wait for project completion.
|
int |
waitCompletionBG(int handle)
Wait for project completion in the background.
|
static final int PRIORITY_HIGHEST
static final int PRIORITY_HIGH
static final int PRIORITY_ABOVE_NORMAL
static final int PRIORITY_NORMAL
static final int PRIORITY_BELOW_NORMAL
static final int PRIORITY_LOW
static final int PRIORITY_LOWEST
static final int JOB_WAITING
static final int JOB_EXPIRED
static final int JOB_WORKING
static final int JOB_READY
static final int JOB_CANCELLED
int createProject(int handle,
int priority,
java.lang.String description,
java.lang.String[] params)
handle - priority - description - params - project parameters, String array of
"param name=param value" pairscreateProject(int, int, String, Hashtable)int createProject(int handle,
int priority,
java.lang.String description,
java.util.Hashtable<java.lang.String,java.lang.String> params)
Hashtable<String, String> params =
new Hashtable<String, String>();
ProjectManager projectManager = techila.projectManager();
int statuscode = projectManager.createProject(handle,
ManagementInterface.PRIORITY_NORMAL, "a project...", params);
if (statuscode == Support.OK) {
projectManager.waitCompletion(handle);
// [...]
}
handle - priority - description - project descriptionparams - project parametersBundleManager.useBundle(int, String),
BundleManager.useBundle(int, String, String),
BundleManager.createBundle(int, String, String, String,
String, String, String, String, String, String, Vector, Hashtable)int createProject(int handle,
int priority,
java.lang.String description)
createProjectJobs (or createJob)
to create jobs in the project. Also use markAllJobsCreated,
addUserClientsToProject and startProject.handle - priority - description - BundleManager.useBundle(int, String),
BundleManager.useBundle(int, String, String),
BundleManager.createBundle(int, String, String, String,
String, String, String, String, String, String, Vector, Hashtable),
createProjectJobs(int, Hashtable),
createJob(int, Hashtable),
markAllJobsCreated(int),
addUserClientsToProject(int),
startProject(int)int createProjectJobs(int handle,
java.lang.String[] params)
handle - params - project parameters, String array of
"param name = param value" pairscreateProjectJobs(int, Hashtable),
createProjectJobs(int, Hashtable)int createProjectJobs(int handle,
java.util.Hashtable<java.lang.String,java.lang.String> params)
Hashtable<String, String> params =
new Hashtable<String, String>();
params.put("jobs", "9");
params.put("value1", "42");
params.put("value2", "1.2");
int statuscode = projectManager.createProjectJobs(handle, params);
handle - params - project parametersManagementInterface#createProject(int, int, String)int createProjectJobs(int handle,
java.util.Hashtable<java.lang.String,java.lang.String> commonParams,
java.util.Vector<java.util.Hashtable<java.lang.String,java.lang.String>> jobParams)
jobParams vector. If the
jobParams contains parameters which are also in the
commonParams, the jobParams will
override the value on commonParams. Remember to call
markAllJobsCreated after all jobs have been created.
With large number of jobs it is better to use a splitter.
// fill common parameters
Hashtable<String, String> commonParams =
new Hashtable<String, String>();
commonParams.put("value1", "42");
commonParams.put("value2", "1.2");
Vector<Hashtable<String, String>> jobParams =
new Vector<Hashtable<String, String>>();
// create job parameters for 9 jobs
for (int i = 1; i <= 9; i++) {
Hashtable<String, String> jp =
new Hashtable<String, String>();
jp.put("jobidx", Integer.toString(i));
jobParams.add(jp);
}
ProjectManager projectManager = techila.projectManager();
int statuscode = projectManager.createProjectJobs(handle, commonParams,
jobParams);
if (statuscode == Support.OK) {
projectManager.markAllJobsCreated(handle);
// [...]
}
handle - commonParams - common parameters for all jobsjobParams - Vector of parameters for each jobcreateProject(int, int, String),
markAllJobsCreated(int)int addUserClientsToProject(int handle)
handle - createProject(int, int, String)int startProject(int handle)
handle - createProject(int, int, String)int stopProject(int handle)
handle - int removeProject(int handle)
handle - int createJob(int handle,
java.util.Hashtable<java.lang.String,java.lang.String> params)
markAllJobsCreated after all jobs have been created.
With large number of jobs it is better to use a splitter.handle - params - job parameterscreateProject(int, int, String),
markAllJobsCreated(int)int createJob(int handle,
java.lang.String[] params)
markAllJobsCreated after all jobs have been created.
With large number of jobs it is better to use a splitter.handle - params - job parameterscreateProject(int, int, String),
markAllJobsCreated(int)int createCachedJob(int handle,
java.util.Hashtable<java.lang.String,java.lang.String> params)
flushCachedJobs is called. This will automatically
call flushCachedJobs if the amount of jobs in the internal
list exceeds 100. Remember to call flushCachedJobs and
markAllJobsCreated.handle - params - job parameterscreateJob(int, Hashtable),
flushCachedJobs(int),
markAllJobsCreated(int)int createCachedJob(int handle,
java.lang.String[] params)
flushCachedJobs is called. This will automatically
call flushCachedJobs if the amount of jobs in the internal
list exceeds 100. Remember to call flushCachedJobs and
markAllJobsCreated.handle - params - job parameterscreateJob(int, Hashtable),
flushCachedJobs(int),
markAllJobsCreated(int)int flushCachedJobs(int handle)
markAllJobsCreated after this.handle - createCachedJob(int, Hashtable),
markAllJobsCreated(int)int markAllJobsCreated(int handle)
createJob.
Do not use with splitter.handle - createProject(int, int, String),
createJob(int, Hashtable),
createProjectJobs(int, Hashtable, Vector)int setProjectId(int handle,
int projectId)
handle - projectId - int setProjectPriority(int projectid,
int priority)
projectid - the id of the projectpriority - the priority of the projectint getProjectPriority(int projectid)
projectid - the id of the projectint getProjectId(int handle)
handle - int waitCompletion(int handle)
handle - getProjectStatus(int)int waitCompletionBG(int handle)
ProjectManager projectManager = techila.projectManager();
int statuscode = projectManager.waitCompletionBG(handle);
if (statuscode == Support.OK) {
while (!projectManager.isCompleted(handle)) {
projectManager.actionWait(handle, 60000);
}
}
handle - stopWaitingBG(int)int stopWaitingBG(int handle)
boolean actionWait(long timeout)
waitCompletionBG method. Activity means that some of
the polled values have changed from the previous poll (e.g. ready
jobs increases and waiting jobs decreases). The method will also
return if the timeout has been reached.
ProjectManager projectManager = techila.projectManager();
// wait 60 seconds for activity
boolean activity = projectManager.actionWait(60000);
timeout - max time to wait (in ms), 0 for unlimited.waitCompletionBG(int)boolean isCompleted(int handle)
isFailed to get that information.
ProjectManager projectManager = techila.projectManager();
boolean completed = projectManager.isCompleted(handle);
handle - getProjectStatus(int),
isFailed(int)boolean isJobCompleted(int handle)
handle - boolean isFailed(int handle)
ProjectManager projectManager = techila.projectManager();
boolean isFailed = projectManager.isFailed(handle);
handle - int getProjectStatus(int handle)
ProjectManager projectManager = techila.projectManager();
int status = projectManager.getProjectStatus(handle);
handle - java.lang.String getProjectDescription(int handle)
handle - int ready(int handle)
handle - long getUsedCpuTime(int handle)
handle - long getUsedTime(int handle)
handle - int getLastError(int handle)
handle - waitCompletionBG(int)int getErrors(int handle)
handle - parseErrors(int)int getErrors(int handle,
boolean incremental)
handle - incremental - java.lang.String getErrorFile(int handle)
handle - int parseErrors(int handle)
getErrors and before any other error handling
methods (except getErrorFile).handle - getErrors(int)long[] getErrorJobIds(int handle)
handle - int getJobErrorCount(int handle,
long jobid)
handle - jobid - java.lang.String getJobErrorMessage(int handle,
long jobid,
int msgIndex)
handle - jobid - msgIndex - Message getJobErrorMessageObject(int handle, long jobid, int msgIndex)
handle - jobid - msgIndex - int setProjectParams(int handle,
java.util.Hashtable<java.lang.String,java.lang.String> pparams)
handle - pparams - project parametersint setProjectParams(int handle,
java.lang.String[] pparams)
handle - pparams - project parametersjava.util.Hashtable<java.lang.String,java.lang.String> getProjectParams(int handle)
handle - java.lang.String getProjectStatistic(int handle,
java.lang.String key)
handle - key - to statistics datajava.util.Hashtable<java.lang.String,java.lang.String> getProjectStatistics(int handle)
handle - void printStatistics(int handle)
handle - void printStatistics(int handle,
java.io.PrintStream out)
handle - out - java.lang.String getStatisticsString(int handle)
handle - java.lang.String getProjectParamValue(int handle,
java.lang.String key)
handle - key - the project parameter keyint getProjectParamCount(int handle)
handle - java.lang.String getProjectParamName(int handle,
int index)
handle - index - the parameter indexint modifyPerm(int projectid,
java.lang.String username,
java.lang.String perms)
projectid - username - perms - java.util.Vector getProjectJobsByStatus(int handle,
int status)
handle - status - job statusjava.util.Hashtable getJobInfo(int handle,
long jobid)
handle - jobid - the id of the jobint sendJobCommand(long jobid,
java.lang.String command)
jobid - the id of the jobcommand - the commandint sendJobCommand(int handle,
long jobid,
java.lang.String command)
handle - jobid - the id of the jobcommand - the commandint sendJobPostParameter(long jobid,
java.lang.String command)
jobid - the id of the jobcommand - the parameters to parseint sendJobPostParameter(int handle,
long jobid,
java.lang.String command)
handle - jobid - the id of the jobcommand - the parameters to parseint sendJobPostParameter(java.lang.String[] jobids,
java.lang.String command)
jobids - the ids of the jobscommand - the parameters to parseint sendJobPostParameter(int handle,
java.lang.String[] jobids,
java.lang.String command)
handle - jobids - the ids of the jobscommand - the parameters to parsejava.util.Vector getActiveProjects()
java.util.Vector getWaitingProjects()
int registerHandleCallback(int handle,
java.lang.String type,
HandleCallback callback)
int unregisterHandleCallback(int handle,
java.lang.String type,
HandleCallback callback)
int registerHandleCallback(int handle,
Handle.HandleCallbackType type,
HandleCallback callback)
int unregisterHandleCallback(int handle,
Handle.HandleCallbackType type,
HandleCallback callback)
int postProcessed(int handle,
int count)