public class ResourceCondition extends java.lang.Object implements Rule.Condition
| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceCondition.EditableResourceCondition
This class serves as a mutable version of Resource Action.
|
static class |
ResourceCondition.OperatorType
An enum defining inequality operators applicable to decide the resource condition.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_RESOURCE_CONDITION_ID
Default value for
id. |
| Modifier | Constructor and Description |
|---|---|
|
ResourceCondition(Capability capability,
Capability.AttributeId attributeId,
ResourceCondition.OperatorType operatorType,
long conditionDuration,
Attribute.DataType dataType,
java.lang.Object thresholdAttributeValue)
An overloaded constructor that uses
DEFAULT_RESOURCE_CONDITION_ID as ID. |
protected |
ResourceCondition(int id,
Capability capability,
int attributeId,
int operatorType,
long conditionDuration,
Attribute.DataType dataType,
java.lang.Object thresholdAttributeValue)
Base Constructor
ResourceCondition. |
|
ResourceCondition(Resource resource,
Capability.AttributeId attributeId,
ResourceCondition.OperatorType operatorType,
long conditionDuration,
Attribute.DataType dataType,
java.lang.Object thresholdAttributeValue)
An overloaded constructor that takes the
Resource. |
| Modifier and Type | Method and Description |
|---|---|
ResourceCondition |
duplicate()
A function that creates new copy of the
ResourceCondition. |
Attribute |
getAttribute()
A function to get
Attribute associated with this ResourceCondition. |
Attribute.DataType |
getAttributeDataType()
|
Capability.AttributeId |
getAttributeId()
A function to get
Capability.AttributeId
associated with this ResourceCondition. |
long |
getConditionDuration()
A function to get
conditionDuration. |
int |
getId()
A function to get ID of this condition.
|
ResourceCondition.OperatorType |
getOperatorType()
A function to get
ResourceCondition.OperatorType associated with this ResourceCondition. |
Capability |
getParentCapability()
A function to get
Capability associated with this ResourceCondition. |
java.lang.Object |
getThresholdAttributeValue()
A function to get
thresholdAttributeValue. |
java.lang.String |
toString() |
public static final int DEFAULT_RESOURCE_CONDITION_ID
id.protected ResourceCondition(int id,
Capability capability,
int attributeId,
int operatorType,
long conditionDuration,
Attribute.DataType dataType,
java.lang.Object thresholdAttributeValue)
ResourceCondition.id - ID of the ResourceCondition.capability - Parent Capability of the attributeId.attributeId - Capability.AttributeId
whose value is used to trigger this condition.operatorType - ResourceCondition.OperatorType of this condition.conditionDuration - Time for which condition has to hold true.dataType - Attribute.DataType of the attribute.thresholdAttributeValue - ThresholdAttribute value at which this condition should trigger.public ResourceCondition(Resource resource, Capability.AttributeId attributeId, ResourceCondition.OperatorType operatorType, long conditionDuration, Attribute.DataType dataType, java.lang.Object thresholdAttributeValue)
Resource.resource - Resource which contains required Attribute.attributeId - Capability.AttributeId
whose value is used to trigger this condition.operatorType - Mathematical operator that needs to be used to compare values
of Attribute and
thresholdAttributeValue.conditionDuration - Time in milliseconds for which condition has to hold true.dataType - Date type of the attributeId.thresholdAttributeValue - Threshold is a value used to compare with
attributeId}
using specified ResourceCondition.OperatorType to trigger condition.public ResourceCondition(Capability capability, Capability.AttributeId attributeId, ResourceCondition.OperatorType operatorType, long conditionDuration, Attribute.DataType dataType, java.lang.Object thresholdAttributeValue)
DEFAULT_RESOURCE_CONDITION_ID as ID.capability - Parent Capability of attributeId.attributeId - Capability.AttributeId whose value is used to
in comparison with thresholdAttributeValue
to trigger rule.operatorType - Mathematical operator that needs to be used to compare values
of Attribute and
thresholdAttributeValue.conditionDuration - Time for which condition has to hold true.dataType - Date type of the attributeId.thresholdAttributeValue - Threshold is a value used to compare
with attributeId}
using specified ResourceCondition.OperatorType to trigger condition.public int getId()
public Capability.AttributeId getAttributeId()
Capability.AttributeId
associated with this ResourceCondition.Capability.AttributeId of the ResourceCondition.public Capability getParentCapability()
Capability associated with this ResourceCondition.Capability of the ResourceConditionpublic Attribute getAttribute()
Attribute associated with this ResourceCondition.Attribute of the ResourceConditionpublic ResourceCondition.OperatorType getOperatorType()
ResourceCondition.OperatorType associated with this ResourceCondition.ResourceCondition.OperatorType of the ResourceCondition.public long getConditionDuration()
conditionDuration.conditionDuration.public Attribute.DataType getAttributeDataType()
Attribute.DataType of the Attribute for the ResourceCondition.public java.lang.Object getThresholdAttributeValue()
thresholdAttributeValue.thresholdAttributeValue.public ResourceCondition duplicate()
ResourceCondition.duplicate in interface Rule.Conditionpublic java.lang.String toString()
toString in class java.lang.Object