eu.xtreemos.xosd.resmng.data
Class ResourceDescriptorRecord

java.lang.Object
  extended by eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord
All Implemented Interfaces:
java.io.Serializable

public class ResourceDescriptorRecord
extends java.lang.Object
implements java.io.Serializable

A class for describing a resource. A resource is an entity (mostly a computer node) that provides capabilities for computation and services. An instance of the class provides the details known or currently available about a particular resource. The instance might not have all the fields filled in. The instances of the class can be used to check agains the queries in the ConditionTreeCondition. It can also be used in resource registration and listing (e.g., RCAServer).

Author:
matej.artac@xlab.si
See Also:
Serialized Form

Field Summary
protected static java.util.ArrayList<java.lang.reflect.Field> availableFields
          A collection containing all the fields (resources) available and supported by descriptor record.
 CommunicationAddress communicationAddress
           
 double CPUCount
           
static java.lang.reflect.Field cpuCountField
           
 int cpuLoadLast15min
          The load average of last 15 minutes, per cent (0..100), or -1 if unknown.
static java.lang.reflect.Field cpuLoadLast15minField
           
 int cpuLoadLast1min
          The load average of last 1 minutes, per cent (0..100), or -1 if unknown.
static java.lang.reflect.Field cpuLoadLast1minField
           
 int cpuLoadLast5min
          The load average of last 5 minutes, per cent (0..100), or -1 if unknown.
static java.lang.reflect.Field cpuLoadLast5minField
           
 double CPUSpeed
           
static java.lang.reflect.Field cpuSpeedField
           
 java.lang.String hostIP
           
static java.lang.reflect.Field hostIPField
           
 java.lang.String hostUniqueID
           
static java.lang.reflect.Field hostUniqueIDField
           
 java.lang.String operatingSystemName
           
static java.lang.reflect.Field operatingSystemNameField
           
 java.lang.String processorArchitecture
           
static java.lang.reflect.Field processorArchitectureField
           
 double RAMSize
           
static java.lang.reflect.Field ramSizeField
           
 ResourceID resourceId
           
 java.util.ArrayList<java.lang.String> services
          A list of services belonging to the resource or currently running on the resource.
 java.util.Date timestamp
          The field that can be used to approximate the age of this descriptor's instance, particularly for its dynamic field values.
 java.util.ArrayList<java.lang.String> vos
          The client might want to store the list of VO names/IDs that the resource belongs to.
 
Constructor Summary
ResourceDescriptorRecord(CommunicationAddress communicationAddress, java.lang.String hostUniqueID, java.lang.String operatingSystemName, java.lang.String processorArchitecture, double CPUSpeed, double CPUCount, double RAMSize, int cpuLoadLast15min, int cpuLoadLast5min, int cpuLoadLast1min)
           
ResourceDescriptorRecord(java.lang.String hostIP, java.lang.String hostUniqueID, java.lang.String operatingSystemName, java.lang.String processorArchitecture, double CPUSpeed, double CPUCount, double RAMSize)
           
 
Method Summary
protected static java.util.ArrayList<java.lang.reflect.Field> getAllMyFields()
           
static java.util.ArrayList<java.lang.reflect.Field> getAvailableFields()
           
 java.util.Hashtable<java.lang.String,java.lang.String> getFlatStructure()
          Converts the record into a hashtable containing pairs (metric name, value).
 java.util.Hashtable<java.lang.String,java.lang.String> getFlatStructure(java.util.ArrayList<java.lang.reflect.Field> fields)
          Converts the record into a hashtable containing pairs (metric name, value).
 java.util.Hashtable<java.lang.String,java.lang.String> getFlatStructureStr(java.util.ArrayList<java.lang.String> metrics)
          Converts the record into a hashtable containing pairs (metric name, value).
static java.lang.reflect.Field getMyField(java.lang.String fieldName)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

communicationAddress

public CommunicationAddress communicationAddress

hostIP

public java.lang.String hostIP

hostUniqueID

public java.lang.String hostUniqueID

operatingSystemName

public java.lang.String operatingSystemName

processorArchitecture

public java.lang.String processorArchitecture

CPUSpeed

public double CPUSpeed

CPUCount

public double CPUCount

RAMSize

public double RAMSize

resourceId

public ResourceID resourceId

services

public java.util.ArrayList<java.lang.String> services
A list of services belonging to the resource or currently running on the resource.


vos

public java.util.ArrayList<java.lang.String> vos
The client might want to store the list of VO names/IDs that the resource belongs to.


cpuLoadLast15min

public int cpuLoadLast15min
The load average of last 15 minutes, per cent (0..100), or -1 if unknown.


cpuLoadLast5min

public int cpuLoadLast5min
The load average of last 5 minutes, per cent (0..100), or -1 if unknown.


cpuLoadLast1min

public int cpuLoadLast1min
The load average of last 1 minutes, per cent (0..100), or -1 if unknown.


timestamp

public java.util.Date timestamp
The field that can be used to approximate the age of this descriptor's instance, particularly for its dynamic field values. The time stamp denotes the time of the instance's instantiation, and not the time the measurements were taken from the local monitor. Care should be also taken because its value is subject to the node's local system time errors (in other words, use a good ntp server on all nodes!).


hostUniqueIDField

public static final java.lang.reflect.Field hostUniqueIDField

hostIPField

public static final java.lang.reflect.Field hostIPField

cpuCountField

public static final java.lang.reflect.Field cpuCountField

ramSizeField

public static final java.lang.reflect.Field ramSizeField

processorArchitectureField

public static final java.lang.reflect.Field processorArchitectureField

operatingSystemNameField

public static final java.lang.reflect.Field operatingSystemNameField

cpuSpeedField

public static final java.lang.reflect.Field cpuSpeedField

cpuLoadLast15minField

public static final java.lang.reflect.Field cpuLoadLast15minField

cpuLoadLast5minField

public static final java.lang.reflect.Field cpuLoadLast5minField

cpuLoadLast1minField

public static final java.lang.reflect.Field cpuLoadLast1minField

availableFields

protected static java.util.ArrayList<java.lang.reflect.Field> availableFields
A collection containing all the fields (resources) available and supported by descriptor record.

Constructor Detail

ResourceDescriptorRecord

public ResourceDescriptorRecord(java.lang.String hostIP,
                                java.lang.String hostUniqueID,
                                java.lang.String operatingSystemName,
                                java.lang.String processorArchitecture,
                                double CPUSpeed,
                                double CPUCount,
                                double RAMSize)

ResourceDescriptorRecord

public ResourceDescriptorRecord(CommunicationAddress communicationAddress,
                                java.lang.String hostUniqueID,
                                java.lang.String operatingSystemName,
                                java.lang.String processorArchitecture,
                                double CPUSpeed,
                                double CPUCount,
                                double RAMSize,
                                int cpuLoadLast15min,
                                int cpuLoadLast5min,
                                int cpuLoadLast1min)
Method Detail

getAllMyFields

protected static java.util.ArrayList<java.lang.reflect.Field> getAllMyFields()

getMyField

public static java.lang.reflect.Field getMyField(java.lang.String fieldName)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getFlatStructure

public java.util.Hashtable<java.lang.String,java.lang.String> getFlatStructure()
                                                                        throws java.lang.Exception
Converts the record into a hashtable containing pairs (metric name, value). The call returns all the available metrics and their values.

Returns:
A collection of pairs (metric name, value). The collection contains all the available metrics and their values.
Throws:
java.lang.Exception

getFlatStructure

public java.util.Hashtable<java.lang.String,java.lang.String> getFlatStructure(java.util.ArrayList<java.lang.reflect.Field> fields)
                                                                        throws java.lang.Exception
Converts the record into a hashtable containing pairs (metric name, value). The call returns the metrics specified by the fields input parameter collection.

Parameters:
fields - The collection with the fields that the method should return the values of.
Returns:
A collection of selected pairs (metric name, value).
Throws:
java.lang.Exception

getFlatStructureStr

public java.util.Hashtable<java.lang.String,java.lang.String> getFlatStructureStr(java.util.ArrayList<java.lang.String> metrics)
                                                                           throws java.lang.Exception
Converts the record into a hashtable containing pairs (metric name, value). The call returns the metrics specified by the fields name collection input parameter.

Parameters:
metrics - The collection with the fields that the method should return the values of. The names in the collection have to match the names of the fields of ResourceDescriptorRecord that contain the resource metric values.
Returns:
A collection of selected pairs (metric name, value).
Throws:
java.lang.Exception

getAvailableFields

public static java.util.ArrayList<java.lang.reflect.Field> getAvailableFields()