|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optimizationservices.oscommon.representationparser.OSgLWriter
org.optimizationservices.oscommon.representationparser.OSpLWriter
public class OSpLWriter
The OSpLWriter
class is used to construct an instance that follows
the OSpL format.
Field Summary |
---|
Fields inherited from class org.optimizationservices.oscommon.representationparser.OSgLWriter |
---|
m_document |
Constructor Summary | |
---|---|
OSpLWriter()
constructor. |
Method Summary | |
---|---|
boolean |
addOtherProcess(java.lang.String name,
java.lang.String value,
java.lang.String description)
Add an other process element. |
static void |
main(java.lang.String[] argv)
main for test purposes. |
boolean |
setAvailableDiskSpace(double availableDiskSpace)
Set the available disk space (in bytes). |
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 |
setOSProcess(OSProcess osProcess)
set the OSProcess, a standard os process interface. |
boolean |
setOtherProcesses(java.lang.String[] names,
java.lang.String[] values,
java.lang.String[] descriptions)
Set the other process related elements. |
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 ([0, 1]). |
boolean |
setTimeLastJobEnded(java.util.GregorianCalendar timeLastJobEnded)
Set the time that the last job ended. |
boolean |
setTimeLastJobTook(double timeLastJobTook)
Set the time that the last job took (in seconds). |
boolean |
setTimeServiceStarted(java.util.GregorianCalendar timeServiceStarted)
Set the time that service last started. |
boolean |
setTotalJobsSoFar(int totalJobsSoFar)
Set the total jobs received so far. |
Methods inherited from class org.optimizationservices.oscommon.representationparser.OSgLWriter |
---|
getDocument, setDocument, writeToFile, writeToSring, writeToStandardOutput |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OSpLWriter()
Method Detail |
---|
public boolean setOSProcess(OSProcess osProcess) throws java.lang.Exception
osProcess
- holds the standard os process interface.
java.lang.Exception
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 boolean setRequestDescription(java.lang.String description)
description
- holds the request description
public boolean setResponseStatus(java.lang.String status)
status
- holds the response status, which can be:
success, error, warning.
public boolean setResponseDescription(java.lang.String description)
description
- holds the response description
public boolean setServiceURI(java.lang.String serviceURI)
serviceURI
- holds the uri of the service.
public boolean setServiceName(java.lang.String serviceName)
serviceName
- holds the name of the service.
public boolean setProcessTime(java.util.GregorianCalendar time)
time
- holds the time of the last process update.
public boolean setProcessMessage(java.lang.String message)
message
- holds the process message.
public boolean setProcessStatistics(ProcessStatistics processStatistics)
processStatistics
- holds the process statistics.
public boolean setCurrentState(java.lang.String currentState)
currentState
- holds the current state, which can be:
"busy", "busyButAccepting", "idle", "idleButNotAccepting" or "noResponse".
public boolean setAvailableDiskSpace(double availableDiskSpace)
availableDiskSpace
- holds the available disk space.
public boolean setAvailableMemory(double availableMemory)
availableMemory
- holds the available memory.
public boolean setCurrentJobCount(int currentJobCount)
currentJobCount
- holds the current job count.
public boolean setTotalJobsSoFar(int totalJobsSoFar)
totalJobsSoFar
- holds the total jobs received so far.
public boolean setTimeLastJobEnded(java.util.GregorianCalendar timeLastJobEnded)
timeLastJobEnded
- holds the time (xs:dateTime) that the last job ended.
public boolean setTimeLastJobTook(double timeLastJobTook)
timeLastJobTook
- holds the number of seconds that the last job took.
public boolean setTimeServiceStarted(java.util.GregorianCalendar timeServiceStarted)
timeServiceStarted
- holds the time (xs:dateTime) that the service last started.
public boolean setServiceUtilization(double serviceUtilization)
serviceUtilization
- holds the service utilization (busy time/total time).
public boolean setJobStatistics(JobStatistics[] jobStatistics)
jobStatistics
- holds an array of jobStatistics with
each member corresponding to one job.
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 boolean setOtherProcesses(java.lang.String[] names, java.lang.String[] values, java.lang.String[] descriptions)
names
- holds the names of the other processes. It is required.values
- holds the values of the other processs, empty String "" if no value for an process.descriptions
- holds the descriptions of the other processs, empty String "" if no value for an process, null for
the entire array if none of the processs have descriptions.
public boolean addOtherProcess(java.lang.String name, java.lang.String value, java.lang.String description)
name
- holds the name of the other process element. It is required.value
- holds the value of the other process element, empty String "" if none.description
- holds the description of the other process element, empty String "" if none.
public static void main(java.lang.String[] argv)
argv
- command line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |