pt.digitalis.iss
Class ServiceRequest

java.lang.Object
  extended by pt.digitalis.iss.ServiceRequest

public class ServiceRequest
extends Object

This class holds information about a service request made to the ISS. It stores the process to execute, it's state, start and end times and results.

Author:
Rodrigo Gonçalves rgoncalves@digitalis.pt

Constructor Summary
ServiceRequest(IProcess aProcess, String id)
          Constructor.
 
Method Summary
 long getArrivalTime()
          Arrival time inspector.
 long getBeginExecutionTime()
          Returns the time when the request was made.
 long getFinishExecutionTime()
          Returns the time when the request finished it's execution.
 IProcess getProcess()
          Returns the process associated with this request.
 String getRequestID()
          Returns the request ID.
 Map<String,Object> getResults()
          Returns the Process execution results
 ProcessState getState()
          Returns the request's state.
 boolean isAsynchronousRequest()
          Asynchronous request flag inspector.
 void setArrivalTime(long arrivalTime)
          Arrival time modifier.
 void setBeginExecutionTime(long beginExecutionTime)
          Sets the time when the request was made.
 void setFinishExecutionTime(long endTime)
          Sets the time when the request finished it's execution.
 void setResults(Map<String,Object> newResults)
          Sets the Process execution results
 void setState(ProcessState state)
          Set the request's state.
 String toString()
          Returns the Service Request representation as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceRequest

public ServiceRequest(IProcess aProcess,
                      String id)
Constructor. Builds a new Service Request for the passed IProcess. Also sets the arrival time.

Parameters:
aProcess - the process associated with this request
id - the passed request id or a generated if it's null
Method Detail

getFinishExecutionTime

public long getFinishExecutionTime()
Returns the time when the request finished it's execution.

Returns:
the endTime

setFinishExecutionTime

public void setFinishExecutionTime(long endTime)
Sets the time when the request finished it's execution.

Parameters:
endTime - the endTime to set

getBeginExecutionTime

public long getBeginExecutionTime()
Returns the time when the request was made.

Returns:
the startTime

setBeginExecutionTime

public void setBeginExecutionTime(long beginExecutionTime)
Sets the time when the request was made.

Parameters:
beginExecutionTime - the new value to set

getState

public ProcessState getState()
Returns the request's state.
To be used by the ISS client.

Returns:
the state

setState

public void setState(ProcessState state)
Set the request's state. If the state is set to QUEUED the request is marked as asynchronous.

Parameters:
state - the state to set

getProcess

public IProcess getProcess()
Returns the process associated with this request.

Returns:
the process

getRequestID

public String getRequestID()
Returns the request ID.

Returns:
the requestID

getResults

public Map<String,Object> getResults()
Returns the Process execution results

Returns:
the process execution results

setResults

public void setResults(Map<String,Object> newResults)
Sets the Process execution results

Parameters:
newResults - the results to set

toString

public String toString()
Returns the Service Request representation as a String.

Overrides:
toString in class Object
Returns:
the request's String representation.

getArrivalTime

public long getArrivalTime()
Arrival time inspector.

Returns:
the arrivalTime value

setArrivalTime

public void setArrivalTime(long arrivalTime)
Arrival time modifier.

Parameters:
arrivalTime - the arrivalTime value to set

isAsynchronousRequest

public boolean isAsynchronousRequest()
Asynchronous request flag inspector.

Returns:
the isAsynchronousRequest value


Copyright © 2010 Digitalis Informática Lda. All Rights Reserved.