proper.remote.messages
Class JobMessage

java.lang.Object
  extended by proper.core.ProperObject
      extended by proper.remote.messages.Message
          extended by proper.remote.messages.JobMessage
All Implemented Interfaces:
ProperInterface

public class JobMessage
extends Message

This class encapsulates a JobMessage, where the job is inside the <body> tag of the Message.
The actual Job looks like this:

    ...
    <body>
       <job>
          <status>ready|finished|failed</status>
          <run>class call with parameters</run>
          <additional>
             <run>some (optional) additional task</run>
             ...
          </additional>
       </job>
    </body>
    ...
 

Version:
$Revision: 1.2 $
Author:
FracPete
See Also:
Message

Field Summary
static java.lang.String ADDITIONAL
          the additional tag
static java.lang.String JOB
          the job tag
static java.lang.String RUN
          the run tag
static java.lang.String STATUS
          the status tag
static java.lang.String STATUS_FAILED
           
static java.lang.String STATUS_FINISHED
           
static java.lang.String STATUS_READY
           
 
Fields inherited from class proper.remote.messages.Message
BODY, FROM, HEADER, IP, MESSAGE, PORT, TYPE
 
Fields inherited from interface proper.core.ProperInterface
VERSION
 
Constructor Summary
JobMessage()
          initializes the object
JobMessage(Message msg)
          initializes the object with the given Message
JobMessage(java.io.Reader reader)
          initializes the object with the given xml data
JobMessage(java.lang.String job)
          initializes the job with the given Job
 
Method Summary
 void clearBody()
          sets the body back to standard
 Element getAdditional()
          returns the Additional tag
 java.lang.String getAdditionalLine(int index)
          returns all the content of the specified additional line
 java.util.Vector getAdditionalLines()
          returns all the content of the additional nodes
 Element getJob()
          returns the Job tag
 java.lang.String getJobData()
          returns the job data in one string
 java.lang.String getRun()
          returns the class call of the job
 java.lang.String getStatus()
          returns the status of the job
 boolean isOtherMessage(Message msg)
          checks whether this message is of a different type, is used to determine whether the body has to be cleared if the data is copied from another Message
static void main(java.lang.String[] args)
          for testing only
 void setJobData(java.lang.String job)
          fills the body of the message with the given job
 void setRun(java.lang.String run)
          sets the class call of the job
 void setStatus(java.lang.String status)
          sets the status of the job
 
Methods inherited from class proper.remote.messages.Message
clear, getBody, getBodyContent, getContent, getContent, getContent, getContent, getContent, getHeader, getIP, getPort, getType, setBodyContent, setContent, setIP, setPort, setType, toString
 
Methods inherited from class proper.core.ProperObject
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JOB

public static final java.lang.String JOB
the job tag

See Also:
Constant Field Values

STATUS

public static final java.lang.String STATUS
the status tag

See Also:
Constant Field Values

RUN

public static final java.lang.String RUN
the run tag

See Also:
Constant Field Values

ADDITIONAL

public static final java.lang.String ADDITIONAL
the additional tag

See Also:
Constant Field Values

STATUS_READY

public static final java.lang.String STATUS_READY
See Also:
Constant Field Values

STATUS_FINISHED

public static final java.lang.String STATUS_FINISHED
See Also:
Constant Field Values

STATUS_FAILED

public static final java.lang.String STATUS_FAILED
See Also:
Constant Field Values
Constructor Detail

JobMessage

public JobMessage()
initializes the object


JobMessage

public JobMessage(java.io.Reader reader)
initializes the object with the given xml data


JobMessage

public JobMessage(Message msg)
initializes the object with the given Message


JobMessage

public JobMessage(java.lang.String job)
initializes the job with the given Job

See Also:
Job
Method Detail

isOtherMessage

public boolean isOtherMessage(Message msg)
checks whether this message is of a different type, is used to determine whether the body has to be cleared if the data is copied from another Message

See Also:
JobMessage(Message), clearBody()

clearBody

public void clearBody()
sets the body back to standard

Overrides:
clearBody in class Message

setJobData

public void setJobData(java.lang.String job)
fills the body of the message with the given job

See Also:
Job

getJobData

public java.lang.String getJobData()
returns the job data in one string

See Also:
Job

getJob

public Element getJob()
returns the Job tag


getAdditional

public Element getAdditional()
returns the Additional tag


getAdditionalLines

public java.util.Vector getAdditionalLines()
returns all the content of the additional nodes


getAdditionalLine

public java.lang.String getAdditionalLine(int index)
returns all the content of the specified additional line


getStatus

public java.lang.String getStatus()
returns the status of the job


setStatus

public void setStatus(java.lang.String status)
sets the status of the job


getRun

public java.lang.String getRun()
returns the class call of the job


setRun

public void setRun(java.lang.String run)
sets the class call of the job


main

public static void main(java.lang.String[] args)
for testing only