public class Requirement
extends java.lang.Object
When requiring a new deployment plan to the ResourceBroker service, the
org.gcube.vremanagement.resourcebroker.impl.services.BrokerService#getPlan(String)
method is activated.
This method requires the String consisting of the XML representation of a deployment
request coming from the VRE Manager. Aside, it is offered the possibility to express
requirements on the GHN to choose for a deployment plan. The requirements are so expressed
by instantiating Requirement
class.
Usage samples:
// To require a GHN running on Linux OS. new Requirement(RequirementElemPath.OS, RequirementElemType.STRING , "Linux", RequirementRelationType.EQUAL), // Requires that the GHN is deployed on a machine inside the isti.cnr.it domain new Requirement(RequirementElemPath.HOST, RequirementElemType.STRING , "isti.cnr.it", RequirementRelationType.CONTAINS), // Requires a machine having a CPU with at least 5000 bogomips. new Requirement(RequirementElemPath.PROCESSOR_BOGOMIPS, RequirementElemType.NUMBER , "5000", RequirementRelationType.GREATER_OR_EQUAL)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NODE_TAG |
Constructor and Description |
---|
Requirement(RequirementElemPath elem,
RequirementRelationType relType,
java.lang.String value)
Creates a new requirement.
|
Requirement(RequirementElemPath elem,
java.lang.String value) |
Requirement(RequirementElemPath elem,
java.lang.String key,
RequirementRelationType relType,
java.lang.String value)
This constructor is instead used for only environmental variable to check
That a key is present in the environmental variables of GHN descriptor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
RequirementElemPath |
getElem() |
java.lang.String |
getEvalString() |
java.lang.String |
getKey() |
RequirementRelationType |
getRelType() |
java.lang.String |
getValue() |
int |
hashCode() |
void |
setKey(java.lang.String key) |
public static final java.lang.String NODE_TAG
public Requirement(RequirementElemPath elem, RequirementRelationType relType, java.lang.String value)
public Requirement(RequirementElemPath elem, java.lang.String value)
public Requirement(RequirementElemPath elem, java.lang.String key, RequirementRelationType relType, java.lang.String value)
new Requirement(RequirementElemPath.RUNTIME_ENV, RequirementElemType.STRING , "GLOBUS_OPTIONS", null, RequirementRelationType.EQUAL)
new Requirement(RequirementElemPath.RUNTIME_ENV, RequirementElemType.STRING , "ANT_HOME", "/usr/share/ant", RequirementRelationType.EQUAL),
new Requirement(RequirementElemPath.RUNTIME_ENV, RequirementElemType.STRING , "ANT_HOME", "/ant", RequirementRelationType.CONTAINS),
value
- if the value is NULL it is assumed a containsKey operator. No comparison on the value will be done.public RequirementElemPath getElem()
public java.lang.String getValue()
public java.lang.String getKey()
public void setKey(java.lang.String key)
public RequirementRelationType getRelType()
public java.lang.String getEvalString()
public final int hashCode()
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object