Execution Policy Elements

From JPPF Documentation version 3.x

Jump to: navigation, search

Contents

Main Page > Execution policy reference > Execution Policy Elements

NOT

Negates a test

Class name: org.jppf.node.policy.ExecutionPolicy.Not

Usage:

 policy = otherPolicy.not();

XML Element: <NOT>

Nested element: any other policy element, min = 1, max = 1

Usage:

 <NOT>
   <Equal ignoreCase="true" valueType="string">
     <Property>some.property</Property>
     <Value>some value here</Value>
   </Equal>
 </NOT>

AND

Combines multiple tests through a logical AND operator


Class name: org.jppf.node.policy.ExecutionPolicy.And

Usage:

 policy = policy1.and(policy2).and(policy3);
 policy = policy1.and(policy2, policy3);

XML Element: <AND>

Nested element: any other policy element, min = 2, max = unbounded

Usage:

 <AND>
   <Equal ignoreCase="true" valueType="string">
     <Property>some.property.1</Property>
     <Value>some value here</Value>
   </Equal>
   <LessThan>
     <Property>some.property.2</Property>
     <Value>100</Value>
   </LessThan>
   <Contains ignoreCase="true" valueType="string">
     <Property>some.property.3</Property>
     <Value>substring</Value>
   </Contains>
 </AND>

OR

Combines multiple tests through a logical OR operator

Class name: org.jppf.node.policy.ExecutionPolicy.Or

Usage:

 policy = policy1.or(policy2).or(policy3);
 policy = policy1.or(policy2, policy3);

XML Element: <OR>

Nested element: any other policy element, min = 2, max = unbounded

Usage:

 <OR>
   <Equal ignoreCase="true" valueType="string">
     <Property>some.property.1</Property>
     <Value>some value here</Value>
   </Equal>
   <LessThan>
     <Property>some.property.2</Property>
     <Value>100</Value>
   </LessThan>
   <Contains ignoreCase="true" valueType="string">
     <Property>some.property.3</Property>
     <Value>substring</Value>
   </Contains>
 </OR>

XOR

Combines multiple tests through a logical XOR operator

Class name: org.jppf.node.policy.ExecutionPolicy.Xor

Usage:

 policy = policy1.xor(policy2).xor(policy3);
 policy = policy1.xor(policy2, policy3);

XML Element: <XOR>

Nested element: any other policy element, min = 2, max = unbounded

Usage:

 <XOR>
   <Equal ignoreCase="true" valueType="string">
     <Property>some.property.1</Property>
     <Value>some value here</Value>
   </Equal>
   <LessThan>
     <Property>some.property.2</Property>
     <Value>100</Value>
   </LessThan>
   <Contains ignoreCase="true" valueType="string">
     <Property>some.property.3</Property>
     <Value>substring</Value>
   </Contains>
 </XOR>

Equal

Performs a test of type property_value = value. The value can be either numeric, boolean or a string.

Class name: org.jppf.node.policy.Equal

Constructors:

 Equal(String propertyName, boolean ignoreCase, String value)
 Equal(String propertyName, double value)
 Equal(String propertyName, boolean value)

Usage:

 policy = new Equal("some.property", true, "some_value");
 policy = new Equal("some.property", 15);
 policy = new Equal("some.property", true);

XML Element: <Equal>

Attributes:

ignoreCase: one of "true" or "false", optional, defaults to "false"

valueType: one of "string", "numeric" or "boolean", optional, defaults to "string"

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : value to compare with, min = 1, max = 1

Usage:

 <Equal ignoreCase="true" valueType="string">
   <Property>some.property</Property>
   <Value>some value here</Value>
 </Equal>

LessThan

Performs a test of type ''property_value < value''

The value can only be numeric.

Class name: org.jppf.node.policy.LessThan

Constructor:

 LessThan(String propertyName, double value)

Usage:

 policy = new LessThan("some.property", 15.50);

XML Element: <LessThan>

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : value to compare with, min = 1, max = 1

Usage:

 <LessThan>
   <Property>some.property</Property>
   <Value>15.50</Value>
 </LessThan>

AtMost

Performs a test of type ''property_value<= value''

The value can only be numeric.

Class name: org.jppf.node.policy.AtMost

Constructor:

 AtMost(String propertyName, double value)

Usage:

 policy = new AtMost("some.property", 15.49);

XML Element: <AtMost>

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : value to compare with, min = 1, max = 1

Usage:

 <AtMost>
   <Property>some.property</Property>
   <Value>15.49</Value>
 </AtMost>

MoreThan

Performs a test of type property_value > value

The value can only be numeric.

Class name: org.jppf.node.policy.MoreThan

Constructor:

 MoreThan(String propertyName, double value)

Usage:

 policy = new MoreThan("some.property", 15.50);

XML Element: <MoreThan>

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : value to compare with, min = 1, max = 1

Usage:

 <MoreThan>
   <Property>some.property</Property>
   <Value>15.50</Value>
 </MoreThan>

AtLeast

Performs a test of type property_value >= value

The value can only be numeric.

Class name: org.jppf.node.policy.AtLeast

Constructor:

 AtLeast(String propertyName, double value)

Usage:

 policy = new AtLeast("some.property", 15.51);

XML Element: <AtLeast>

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : value to compare with, min = 1, max = 1

Usage:

 <AtLeast>
   <Property>some.property</Property>
   <Value>15.51</Value>
 </AtLeast>

BetweenII

Performs a test of type ''property_value in [a, b]'' (range interval with lower and upper bounds included)

The values a and b can only be numeric.

Class name: org.jppf.node.policy.BetweenII

Constructor:

 BetweenII(String propertyName, double a, double b)

Usage:

 policy = new BetweenII("some.property", 1.5, 3.0);

XML Element: <BetweenII>

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : the bounds of the interval, min = 2, max = 2

Usage:

 <BetweenII>
   <Property>some.property</Property>
   <Value>1.5</Value>
   <Value>3.0</Value>
 </BetweenII>

BetweenIE

Performs a test of type “property_value in[a, b[“ (lower bound included, upper bound excluded)

The values a and b can only be numeric.

Class name: org.jppf.node.policy.BetweenIE

Constructor:

 BetweenIE(String propertyName, double a, double b)

Usage:

 policy = new BetweenIE("some.property", 1.5, 3.0);

XML Element: <BetweenIE>

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : the bounds of the interval, min = 2, max = 2

Usage:

 <BetweenIE>
   <Property>some.property</Property>
   <Value>1.5</Value>
   <Value>3.0</Value>
 </BetweenIE>

BetweenEI

Performs a test of type “property_value in ]a, b]” (lower bound excluded, upper bound included)

The values a and b can only be numeric.

Class name: org.jppf.node.policy.BetweenEI

Constructor:

 BetweenEI(String propertyName, double a, double b)

Usage:

 policy = new BetweenEI("some.property", 1.5, 3.0);

XML Element: <BetweenEI>

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : the bounds of the interval, min = 2, max = 2

Usage:

 <BetweenEI>
   <Property>some.property</Property>
   <Value>1.5</Value>
   <Value>3.0</Value>
 </BetweenEI>

BetweenEE

Performs a test of type “property_value in ]a, b[“ (lower and upper bounds excluded)

The values a and b can only be numeric.

Class name: org.jppf.node.policy.BetweenEE

Constructor:

 BetweenEE(String propertyName, double a, double b)

Usage:

 policy = new BetweenEE("some.property", 1.5, 3.0);

XML Element: <BetweenEE>

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : the bounds of the interval, min = 2, max = 2

Usage:

 <BetweenEE>
   <Property>some.property</Property>
   <Value>1.5</Value>
   <Value>3.0</Value>
 </BetweenEE>

Contains

Performs a test of type “'property_value contains substring”

The value can be only a string.

Class name: org.jppf.node.policy.Contains

Constructor:

 Contains(String propertyName, boolean ignoreCase, String value)

Usage:

 policy = new Contains("some.property", true, "some_substring");

XML Element: <Contains>

Attribute: ignoreCase: one of "true" or "false", optional, defaults to "false"

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : substring to lookup, min = 1, max = 1

Usage:

 <Contains ignoreCase="true">
   <Property>some.property</Property>
   <Value>some substring</Value>
 </Contains>

OneOf

Performs a test of type “property_value in { A1, ... , An }” (discrete set).

The values A1 ... An can be either all strings or all numeric.

Class name: org.jppf.node.policy.OneOf

Constructor:

 OneOf(String propertyName, boolean ignoreCase, String...values)
 OneOf(String propertyName, double...values)

Usage:

 policy = new OneOf("user.language", true, "en", "fr", "it");
 policy = new OneOf("some.property", 1.2, 5.1, 10.3);

XML Element: <OneOf>

Attributes:

ignoreCase: one of "true" or "false", optional, defaults to "false"

valueType: one of "string" or "numeric", optional, defaults to "string"

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : substring to lookup, min = 1, max = unbounded

Usage:

 <OneOf ignoreCase="true">
   <Property>user.language</Property>
   <Value>en</Value>
   <Value>fr</Value>
   <Value>it</Value>
 </OneOf>

RegExp

Performs a test of type “property_value matches regular_expression”

The regular expression must follow the syntax for the Java regular expression patterns.

Class name: org.jppf.node.policy.RegExp

Constructor:

 RegExp(String propertyName, String pattern)

Usage:

 policy = new RegExp("some.property", "a*z");

XML Element: <RegExp>

Nested elements:

<Property> : name of a node property, min = 1, max = 1

<Value> : regular expression pattern to match against, min = 1, max = 1

Usage:

 <RegExp>
   <Property>some.property</Property>
   <Value>a*z</Value>
 </RegExp>

CustomRule

Performs a user-defined test that can be specified in an XML policy document.

Class name: subclass of org.jppf.node.policy.CustomPolicy

Constructor:

 MySubclassOfCustomPolicy(String...args)

Usage:

 policy = new MySubclassOfCustomPolicy("arg 1", "arg 2", "arg 3");

XML Element: <CustomRule>

Attribute: class: fully qualified name of a policy class, required

Nested element: <Arg> : custom rule parameters, min = 0, max = unbounded

Usage:

 <CustomRule class="my.sample.MySubclassOfCustomPolicy">
   <Arg>arg 1</Arg>
   <Arg>arg 2</Arg>
   <Arg>arg 3</Arg>
 </CustomRule>


Main Page > Execution policy reference > Execution Policy Elements

Support This Project Powered by MediaWiki