orca.cod.plugins
Class PoolManager

java.lang.Object
  extended by orca.cod.plugins.PoolManager
All Implemented Interfaces:
IInitialize, ISerialize

public class PoolManager
extends java.lang.Object
implements IInitialize, ISerialize

Manages inventory pools.


Nested Class Summary
 class PoolManager.CreatePoolResult
           
 
Field Summary
static int ErrorDatabaseError
           
static int ErrorInternalError
           
static int ErrorInvalidArguments
           
static int ErrorNone
           
static int ErrorPoolExists
           
static int ErrorTypeExists
           
static java.lang.String PoolPrefix
           
protected  Site site
          Site this pool belongs to
static java.lang.String UnassingedPoolName
           
 
Constructor Summary
PoolManager(Site site)
          Create a new instance
 
Method Summary
 PoolManager.CreatePoolResult createPool(SliceID sliceID, java.lang.String name, ResourceType type, java.util.Properties p)
          Create a new resource pool
static java.lang.String getPoolName(ResourceType type)
          Constructs a pool name for the specified resource type
 void initialize()
          Perform initialization
 void remove(Slice slice, IConcreteSet resources)
           
 void removePool(SliceID poolID, ResourceType type)
           
 void reset(java.util.Properties p)
          De-serializes the object from the given properties list.
 void revisit(IActorIdentity actor, java.util.Properties p)
           
 java.util.Properties save()
          Serializes the object into a properties list.
 void save(java.util.Properties p)
          Serializes the object into the given properties list.
 void transferFrom(SliceID sliceID, NodeID nid)
           
 void transferTo(SliceID poolID, IConcreteSet resources)
          Transfer resources to the specified pool
 void transferTo(SliceID poolID, Node node)
          Transfer a node in the specified pool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UnassingedPoolName

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

PoolPrefix

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

ErrorNone

public static final int ErrorNone
See Also:
Constant Field Values

ErrorPoolExists

public static final int ErrorPoolExists
See Also:
Constant Field Values

ErrorTypeExists

public static final int ErrorTypeExists
See Also:
Constant Field Values

ErrorInvalidArguments

public static final int ErrorInvalidArguments
See Also:
Constant Field Values

ErrorDatabaseError

public static final int ErrorDatabaseError
See Also:
Constant Field Values

ErrorInternalError

public static final int ErrorInternalError
See Also:
Constant Field Values

site

protected Site site
Site this pool belongs to

Constructor Detail

PoolManager

public PoolManager(Site site)
Create a new instance

Parameters:
site -
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Perform initialization

Specified by:
initialize in interface IInitialize
Throws:
java.lang.Exception

getPoolName

public static java.lang.String getPoolName(ResourceType type)
                                    throws java.lang.Exception
Constructs a pool name for the specified resource type

Parameters:
type - resource type
Throws:
java.lang.Exception

createPool

public PoolManager.CreatePoolResult createPool(SliceID sliceID,
                                               java.lang.String name,
                                               ResourceType type,
                                               java.util.Properties p)
Create a new resource pool

Parameters:
name - Pool name
type - Resource type
p - Resource properties
Returns:

removePool

public void removePool(SliceID poolID,
                       ResourceType type)
                throws java.lang.Exception
Throws:
java.lang.Exception

transferTo

public void transferTo(SliceID poolID,
                       IConcreteSet resources)
                throws java.lang.Exception
Transfer resources to the specified pool

Parameters:
pool - Pool name
resources - Resources
Throws:
java.lang.Exception

transferTo

public void transferTo(SliceID poolID,
                       Node node)
                throws java.lang.Exception
Transfer a node in the specified pool

Parameters:
slice -
node -
Throws:
java.lang.Exception

transferFrom

public void transferFrom(SliceID sliceID,
                         NodeID nid)
                  throws java.lang.Exception
Throws:
java.lang.Exception

remove

public void remove(Slice slice,
                   IConcreteSet resources)
            throws java.lang.Exception
Throws:
java.lang.Exception

save

public java.util.Properties save()
                          throws java.lang.Exception
Description copied from interface: ISerialize
Serializes the object into a properties list.

Specified by:
save in interface ISerialize
Returns:
properties list representing this object
Throws:
java.lang.Exception

save

public void save(java.util.Properties p)
          throws java.lang.Exception
Description copied from interface: ISerialize
Serializes the object into the given properties list.

Specified by:
save in interface ISerialize
Parameters:
p - properties list to serialize the object into
Throws:
java.lang.Exception

reset

public void reset(java.util.Properties p)
           throws java.lang.Exception
Description copied from interface: ISerialize
De-serializes the object from the given properties list.

Specified by:
reset in interface ISerialize
Parameters:
p - properties list containing the serialized version of the object
Throws:
java.lang.Exception

revisit

public void revisit(IActorIdentity actor,
                    java.util.Properties p)
             throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.