org.gcube.vremanagement.resourcebroker.utils.serialization.types.requirements
Class Requirement

java.lang.Object
  extended by org.gcube.vremanagement.resourcebroker.utils.serialization.types.requirements.Requirement

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)
 

Author:
Daniele Strollo (ISTI-CNR)

Field Summary
static java.lang.String NODE_TAG
           
 
Constructor Summary
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.
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODE_TAG

public static final java.lang.String NODE_TAG
See Also:
Constant Field Values
Constructor Detail

Requirement

public Requirement(RequirementElemPath elem,
                   RequirementRelationType relType,
                   java.lang.String value)
Creates a new requirement.


Requirement

public Requirement(RequirementElemPath elem,
                   java.lang.String value)

Requirement

public Requirement(RequirementElemPath elem,
                   java.lang.String key,
                   RequirementRelationType relType,
                   java.lang.String value)
This constructor is instead used for only environmental variable to check

Parameters:
value - if the value is NULL it is assumed a containsKey operator. No comparison on the value will be done.
Method Detail

getElem

public RequirementElemPath getElem()

getValue

public java.lang.String getValue()

getKey

public java.lang.String getKey()

setKey

public void setKey(java.lang.String key)

getRelType

public RequirementRelationType getRelType()

getEvalString

public java.lang.String getEvalString()

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object