org.ourgrid.peer.manager.gummanager
Class GumManagerEntry

java.lang.Object
  extended by org.ourgrid.peer.manager.gummanager.GumManagerEntry
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<GumManagerEntry>

public class GumManagerEntry
extends java.lang.Object
implements java.lang.Comparable<GumManagerEntry>, java.io.Serializable

GumManagerEntry It represents a GridMachine and its state in the Peer.

See Also:
Serialized Form

Constructor Summary
GumManagerEntry(GumSpec gumSpec)
          The GUM will not be contacted during creation.
 
Method Summary
 void allocate()
          Allocates the GridMachine - sets its allocated state to true.
 int compareTo(GumManagerEntry o)
          Compares the name of Entries.
 void deallocate()
          Deallocates the grid machine and stops the module's event processor
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Returns the GridMachine's attributes.
 EBGumFacade getEBGumFacade()
          Returns the EBGridMachine.
 GumID getGumID()
           
 java.lang.String getGumName()
          Returns the GridMachine name.
 GumSpec getGumSpec()
          Returns the GuMSpec that describes the GridMachine of this Entry.
 GumStatus getStatus()
           
 boolean isAllocated()
          Returns if the GridMachine is allocated or not.
 boolean isAvailable()
          Returns if the GridMachine is available or not.
 boolean isDown()
          Returns if the GridMachine is status (working) or not.
 boolean isUp()
          Returns if the GridMachine is status (working) or not.
 void setStatus(GumStatus newState)
           
 java.lang.String toString()
          Returns a String that describes this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GumManagerEntry

public GumManagerEntry(GumSpec gumSpec)
The GUM will not be contacted during creation. Its initial status will be off-line and CONTACTING. The failure detector will notify the GumManager about the this GumManagerEntry state change

Parameters:
gumSpec - GUM specification represented by this GumManagerEntry
Method Detail

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Returns the GridMachine's attributes.

Returns:
The GridMachine's attributes.

getEBGumFacade

public EBGumFacade getEBGumFacade()
Returns the EBGridMachine.

Returns:
The EBGridMachine or null if it could not be created.

getGumName

public java.lang.String getGumName()
Returns the GridMachine name.

Returns:
The GridMachine name.

getGumID

public GumID getGumID()

isAvailable

public boolean isAvailable()
Returns if the GridMachine is available or not. The GuM is available when it is status and it is not allocated .

Returns:
True if it is available ( status and not allocated ). False otherwise.

isAllocated

public boolean isAllocated()
Returns if the GridMachine is allocated or not.

Returns:
True if the GuM is allocated. False otherwise.

isUp

public boolean isUp()
Returns if the GridMachine is status (working) or not.

Returns:
True id the GuM is status. False otherwise.

isDown

public boolean isDown()
Returns if the GridMachine is status (working) or not.

Returns:
True id the GuM is status. False otherwise.

allocate

public void allocate()
Allocates the GridMachine - sets its allocated state to true.


deallocate

public void deallocate()
Deallocates the grid machine and stops the module's event processor


setStatus

public void setStatus(GumStatus newState)

toString

public java.lang.String toString()
Returns a String that describes this object.

Overrides:
toString in class java.lang.Object
Returns:
A String that contains the GuM name and its attributes.

compareTo

public int compareTo(GumManagerEntry o)
Compares the name of Entries.

Specified by:
compareTo in interface java.lang.Comparable<GumManagerEntry>
Parameters:
o - Object to be compared to. It must be a GridMachineEntry.
Returns:
0 if equals, 1 otherwise.
See Also:
Comparable.compareTo(java.lang.Object)

getGumSpec

public GumSpec getGumSpec()
Returns the GuMSpec that describes the GridMachine of this Entry.

Returns:
The GridMachine Spec object.

getStatus

public GumStatus getStatus()