org.palo.api
Interface Rule


public interface Rule

The Rule interface represents an enterprise rule definition for a palo Cube. It is characterized by its id and a raw rule definition. Furthermore a rule corresponds to only one cube.

Version:
$Id: Rule.html,v 1.17 2009/07/09 11:01:46 ArndHouben Exp $

Method Summary
 java.lang.String getComment()
          Returns an optional comment for this rule or null if none was set.
 Cube getCube()
          Returns the Cube which is affected by this rule
 java.lang.String getDefinition()
          Returns the rule definition, i.e. its textual representation
 java.lang.String getExternalIdentifier()
          Returns the optional external identifier or null if none was set
 java.lang.String getId()
          Returns the unique identifier for this rule instance
 long getTimestamp()
          Returns the creation time of this rule in milliseconds since 1970-01-01
 boolean isActive()
          Returns true if this rule is currently active, otherwise false
 void setActive(boolean activate)
          Activates or deactivates this rule.
 void setComment(java.lang.String comment)
          Sets an optional comment for this rule.
 void setDefinition(java.lang.String definition)
          Sets a definition for this rule.
 void setExternalIdentifier(java.lang.String externalId)
          Sets a new external identifier string to use inside rule definition instead of definition name.
 void setExternalIdentifier(java.lang.String externalId, boolean useIt)
          Sets a new external identifier string and use it inside rule definition NOTE: this will update current rule and therefore performs a server request!
 void update(java.lang.String definition, java.lang.String externalIdentifier, boolean useIt, java.lang.String comment)
          Updates this rule with the given parameters.
 void update(java.lang.String definition, java.lang.String externalIdentifier, boolean useIt, java.lang.String comment, boolean activate)
          Updates this rule with the given parameters.
 void useExternalIdentifier(boolean useIt)
          En- or disables the usage of a specified external identifier.
 

Method Detail

getId

java.lang.String getId()
Returns the unique identifier for this rule instance

Returns:
the rule id

getCube

Cube getCube()
Returns the Cube which is affected by this rule

Returns:
the affected cube

setDefinition

void setDefinition(java.lang.String definition)
Sets a definition for this rule. NOTE: this will update current rule and therefore performs a server request!

Parameters:
definition - new rule definition

getDefinition

java.lang.String getDefinition()
Returns the rule definition, i.e. its textual representation

Returns:
the rule definition

getTimestamp

long getTimestamp()
Returns the creation time of this rule in milliseconds since 1970-01-01

Returns:
the creation time in milliseconds since 1970-01-01

setComment

void setComment(java.lang.String comment)
Sets an optional comment for this rule. NOTE: this will update current rule and therefore performs a server request!

Parameters:
comment - a rule comment

getComment

java.lang.String getComment()
Returns an optional comment for this rule or null if none was set.

Returns:
the rule comment or null if none was set

setExternalIdentifier

void setExternalIdentifier(java.lang.String externalId)
Sets a new external identifier string to use inside rule definition instead of definition name. NOTE: this will update current rule and therefore performs a server request!

Parameters:
externalId - the identifier to use

setExternalIdentifier

void setExternalIdentifier(java.lang.String externalId,
                           boolean useIt)
Sets a new external identifier string and use it inside rule definition NOTE: this will update current rule and therefore performs a server request!

Parameters:
externalId - the identifier to use
useIt - set to true if new identifier should be used in rule defintion, to false otherwise

getExternalIdentifier

java.lang.String getExternalIdentifier()
Returns the optional external identifier or null if none was set

Returns:
external identifier or null

useExternalIdentifier

void useExternalIdentifier(boolean useIt)
En- or disables the usage of a specified external identifier. If no identifier was specified calling this method has no effect. NOTE: this will update current rule and therefore performs a server request!


update

void update(java.lang.String definition,
            java.lang.String externalIdentifier,
            boolean useIt,
            java.lang.String comment)
Updates this rule with the given parameters. NOTE: this will update current rule and therefore performs a server request!

Parameters:
definition - the new rule definition
externalIdentifier - the new rule external identifier
useIt - specify if external identifier should be used
comment - a comment

update

void update(java.lang.String definition,
            java.lang.String externalIdentifier,
            boolean useIt,
            java.lang.String comment,
            boolean activate)
Updates this rule with the given parameters. NOTE: this will update current rule and therefore performs a server request!

Parameters:
definition - the new rule definition
externalIdentifier - the new rule external identifier
useIt - specify if external identifier should be used
comment - a comment
activate - specify if this rule should be activated or deactivated

isActive

boolean isActive()
Returns true if this rule is currently active, otherwise false

Returns:
true if this rule is active, false otherwise

setActive

void setActive(boolean activate)
Activates or deactivates this rule. NOTE: this will update current rule and therefore performs a server request!

Parameters:
activate - specify true to activate this rule or false to deactivate it.