Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Lightweight Bartering Grid
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## lbg.task
Class TaskOutput

    java.lang.Object
      lbg.task.TaskOutput

All Implemented Interfaces:
  java.io.Serializable

    public class TaskOutput

extends java.lang.Object
implements java.io.Serializable

A TaskOutput is an immutable Object that contains both data and metadata resulting from the successful execution of the target Task by a Resource of the target Supplier Peer.

Author:
  Cyril Briquet, XavierDalem
See Also:
  Serialized Form

Constructor Summary
`TaskOutput(Task t, java.lang.String supplier_peer_id, long start_time, GridData data, byte[] logs, int power)` Constructs a new TaskOutput.

Method Summary
`byte[]` | `getLog()` Log.
`GridData` | `getOutputData()` Output data.
`boolean` | `isLocalTask()` Indicates whether the Task has been executed by its owner Peer, or by a Supplier Peer.
`boolean` | `isSupplyingTask()` Indicates whether the Task has been executed by its owner Peer, or by a Supplier Peer.
`int` | `resourcePower()` Power of the Resource that run the Task.
`long` | `runtime()` Effective Task runtime (i.e.
`java.lang.String` | `supplierID()` Peer that executed the Task.
`long` | `taskEndTime()` Time at which Task execution was effectively completed.
`long` | `taskStartTime()` Time at which Task execution was effectively started.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### TaskOutput

    public TaskOutput(Task t,
                      java.lang.String supplier_peer_id,
                      long start_time,
                      GridData data,
                      byte[] logs,
                      int power)
               throws GridException

  Constructs a new TaskOutput.

  Parameters:
    `t` - target Task
    `supplier_peer_id` - Supplier Peer id
    `start_time` - Task start time
    `data` - Task execution results
    `power` - power of the Resource that executed the Task
  Throws:
    `GridException`

Method Detail

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### supplierID

    public java.lang.String supplierID()

  Peer that executed the Task.

  Returns:
    Supplier Peer id

### isLocalTask

    public boolean isLocalTask()

  Indicates whether the Task has been executed by its owner Peer, or by a Supplier Peer.

  Returns:
    true if the Task has been executed by its owner Peer

### isSupplyingTask

    public boolean isSupplyingTask()

  Indicates whether the Task has been executed by its owner Peer, or by a Supplier Peer.

  Returns:
    true if the Task has been executed by a Supplier Peer

### taskStartTime

    public long taskStartTime()

  Time at which Task execution was effectively started.

  Returns:
    Task execution start time

### taskEndTime

    public long taskEndTime()

  Time at which Task execution was effectively completed.

  Returns:
    Task execution end time

### runtime

    public long runtime()

  Effective Task runtime (i.e. excluding queueing), as set by the Supplier.

  This information should be used in SIM mode only, as it may be unreliable in LIVE mode.

  Returns:
    effective Task runtime

### resourcePower

    public int resourcePower()

  Power of the Resource that run the Task.

  This information should be used in SIM mode only, as it is meaningless (i.e. arbitrary value, really) in LIVE mode.

  Returns:
    power of the Resource that run the Task.

### getOutputData

    public GridData getOutputData()
                           throws GridException

  Output data.

  Throws:
    `GridException`

### getLog

    public byte[] getLog()
                  throws GridException

  Log.

  Throws:
    `GridException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Lightweight Bartering Grid
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

> Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.