|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optimizationservices.oscommon.localinterface.OSProcess
public class OSProcess
The OSProcess
class is a local interface for storing Optimization Services
process. Its design follows the Optimization Services process Language (OSpL).
All the data structures in this class are standards specified in OSbL.
Field Summary | |
---|---|
ProcessData |
processData
processData holds the second child of the OSProcess specified by the OSpL Schema. |
ProcessHeader |
processHeader
processHeader holds the first child of the OSProcess specified by the OSpL Schema. |
Constructor Summary | |
---|---|
OSProcess()
Default constructor. |
Method Summary | |
---|---|
double |
getAvailableDiskSpace()
Get the available disk space (in bytes). |
double |
getAvailableMemory()
Get the available memory (in bytes). |
int |
getCurrentJobCount()
Get the current job count. |
java.lang.String |
getCurrentState()
Get the current state, , which can be: "busy", "busyButAccepting", "idle", "idleButNotAccepting" and "noResponse". |
JobStatistics[] |
getJobStatistics()
Get the statistics of all the jobs. |
JobOptimization[] |
getOptimizationProcess()
Get the optimization process of all the jobs, which are in effect intermediate (or occasionally final) optimization results. |
java.util.Hashtable<java.lang.String,java.lang.String> |
getOtherProcessDescriptions()
get a hashmap of other process descriptions. |
java.lang.String[] |
getOtherProcessNames()
get a string array of names of other processes. |
java.util.Hashtable<java.lang.String,java.lang.String> |
getOtherProcessValues()
get a hashmap of other process values. |
java.lang.String |
getProcessMessage()
Get the process message. |
ProcessStatistics |
getProcessStatistics()
Get the process statistics. |
java.util.GregorianCalendar |
getProcessTime()
Get time of the last process update. |
java.lang.String |
getRequestAction()
Get the request action, which can be: ping, notifyJobCompletion, requestJob, getServiceStatistics, setServiceStatistics, getJobStatistics, setJobStatistics, getOptimization, setOptimization, getAll, setAll. |
java.lang.String |
getRequestDescription()
Get the request description. |
java.lang.String |
getResponseDescription()
Get the response description. |
java.lang.String |
getResponseStatus()
Get the response status, which can be: success, error, warning. |
java.lang.String |
getServiceName()
Get service name. |
java.lang.String |
getServiceURI()
Get service uri. |
double |
getServiceUtilization()
Get the service utilization ([0, 1]). |
java.util.GregorianCalendar |
getTimeLastJobEnded()
Get the time last job ended. |
double |
getTimeLastJobTook()
Get the time last job took (in seconds). |
java.util.GregorianCalendar |
getTimeServiceStarted()
Get the time the service started. |
int |
getTotalJobsSoFar()
Get the total jobs received so far. |
static void |
main(java.lang.String[] args)
main for test purposes. |
OSProcess |
readOSpL(java.lang.String ospl,
boolean isFile,
boolean validate)
read an OSpL instance and return and OSProcess object. |
boolean |
setAvailableDiskSpace(double availableDiskSpace)
Set the available disk space. |
boolean |
setAvailableMemory(double availableMemory)
Set the available memory (in bytes). |
boolean |
setCurrentJobCount(int currentJobCount)
Set the current job count. |
boolean |
setCurrentState(java.lang.String currentState)
Set the current state. |
boolean |
setJobStatistics(JobStatistics[] jobStatistics)
Set the statistics of all jobs. |
boolean |
setOptimizationProcess(JobOptimization[] optimizationProcess)
Set the optimization process of all the jobs, which are in effect intermediate (or occasionally final) optimization results. |
boolean |
setOtherProcesses(java.lang.String[] names,
java.lang.String[] descriptions,
java.lang.String[] values)
set other processes, with their names (required), descriptions (optional) and values (optional). |
boolean |
setProcessMessage(java.lang.String message)
Set the process message. |
boolean |
setProcessStatistics(ProcessStatistics processStatistics)
Set the process statistics. |
boolean |
setProcessTime(java.util.GregorianCalendar time)
Set time of the last process update. |
boolean |
setRequestAction(java.lang.String action)
Set the request action. |
boolean |
setRequestDescription(java.lang.String description)
Set the request description. |
boolean |
setResponseDescription(java.lang.String description)
Set the response description. |
boolean |
setResponseStatus(java.lang.String status)
Set the response status. |
boolean |
setServiceName(java.lang.String serviceName)
Set service name. |
boolean |
setServiceURI(java.lang.String serviceURI)
Set service uri. |
boolean |
setServiceUtilization(double serviceUtilization)
Set the service utilization. |
boolean |
setTimeLastJobEnded(java.util.GregorianCalendar timeLastJobEnded)
Set the time last job ended. |
boolean |
setTimeLastJobTook(double timeLastJobTook)
Set the time last job took. |
boolean |
setTimeServiceStarted(java.util.GregorianCalendar timeServiceStarted)
Set the time the service started. |
boolean |
setTotalJobsSoFar(int totalJobsSoFar)
Set the total jobs received so far. |
java.lang.String |
writeOSpL()
write the OSProcess to an ospl xml string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public ProcessHeader processHeader
public ProcessData processData
Constructor Detail |
---|
public OSProcess()
Method Detail |
---|
public OSProcess readOSpL(java.lang.String ospl, boolean isFile, boolean validate) throws java.lang.Exception
ospl
- holds the optimization process in a string which format follows the
Optimization Services process Language (OSpL) schema.isFile
- holds whether the ospl string is a file name or a string that literally holds the ospl contents.validate
- holds whether the reader should be validating against the schema or not.
java.lang.Exception
- if there are errors in reading the string or setting the OSProcess.public java.lang.String writeOSpL() throws java.lang.Exception
java.lang.Exception
- if there are errors in writing the ospl string.public java.lang.String getRequestAction()
public boolean setRequestAction(java.lang.String action)
action
- holds the request action, which can be:
ping, notifyJobCompletion, requestJob, getServiceStatistics, setServiceStatistics,
getJobStatistics, setJobStatistics, getOptimization, setOptimization, getAll, setAll.
public java.lang.String getRequestDescription()
public boolean setRequestDescription(java.lang.String description)
description
- holds the request description
public java.lang.String getResponseStatus()
public boolean setResponseStatus(java.lang.String status)
status
- holds the response status, which can be:
success, error, warning.
public java.lang.String getResponseDescription()
public boolean setResponseDescription(java.lang.String description)
description
- holds the response description
public java.lang.String getServiceName()
public boolean setServiceName(java.lang.String serviceName)
serviceName
- holds the name of the service.
public java.lang.String getServiceURI()
public boolean setServiceURI(java.lang.String serviceURI)
serviceURI
- holds the uri of the service.
public java.util.GregorianCalendar getProcessTime()
public boolean setProcessTime(java.util.GregorianCalendar time)
time
- holds the time of the last process update.
public java.lang.String getProcessMessage()
public boolean setProcessMessage(java.lang.String message)
message
- holds the process message.
public ProcessStatistics getProcessStatistics()
public boolean setProcessStatistics(ProcessStatistics processStatistics)
processStatistics
- holds the process statistics.
public java.lang.String getCurrentState()
public boolean setCurrentState(java.lang.String currentState)
currentState
- holds the current state, which can be:
"busy", "busyButAccepting", "idle", "idleButNotAccepting" or "noResponse".
public double getAvailableDiskSpace()
public boolean setAvailableDiskSpace(double availableDiskSpace)
availableDiskSpace
- holds the available disk space (in bytes).
public double getAvailableMemory()
public boolean setAvailableMemory(double availableMemory)
availableMemory
- holds the available memory.
public int getCurrentJobCount()
public boolean setCurrentJobCount(int currentJobCount)
currentJobCount
- holds the current job count.
public int getTotalJobsSoFar()
public boolean setTotalJobsSoFar(int totalJobsSoFar)
totalJobsSoFar
- holds the total jobs received so far.
public java.util.GregorianCalendar getTimeLastJobEnded()
public boolean setTimeLastJobEnded(java.util.GregorianCalendar timeLastJobEnded)
timeLastJobEnded
- holds the time last job ended.
public double getTimeLastJobTook()
public boolean setTimeLastJobTook(double timeLastJobTook)
timeLastJobTook
- holds the time last job took (in seconds).
public java.util.GregorianCalendar getTimeServiceStarted()
public boolean setTimeServiceStarted(java.util.GregorianCalendar timeServiceStarted)
timeServiceStarted
- holds the time the service started.
public double getServiceUtilization()
public boolean setServiceUtilization(double serviceUtilization)
serviceUtilization
- holds the service utilization ([0, 1]).
public JobStatistics[] getJobStatistics()
public boolean setJobStatistics(JobStatistics[] jobStatistics)
jobStatistics
- holds an array of jobStatistics with
each member corresponding to one job.
public JobOptimization[] getOptimizationProcess()
public boolean setOptimizationProcess(JobOptimization[] optimizationProcess)
optimizationProcess
- holds an array, with each member
corresponding to an optimization job. Each optimization job contains a job id string
and an optimization result, which data structure follow the OSrL schema.
public java.lang.String[] getOtherProcessNames()
public java.util.Hashtable<java.lang.String,java.lang.String> getOtherProcessDescriptions()
public java.util.Hashtable<java.lang.String,java.lang.String> getOtherProcessValues()
public boolean setOtherProcesses(java.lang.String[] names, java.lang.String[] descriptions, java.lang.String[] values)
names
- holds the names of the other processes; it is required.descriptions
- holds the descriptions of the other processes; null if none.values
- holds the values of the other processes; null if none.
public static void main(java.lang.String[] args)
argv
- command line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |