org.weborganic.berlioz.content
Class ServiceStatusRule

java.lang.Object
  extended by org.weborganic.berlioz.content.ServiceStatusRule

public final class ServiceStatusRule
extends Object

Defines the business logic to calculating the status code of a service.

All class attributes are immutable and have a value (they are never null).

Since:
Berlioz 0.8
Version:
Berlioz 0.8.3 - 1 July 2011
Author:
Christophe Lauret

Nested Class Summary
static class ServiceStatusRule.CodeRule
          How is the status code for the determined.
static class ServiceStatusRule.SelectType
          How the generator should be selected.
 
Method Summary
 boolean appliesTo(String nameOrTarget)
          Indicates whether this rule applies to the generator name or target.
 boolean appliesToAll()
          Indicates whether this rule applies to all the generators.
 List<String> items()
           
static ServiceStatusRule newInstance(String use, String rule)
          Create a new rule instance.
 ServiceStatusRule.CodeRule rule()
           
 String toString()
           
 ServiceStatusRule.SelectType use()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

use

public ServiceStatusRule.SelectType use()
Returns:
How the generator should be selected.

items

public List<String> items()
Returns:
The names or targets of the generators to select.

appliesTo

public boolean appliesTo(String nameOrTarget)
Indicates whether this rule applies to the generator name or target.

Parameters:
nameOrTarget - The name or target of the generator.
Returns:
true if this rule applies to all the generators; false otherwise.

appliesToAll

public boolean appliesToAll()
Indicates whether this rule applies to all the generators.

Returns:
true if this rule applies to all the generators; false otherwise.

rule

public ServiceStatusRule.CodeRule rule()
Returns:
How is the status code for the determined.

toString

public String toString()
Overrides:
toString in class Object

newInstance

public static ServiceStatusRule newInstance(String use,
                                            String rule)
Create a new rule instance.

Parameters:
use - the use definition
rule - the code rule.
Returns:
the corresponding rule.
Throws:
NullPointerException - If the use parameter is null.
IllegalArgumentException - If either argument is invalid.