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

## org.jini.rio.qos
Class ResourceCapability

    java.lang.Object
      org.jini.rio.qos.ResourceCapability

All Implemented Interfaces:
  Serializable, Comparable

    public class ResourceCapability

extends Object
implements Comparable, Serializable

Key to the dynamic allocation approach is providing mechanisms to communicate changes to platform and measurable capabilities of a compute resource. The ResourceCapability class provides the vehicle to communicate the resource utilization, platform and measurable capabilities attributes of a compute resource

See Also:
  Serialized Form

Field Summary
`static int` | `ALL_MEASURED_RESOURCES` Used to get all MeasuredResource instances
`static int` | `MEASURED_RESOURCES_BREACHED` Used to get MeasuredResource instances which have a value outside of declared thresholds

Constructor Summary
`ResourceCapability(String address, String hostName, boolean persistentProvisioning, PlatformCapability[] platformCapabilities, MeasuredResource[] measuredResources)` Construct a ResourceCapability object

Method Summary
`int` | `compareTo(Object o)` Compares this ResourceCapability object with another ResourceCapability object for order using the computed utilization of the ResourceCapability
`String` | `getAddress()` Get the address
`String` | `getHostName()` Get the hostname
`MeasuredResource[]` | `getMeasuredResources()` Get an array of MeasuredResource objects for the compute resource.
`MeasuredResource[]` | `getMeasuredResources(int type)` Get an array of MeasuredResource objects for the compute resource.
`PlatformCapability[]` | `getPlatformCapabilities()` Get an array of PlatformCapability objects for the compute resource
`double` | `getUtilization()` Calculates the composite utilization for all MeasuredResource objects in the group by first summing up all of the utilization values, then dividing the composite by the number of elements in the MeasuredResource collection.
`boolean` | `measuredResourcesWithinRange()` Determine if the ResourceCapability contains MeasuredResource instances that have values which fall outside of their threshold declaration
`boolean` | `supportsPersistentProvisioning()` Get whether the ComputeResource supports persistent provisioning
`String` | `toString()` Provide a String output

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### ALL_MEASURED_RESOURCES

    public static final int ALL_MEASURED_RESOURCES

  Used to get all MeasuredResource instances

  See Also:
    Constant Field Values

### MEASURED_RESOURCES_BREACHED

    public static final int MEASURED_RESOURCES_BREACHED

  Used to get MeasuredResource instances which have a value outside of declared thresholds

  See Also:
    Constant Field Values

Constructor Detail

### ResourceCapability

    public ResourceCapability(String address,
                              String hostName,
                              boolean persistentProvisioning,
                              PlatformCapability[] platformCapabilities,
                              MeasuredResource[] measuredResources)

  Construct a ResourceCapability object

  Parameters:
    `address` - The IP Address of the ComputeResource
    `hostName` - The hostname of the ComputeResource
    `persistentProvisioning` - Whether the ComputeResource supports persistent provisioning
    `platformCapabilities` - An array of PlatformCapability objects for the compute resource
    `measuredResources` - An array of MeasuredResource objects representing MeasuredCapability instances of the compute resource

Method Detail

### getAddress

    public String getAddress()

  Get the address

  Returns:
    The TCP/IP address the ResourceCapability represents

### getHostName

    public String getHostName()

  Get the hostname

  Returns:
    The hostname the ResourceCapability represents

### getUtilization

    public double getUtilization()

  Calculates the composite utilization for all MeasuredResource objects in the group by first summing up all of the utilization values, then dividing the composite by the number of elements in the MeasuredResource collection. If there are no elements in the composite, the utilization will be 0

  Returns:
    The computed utilization

### supportsPersistentProvisioning

    public boolean supportsPersistentProvisioning()

  Get whether the ComputeResource supports persistent provisioning

  Returns:
    Return true if the ComputeResource supports persistent provisioning, otherwise return false

### getPlatformCapabilities

    public PlatformCapability[] getPlatformCapabilities()

  Get an array of PlatformCapability objects for the compute resource

  Returns:
    PlatformCapability[] Array of PlatformCapability objects.

### getMeasuredResources

    public MeasuredResource[] getMeasuredResources()

  Get an array of MeasuredResource objects for the compute resource. Each MeasuredResource represents the current state of attributes of a MeasurableCapability

  Returns:
    MeasuredResource[] Array of MeasuredResource objects.

### getMeasuredResources

    public MeasuredResource[] getMeasuredResources(int type)

  Get an array of MeasuredResource objects for the compute resource. Each MeasuredResource represents the current state of attributes of a MeasurableCapability

  Parameters:
    `type` - Either ALL_MEASURED_RESOURCES or MEASURED_RESOURCES_BREACHED
  Returns:
    MeasuredResource[] Array of MeasuredResource objects.

### measuredResourcesWithinRange

    public boolean measuredResourcesWithinRange()

  Determine if the ResourceCapability contains MeasuredResource instances that have values which fall outside of their threshold declaration

  Returns:
    True if all MeasuredResource instances are within their known threshold range. If any of the MeasuredResource instances have a value which falls outside of their threshold declaration, return false;

### compareTo

    public int compareTo(Object o)

  Compares this ResourceCapability object with another ResourceCapability object for order using the computed utilization of the ResourceCapability

  Specified by:
    `compareTo` in interface `Comparable`
  Parameters:
    `o` - Object to compare to

### toString

    public String toString()

  Provide a String output

  Overrides:
    `toString` in class `Object`

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

Copyright © Project Rio.