Rio Project 4.2 API Documentation



org.rioproject.system
Class ResourceCapability

java.lang.Object
  extended by org.rioproject.system.ResourceCapability
All Implemented Interfaces:
Serializable, Comparable

public class ResourceCapability
extends Object
implements Comparable, Serializable

Represents the capabilities of a compute resource. The ResourceCapability class provides the utilization, platform and measurable capabilities for a compute resource.

Author:
Dennis Reedy
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, ComputeResourceUtilization resourceUtilization)
          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()
          Get the computed resource utilization
 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,
                          ComputeResourceUtilization resourceUtilization)
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
resourceUtilization - The ComputeResourceUtilization, representing the measured attributes 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()
Get the computed resource utilization

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

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.