orca.cod.plugins
Class Site

java.lang.Object
  extended by orca.shirako.plugins.ShirakoPlugin
      extended by orca.cod.plugins.CodBasePlugin
          extended by orca.cod.plugins.Site
All Implemented Interfaces:
IInitialize, IRecover, ISerialize, IShirakoPlugin

public class Site
extends CodBasePlugin

Attributes and global state for a COD site. There is one Site object per COD authority actor. It drives site-global functions, including assignment of subnet prefixes and DNS domains.

Once you create your COD site, invoke the install/configure methods to set its various parameters, then initialize it, and reset it if recovering. Note: the configuration parameters should/must be immutable once configured: if you change them on a recovering site, then active slices continue to use the old parameters, so recovery may fail or various naming/address clashes may result.


Field Summary
protected  Authority authority
          The authority actor for this site
protected  java.util.Properties configurationProperties
           
protected  boolean fromConfig
          True if this plugin was configured from a config file.
protected  KeyManager keyManager
          Manages account information for clients of this site authority
protected  NetworkConfigurationManager networkManager
          Network configuration
protected  PoolManager poolManager
          Manager of resource pools.
static java.lang.String PropertyHostKey
           
static java.lang.String PropertyKeyManager
           
static java.lang.String PropertyKeyManagerClass
           
static java.lang.String PropertyNetworkManager
           
static java.lang.String PropertyNetworkManagerClass
           
static java.lang.String PropertySliceID
           
static java.lang.String PropertyTicket
           
protected  AuthorityCodDatabase siteDB
          Cached database object
protected  int ticketImplementation
          The ticket implementation supported by the authority.
protected  java.util.Hashtable ticketSets
           
 
Fields inherited from class orca.cod.plugins.CodBasePlugin
LocationTransferInComplete, propertiesMapper
 
Fields inherited from class orca.shirako.plugins.ShirakoPlugin
actor, config, db, factories, keystoreManager, logger, PropertyConfig, PropertyConfigClass, PropertyDatabase, PropertyDatabaseClass
 
Constructor Summary
Site()
          Constructor.
 
Method Summary
 void configure(java.util.Properties p)
          Processes a list of configuration properites
 Slice createSlice(SliceID id, java.lang.String name, ResourceData properties, java.lang.Object other)
          Slice factory.
 Authority getAuthority()
          Get access to authority and to manager through the site object.
 java.util.Properties getConfigurationProperties()
           
protected  java.util.Properties getConfigurationProperties(ResourceReservation reservation, Node node)
          Produces a properties list to be passed to the configuration sub-system
 java.lang.String getHostKey()
           
 KeyManager getKeyManager()
           
 NetworkConfigurationManager getNetworkManager()
           
 PoolManager getPoolManager()
           
 void initialize()
          Initializes a COD site from an LDAP server.
protected  void logOvercommit(java.util.List list)
           
 void releaseSlice(Slice slice)
          Release any resources held by the slice.
 void reset()
          Resets a site on startup or recovery.
 void reset(java.util.Properties p)
          De-serializes the object from the given properties list.
 void revisit(IActor actor, java.util.Properties p)
          Recovers state of the component using a previously saved properties list and a references to the actor this component belongs to.
 void revisit(ResourceReservation r)
          Reset/restore interface.
 void revisit(Slice slice)
          Revisits slice.
 void save(java.util.Properties p)
          Serializes the object into the given properties list.
 void setActor(IActor authority)
          Sets the authority.
 void setHostKey(java.lang.String key)
           
 void setKeyManager(KeyManager keyManager)
           
 void setNetworkManager(NetworkConfigurationManager networkManager)
           
 void setTicketImplementation(int ticketImplementation)
           
 boolean validateIncoming(IReservation reservation, AuthToken auth)
          Validates an incoming reservation.
 
Methods inherited from class orca.cod.plugins.CodBasePlugin
loadFactories, makeAndAttachCopy, modify, notify, probe, processJoinComplete, processLeaveComplete, processModifyComplete, processProbeComplete, processRecoverComplete, processSavedProperties, recover, restartConfigurationActions, restartConfigurationActions, setConfigMapUrl, transferIn, transferOut
 
Methods inherited from class orca.shirako.plugins.ShirakoPlugin
actorAdded, configurationComplete, getActor, getConfig, getDatabase, getFactory, getKeyStore, getLogger, getResultCode, initializeKeyStore, save, setConfig, setDatabase, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PropertyKeyManagerClass

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

PropertyKeyManager

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

PropertyNetworkManagerClass

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

PropertyNetworkManager

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

PropertySliceID

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

PropertyHostKey

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

PropertyTicket

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

poolManager

protected PoolManager poolManager
Manager of resource pools.


keyManager

protected KeyManager keyManager
Manages account information for clients of this site authority


networkManager

protected NetworkConfigurationManager networkManager
Network configuration


authority

protected Authority authority
The authority actor for this site


siteDB

protected AuthorityCodDatabase siteDB
Cached database object


fromConfig

protected boolean fromConfig
True if this plugin was configured from a config file.


ticketImplementation

protected int ticketImplementation
The ticket implementation supported by the authority. See boot.TicketFactory


ticketSets

protected java.util.Hashtable ticketSets

configurationProperties

protected java.util.Properties configurationProperties
Constructor Detail

Site

public Site()
Constructor.

Parameters:
authority - authority object
tfac - encapsulates standard term parameters for leases
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Initializes a COD site from an LDAP server. Note that if we are recovering state, must invoke reset() explicitly after initializing.

Specified by:
initialize in interface IInitialize
Overrides:
initialize in class CodBasePlugin
Throws:
exception - if mis-configured, misused, or buggy
java.lang.Exception

configure

public void configure(java.util.Properties p)
               throws java.lang.Exception
Processes a list of configuration properites

Parameters:
p -
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
Overrides:
save in class ShirakoPlugin
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
Overrides:
reset in class ShirakoPlugin
Parameters:
p - properties list containing the serialized version of the object
Throws:
java.lang.Exception

revisit

public void revisit(IActor actor,
                    java.util.Properties p)
             throws java.lang.Exception
Description copied from interface: IRecover
Recovers state of the component using a previously saved properties list and a references to the actor this component belongs to. The component can use the actor object to access other objects necessary for its complete recovery.

Specified by:
revisit in interface IRecover
Overrides:
revisit in class ShirakoPlugin
Parameters:
actor - actor object the component belongs to
p - properties list containing configuration data about the component
Throws:
java.lang.Exception

revisit

public void revisit(Slice slice)
             throws java.lang.Exception
Revisits slice. Re-reserve all resources held by it. This method is called during recovery on each active slice to restore site data structures. An upper bit match for subnets is a good start

Specified by:
revisit in interface IShirakoPlugin
Overrides:
revisit in class ShirakoPlugin
Parameters:
s - the slice
Throws:
java.lang.Exception

revisit

public void revisit(ResourceReservation r)
             throws java.lang.Exception
Reset/restore interface. Rebuild plugin state associated with a restored reservation. Called once for each restored reservation.

Specified by:
revisit in interface IShirakoPlugin
Overrides:
revisit in class ShirakoPlugin
Parameters:
r - restored reservation
Throws:
java.lang.Exception

reset

public void reset()
           throws java.lang.Exception
Resets a site on startup or recovery. Static pre-configuration steps must be completed before you can call this.

Specified by:
reset in interface IShirakoPlugin
Overrides:
reset in class CodBasePlugin
Throws:
java.lang.Exception

createSlice

public Slice createSlice(SliceID id,
                         java.lang.String name,
                         ResourceData properties,
                         java.lang.Object other)
                  throws java.lang.Exception
Description copied from class: ShirakoPlugin
Slice factory. Called on the server side to create a slice object for a new client.

Specified by:
createSlice in interface IShirakoPlugin
Overrides:
createSlice in class CodBasePlugin
Parameters:
id - guid for the slice
name - name for the slice
properties - properties for the slice
other - other relevant information
Returns:
a slice object
Throws:
java.lang.Exception

releaseSlice

public void releaseSlice(Slice slice)
                  throws java.lang.Exception
Release any resources held by the slice.

Specified by:
releaseSlice in interface IShirakoPlugin
Overrides:
releaseSlice in class ShirakoPlugin
Parameters:
s - the slice
Throws:
java.lang.Exception

getConfigurationProperties

protected java.util.Properties getConfigurationProperties(ResourceReservation reservation,
                                                          Node node)
                                                   throws java.lang.Exception
Produces a properties list to be passed to the configuration sub-system

Specified by:
getConfigurationProperties in class CodBasePlugin
Throws:
java.lang.Exception

validateIncoming

public boolean validateIncoming(IReservation reservation,
                                AuthToken auth)
Validates an incoming reservation. This is where we check SHARP tickets for oversubscription

Specified by:
validateIncoming in interface IShirakoPlugin
Overrides:
validateIncoming in class ShirakoPlugin
Parameters:
reservation - The reservation
auth - The AuthToken of the caller
Returns:
True if the validation succeeds

logOvercommit

protected void logOvercommit(java.util.List list)

getAuthority

public Authority getAuthority()
Get access to authority and to manager through the site object.


setActor

public void setActor(IActor authority)
Sets the authority. Mandatory. Authority should be fully initialized with a mapper and logger.

Specified by:
setActor in interface IShirakoPlugin
Overrides:
setActor in class ShirakoPlugin
Parameters:
authority - the authority

setHostKey

public void setHostKey(java.lang.String key)

getHostKey

public java.lang.String getHostKey()

getKeyManager

public KeyManager getKeyManager()

setKeyManager

public void setKeyManager(KeyManager keyManager)

setNetworkManager

public void setNetworkManager(NetworkConfigurationManager networkManager)

getNetworkManager

public NetworkConfigurationManager getNetworkManager()

setTicketImplementation

public void setTicketImplementation(int ticketImplementation)

getPoolManager

public PoolManager getPoolManager()

getConfigurationProperties

public java.util.Properties getConfigurationProperties()


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