org.ourgrid.common.spec
Class GumSpec

java.lang.Object
  extended by org.ourgrid.common.spec.GumSpec
All Implemented Interfaces:
java.io.Serializable

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

Entity that encapsulates all the information given by the user about a Gum To provide the information, the user uses the Description Files that can be compiled by CommonCompiler.

See Also:
CommonCompiler, Serialized Form

Field Summary
static java.lang.String ATT_BOGO_MIPS
           
static java.lang.String ATT_COPY_FROM
           
static java.lang.String ATT_COPY_TO
           
static java.lang.String ATT_DEBUG
           
static java.lang.String ATT_ENVIRONMENT
           
static java.lang.String ATT_MEM
           
static java.lang.String ATT_NAME
          A series of standard attribute names
static java.lang.String ATT_OS
           
static java.lang.String ATT_PEERNAME
           
static java.lang.String ATT_PEERPORT
           
static java.lang.String ATT_PLAYPEN_ROOT
           
static java.lang.String ATT_PLAYPEN_SIZE
           
static java.lang.String ATT_PORT
           
static java.lang.String ATT_PROCESSOR_FAMILY
           
static java.lang.String ATT_REM_EXEC
           
static java.lang.String ATT_SECURITY
           
static java.lang.String ATT_SITE
           
static java.lang.String ATT_STORAGE_DIR
           
static java.lang.String ATT_STORAGE_SHARED
           
static java.lang.String ATT_STORAGE_SIZE
           
static java.lang.String ATT_TYPE
           
static java.lang.String OS_HPUX
           
static java.lang.String OS_LINUX
           
static java.lang.String OS_LINUX_XEN
           
static java.lang.String OS_SOLARIS
           
static java.lang.String OS_WINDOWS
           
static java.lang.String TYPE_FAKE_GUM
           
static java.lang.String TYPE_UA_LINUX
           
static java.lang.String TYPE_UA_SWAN
           
static java.lang.String TYPE_UA_WINDOWS
           
 
Constructor Summary
GumSpec()
          Default constructor.
GumSpec(java.util.Map<java.lang.String,java.lang.String> attributes)
          Builds a machine specification with a given map of attributes.
 
Method Summary
 boolean equals(java.lang.Object o)
          Checks if an object is equals to this grid machine specification.
 java.lang.String getAttribute(java.lang.String attName)
          Returns the value of the attribute named as given.
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Retrieves the map of attributes.
 GumID getGumID()
          Returns the gum identification.
 boolean hasAttribute(java.lang.String name)
          Checks if the given attribute name is contained in the machine attribute set.
 void putAttribute(java.lang.String name, java.lang.String value)
          Inserts a new attribute at this gum specification.
 void putAttributes(java.util.Map<java.lang.String,java.lang.String> mapAttributes)
          Inserts a set of attributes at this gum specification.
 void removeAttributes(java.util.Collection<java.lang.String> keys)
          Removes all the given attributes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATT_NAME

public static final java.lang.String ATT_NAME
A series of standard attribute names

See Also:
Constant Field Values

ATT_PEERNAME

public static final java.lang.String ATT_PEERNAME
See Also:
Constant Field Values

ATT_PEERPORT

public static final java.lang.String ATT_PEERPORT
See Also:
Constant Field Values

ATT_TYPE

public static final java.lang.String ATT_TYPE
See Also:
Constant Field Values

ATT_REM_EXEC

public static final java.lang.String ATT_REM_EXEC
See Also:
Constant Field Values

ATT_PORT

public static final java.lang.String ATT_PORT
See Also:
Constant Field Values

ATT_COPY_FROM

public static final java.lang.String ATT_COPY_FROM
See Also:
Constant Field Values

ATT_COPY_TO

public static final java.lang.String ATT_COPY_TO
See Also:
Constant Field Values

ATT_PLAYPEN_ROOT

public static final java.lang.String ATT_PLAYPEN_ROOT
See Also:
Constant Field Values

ATT_PLAYPEN_SIZE

public static final java.lang.String ATT_PLAYPEN_SIZE
See Also:
Constant Field Values

ATT_STORAGE_DIR

public static final java.lang.String ATT_STORAGE_DIR
See Also:
Constant Field Values

ATT_STORAGE_SIZE

public static final java.lang.String ATT_STORAGE_SIZE
See Also:
Constant Field Values

ATT_OS

public static final java.lang.String ATT_OS
See Also:
Constant Field Values

ATT_PROCESSOR_FAMILY

public static final java.lang.String ATT_PROCESSOR_FAMILY
See Also:
Constant Field Values

ATT_MEM

public static final java.lang.String ATT_MEM
See Also:
Constant Field Values

ATT_BOGO_MIPS

public static final java.lang.String ATT_BOGO_MIPS
See Also:
Constant Field Values

ATT_DEBUG

public static final java.lang.String ATT_DEBUG
See Also:
Constant Field Values

ATT_SECURITY

public static final java.lang.String ATT_SECURITY
See Also:
Constant Field Values

ATT_SITE

public static final java.lang.String ATT_SITE
See Also:
Constant Field Values

ATT_STORAGE_SHARED

public static final java.lang.String ATT_STORAGE_SHARED
See Also:
Constant Field Values

ATT_ENVIRONMENT

public static final java.lang.String ATT_ENVIRONMENT
See Also:
Constant Field Values

TYPE_UA_LINUX

public static final java.lang.String TYPE_UA_LINUX
See Also:
Constant Field Values

TYPE_UA_WINDOWS

public static final java.lang.String TYPE_UA_WINDOWS
See Also:
Constant Field Values

TYPE_UA_SWAN

public static final java.lang.String TYPE_UA_SWAN
See Also:
Constant Field Values

TYPE_FAKE_GUM

public static final java.lang.String TYPE_FAKE_GUM
See Also:
Constant Field Values

OS_LINUX

public static final java.lang.String OS_LINUX
See Also:
Constant Field Values

OS_WINDOWS

public static final java.lang.String OS_WINDOWS
See Also:
Constant Field Values

OS_HPUX

public static final java.lang.String OS_HPUX
See Also:
Constant Field Values

OS_SOLARIS

public static final java.lang.String OS_SOLARIS
See Also:
Constant Field Values

OS_LINUX_XEN

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

GumSpec

public GumSpec()
Default constructor.


GumSpec

public GumSpec(java.util.Map<java.lang.String,java.lang.String> attributes)
Builds a machine specification with a given map of attributes.

Parameters:
attributes - A map with the pairs of name + value of the machine's attributes
Method Detail

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Retrieves the map of attributes.

Returns:
a map with all the attributes of this grid machine indexed by the name of the attribute.

putAttribute

public void putAttribute(java.lang.String name,
                         java.lang.String value)
Inserts a new attribute at this gum specification.

Parameters:
name - the name of the new attribute. If the name already exists the new value will substitute the old one.
value - the value for this attribute.

putAttributes

public void putAttributes(java.util.Map<java.lang.String,java.lang.String> mapAttributes)
Inserts a set of attributes at this gum specification.

Parameters:
mapAttributes - the attributes to be added.

removeAttributes

public void removeAttributes(java.util.Collection<java.lang.String> keys)
Removes all the given attributes.

Parameters:
keys - The keys to be removed.

hasAttribute

public boolean hasAttribute(java.lang.String name)
Checks if the given attribute name is contained in the machine attribute set.

Parameters:
name - the attribute name.
Returns:
true if the attribute name already exists and false otherwise.

getAttribute

public java.lang.String getAttribute(java.lang.String attName)
Returns the value of the attribute named as given.

Parameters:
attName - the attribute name.
Returns:
the attribute value.

equals

public boolean equals(java.lang.Object o)
Checks if an object is equals to this grid machine specification.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object that has to be compared.
Returns:
true if the object is equals and false otherwise

getGumID

public GumID getGumID()
Returns the gum identification.

Returns:
the gum identification