uk.ac.ncl.cs.instantsoap.wsapi
Class NonBlockingInvocationResponse

java.lang.Object
  extended by uk.ac.ncl.cs.instantsoap.wsapi.NonBlockingInvocationResponse

public class NonBlockingInvocationResponse
extends Object

The return value for a non-blocking, synchronous invocation.

A fully-populated non-blocking response can be in one of two modes - pending or completed. If it is in the pending mode, then the Status property will have the value JobPending and the wait and unit properties will be populated. If it is in JobCompleted mode, results properties will be populated. Regardless, the uuid property will always be populated, to indicate which job this response pertains to.

Author:
Cheng-Yang(Louis) Tang, Matthew Pocock

Constructor Summary
NonBlockingInvocationResponse()
          Create a new instance with all fields set to null.
NonBlockingInvocationResponse(UUID uuid, int wait, TimeUnit unit)
          Create a new instance in the JobPending state.
NonBlockingInvocationResponse(UUID uuid, Map<String,String> results)
          Create a new instance in the JobCompleted state.
 
Method Summary
 boolean equals(Object o)
           
 JobStatus getJobStatus()
          Get the job status.
 Map<String,String> getResults()
          Get the results for this response.
 TimeUnit getUnit()
          Get the time unit specifying how to interpret the wait.
 UUID getUuid()
          Get the uuid of the job assicoated with this response.
 int getWait()
          Get the new wait time.
 int hashCode()
           
 void setJobStatus(JobStatus status)
          Set the job status.
 void setResults(Map<String,String> results)
          Set the results for this response.
 void setUnit(TimeUnit unit)
          Set the time unit specifying how to interpret the wait.
 void setUuid(UUID uuid)
          Set the uuid of the job associated with this response.
 void setWait(int wait)
          Set the wait time.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NonBlockingInvocationResponse

public NonBlockingInvocationResponse()
Create a new instance with all fields set to null.


NonBlockingInvocationResponse

public NonBlockingInvocationResponse(UUID uuid,
                                     int wait,
                                     TimeUnit unit)
Create a new instance in the JobPending state.

Parameters:
uuid - the UUID of the job
wait - how long to wait
unit - a TimeUnit that should be used to interpret wait

NonBlockingInvocationResponse

public NonBlockingInvocationResponse(UUID uuid,
                                     Map<String,String> results)
Create a new instance in the JobCompleted state.

This takes ownership of the results. Do not modify it.

Parameters:
uuid - the UUID of the job
results - a Map containing the results
Method Detail

getUuid

public UUID getUuid()
Get the uuid of the job assicoated with this response.

Returns:
the UUID

setUuid

public void setUuid(UUID uuid)
Set the uuid of the job associated with this response.

Parameters:
uuid - the new UUID

getWait

public int getWait()
Get the new wait time.

Returns:
the wait time

setWait

public void setWait(int wait)
Set the wait time.

Parameters:
the - new wait time

getUnit

public TimeUnit getUnit()
Get the time unit specifying how to interpret the wait.

Returns:
the TimeUnit

setUnit

public void setUnit(TimeUnit unit)
Set the time unit specifying how to interpret the wait.

Parameters:
unit - the TimeUnit to use

getResults

public Map<String,String> getResults()
Get the results for this response.

Returns:
the results

setResults

public void setResults(Map<String,String> results)
Set the results for this response.

Parameters:
results - a Map containing result values

getJobStatus

public JobStatus getJobStatus()
Get the job status.

Returns:
the JobStatus

setJobStatus

public void setJobStatus(JobStatus status)
Set the job status.

Parameters:
status - the new JobStatus

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2008. All Rights Reserved.