Requirement
Date: 2013-06-18

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      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
  - That a key is present in the environmental variables of GHN descriptor. In a such case the associated value must be null. Usage:

          new Requirement(RequirementElemPath.RUNTIME_ENV, RequirementElemType.STRING , "GLOBUS_OPTIONS", null, RequirementRelationType.EQUAL)

  - That both (key, value) couple is exactly equals to the parameters. Usage:

          new Requirement(RequirementElemPath.RUNTIME_ENV, RequirementElemType.STRING , "ANT_HOME", "/usr/share/ant", RequirementRelationType.EQUAL),

  - That both (key, value) couple where the key is exactly equals to the key parameter and the value contains the element passed as value parameter. Usage:

          new Requirement(RequirementElemPath.RUNTIME_ENV, RequirementElemType.STRING , "ANT_HOME", "/ant", RequirementRelationType.CONTAINS),

  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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD