org.specrunner.core.pipes
Class PipeModel

java.lang.Object
  extended by org.specrunner.core.pipes.PipeModel
All Implemented Interfaces:
IPipe

public class PipeModel
extends Object
implements IPipe

Add a model information to the channel.

Author:
Thiago Santos

Field Summary
static String FREE
          Free model information.
static String MAX
          Max model information.
static String MODEL
          Model.
static String TIME
          Time model information.
static String TOTAL
          Total model information.
 
Constructor Summary
PipeModel()
           
 
Method Summary
 boolean check(IChannel channel)
          Check if a pipe must perform something on channel.
protected  Map<String,Object> create(IChannel channel)
          Creates the default model.
 IChannel process(IChannel channel)
          Perform some transformation over the channel.
static Map<String,Object> recover(IChannel channel)
          Recover the model from channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODEL

public static final String MODEL
Model.

See Also:
Constant Field Values

TIME

public static final String TIME
Time model information.

See Also:
Constant Field Values

FREE

public static final String FREE
Free model information.

See Also:
Constant Field Values

TOTAL

public static final String TOTAL
Total model information.

See Also:
Constant Field Values

MAX

public static final String MAX
Max model information.

See Also:
Constant Field Values
Constructor Detail

PipeModel

public PipeModel()
Method Detail

check

public boolean check(IChannel channel)
              throws AbortException
Description copied from interface: IPipe
Check if a pipe must perform something on channel. If the channel is corrupted the pipe must throw AbortException.

Specified by:
check in interface IPipe
Parameters:
channel - The information channel.
Returns:
true, if pipe must perform something on channel, false, otherwise.
Throws:
AbortException - If the channel is corrupted.

process

public IChannel process(IChannel channel)
                 throws PipelineException
Description copied from interface: IPipe
Perform some transformation over the channel.

Specified by:
process in interface IPipe
Parameters:
channel - The channel.
Returns:
The pipe itself.
Throws:
PipelineException - On processing errors.

create

protected Map<String,Object> create(IChannel channel)
                             throws NotFoundException,
                                    InvalidTypeException
Creates the default model.

Parameters:
channel - The channel.
Returns:
A model mapping.
Throws:
InvalidTypeException - On type error.
NotFoundException - On not found resources.

recover

public static Map<String,Object> recover(IChannel channel)
                                  throws NotFoundException,
                                         InvalidTypeException
Recover the model from channel.

Parameters:
channel - The channel.
Returns:
The model.
Throws:
NotFoundException - On lookup errors.
InvalidTypeException - On type errors.


Copyright © 2014. All rights reserved.