orca.shirako.api
Interface IDatabase

All Superinterfaces:
IInitialize, IRecover, ISerialize
All Known Subinterfaces:
AuthorityCodDatabase, CodDatabase
All Known Implementing Classes:
LdapAuthorityCodDatabase, LdapClientDatabase, LdapCodDatabase, LdapDatabase, MemoryClientDatabase, MemoryDatabase, MySqlAuthorityCodDatabase, MySqlClientDatabase, MySqlCodDatabase, MySqlDatabase

public interface IDatabase
extends IInitialize, ISerialize, IRecover

IDatabase is the base database layer interface. It specifies methods for managing slices, reservations, broker proxies, and configuration mapping files.


Method Summary
 void actorAdded()
          Performs initialization actions as a result of the actor being added to the container.
 void addBroker(IBrokerProxy broker)
          Adds a new broker proxy record.
 void addConfigurationMapping(java.lang.String key, ConfigurationMapping map)
          Adds a new configuration mapping record.
 void addReservation(ResourceReservation reservation)
          Adds a new record to the database representing this reservation object.
 void addSlice(Slice slice)
          Adds a new record to the database representing this slice object.
 java.util.Vector<java.util.Properties> getAgentReservations()
          Retrieves all reservations for which this actor acts as a broker.
 java.util.Vector<java.util.Properties> getAuthorityReservations()
          Retrieves all reservations for which this actor acts as a site.
 java.util.Vector<java.util.Properties> getBrokers()
          Retrieves all broker proxies.
 java.util.Vector<java.util.Properties> getClientReservations()
          Retrieves all reservations that represent clients of this actor.
 java.util.Vector<java.util.Properties> getClientSlices()
          Retrieves all client slice records.
 java.util.Vector<java.util.Properties> getConfigurationMapping(java.lang.String key)
          Retrieves the specified configuration mapping record.
 java.util.Vector<java.util.Properties> getConfigurationMappings()
          Retrieves all configuration mapping records.
 java.util.Vector<java.util.Properties> getHoldings()
          Retrieves all reservations representing resources held by this actor Broker/service manager.
 java.util.Vector<java.util.Properties> getInventorySlices()
          Retrieves all inventory slice records.
 LoggingTool getLogger()
          Obtains the logger object used by the database layer implementation.
 java.util.Vector<java.util.Properties> getReservation(ReservationID rid)
          Retrieves the specified reservation record.
 java.util.Vector<java.util.Properties> getReservations()
          Retrieves all reservation records.
 java.util.Vector<java.util.Properties> getReservations(SliceID sliceID)
          Retrieves all reservation records that belong to the specified slice.
 java.util.Vector<java.util.Properties> getSlice(ResourceType type)
          Retrieves the specified slice record.
 java.util.Vector<java.util.Properties> getSlice(SliceID sliceID)
          Retrieves the specified slice record.
 java.util.Vector<java.util.Properties> getSlices()
          Retrieves all slice records.
 void registerReservationListener(IStateChangeListener listener)
          Registers a state change listener.
 void removeBroker(IBrokerProxy broker)
          Removes the specified broker proxy record.
 void removeConfigurationMapping(java.lang.String key)
          Removes the specified configuration mapping record.
 void removeReservation(ReservationID rid)
          Removes the corresponding reservation object.
 void removeSlice(SliceID sliceID)
          Removes the corresponding database slice record.
 void setActorName(java.lang.String name)
          Sets the name of the actor this database belongs to.
 void setLogger(LoggingTool logger)
          Sets the logger object to be used by the database layer implementation.
 void setResetState(boolean value)
          Indicates whether the database class should erase any previous database state.
 void unregisterReservationListener(IStateChangeListener listener)
          Unregisters the state change listener.
 void updateBroker(IBrokerProxy broker)
          Updates the specified broker proxy record.
 void updateConfigurationMapping(java.lang.String key, ConfigurationMapping map)
          Updates the specified configuration mapping record.
 void updateReservation(ResourceReservation reservation)
          Updates the corresponding reservation object.
 void updateSlice(Slice slice)
          Updates the corresponding database slice record.
 
Methods inherited from interface orca.shirako.api.IInitialize
initialize
 
Methods inherited from interface orca.shirako.api.ISerialize
reset, save, save
 
Methods inherited from interface orca.shirako.api.IRecover
revisit
 

Method Detail

addSlice

void addSlice(Slice slice)
              throws java.lang.Exception
Adds a new record to the database representing this slice object.

Parameters:
slice - Slice object
Throws:
java.lang.Exception

updateSlice

void updateSlice(Slice slice)
                 throws java.lang.Exception
Updates the corresponding database slice record.

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

removeSlice

void removeSlice(SliceID sliceID)
                 throws java.lang.Exception
Removes the corresponding database slice record.

Parameters:
sliceID - slice name
Throws:
java.lang.Exception

getSlice

java.util.Vector<java.util.Properties> getSlice(SliceID sliceID)
                                                throws java.lang.Exception
Retrieves the specified slice record.

Parameters:
sliceID - slice name
Returns:
a vector containing a properties list
Throws:
java.lang.Exception

getSlice

java.util.Vector<java.util.Properties> getSlice(ResourceType type)
                                                throws java.lang.Exception
Retrieves the specified slice record.

Parameters:
type - resource type associated with the slice
Returns:
a vector containing a properties list
Throws:
java.lang.Exception

getSlices

java.util.Vector<java.util.Properties> getSlices()
                                                 throws java.lang.Exception
Retrieves all slice records.

Returns:
a vector containing one or more properties lists representing serialized slices
Throws:
java.lang.Exception

getClientSlices

java.util.Vector<java.util.Properties> getClientSlices()
                                                       throws java.lang.Exception
Retrieves all client slice records.

Returns:
a vector containing one or more properties lists representing serialized client slices
Throws:
java.lang.Exception

getInventorySlices

java.util.Vector<java.util.Properties> getInventorySlices()
                                                          throws java.lang.Exception
Retrieves all inventory slice records.

Returns:
a vector containing one or more properties lists representing serialized inventory slices *
Throws:
java.lang.Exception

addReservation

void addReservation(ResourceReservation reservation)
                    throws java.lang.Exception
Adds a new record to the database representing this reservation object.

Parameters:
reservation -
Throws:
java.lang.Exception

updateReservation

void updateReservation(ResourceReservation reservation)
                       throws java.lang.Exception
Updates the corresponding reservation object.

Parameters:
reservation -
Throws:
java.lang.Exception

removeReservation

void removeReservation(ReservationID rid)
                       throws java.lang.Exception
Removes the corresponding reservation object.

Parameters:
rid -
Throws:
java.lang.Exception

getReservations

java.util.Vector<java.util.Properties> getReservations(SliceID sliceID)
                                                       throws java.lang.Exception
Retrieves all reservation records that belong to the specified slice.

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

getReservations

java.util.Vector<java.util.Properties> getReservations()
                                                       throws java.lang.Exception
Retrieves all reservation records.

Returns:
Throws:
java.lang.Exception

getClientReservations

java.util.Vector<java.util.Properties> getClientReservations()
                                                             throws java.lang.Exception
Retrieves all reservations that represent clients of this actor. For a broker, should return only agent reservations. For a site, should return both agent and authority reservations.

Returns:
Throws:
java.lang.Exception

getHoldings

java.util.Vector<java.util.Properties> getHoldings()
                                                   throws java.lang.Exception
Retrieves all reservations representing resources held by this actor Broker/service manager.

Returns:
Throws:
java.lang.Exception

getAgentReservations

java.util.Vector<java.util.Properties> getAgentReservations()
                                                            throws java.lang.Exception
Retrieves all reservations for which this actor acts as a broker.

Returns:
Throws:
java.lang.Exception

getAuthorityReservations

java.util.Vector<java.util.Properties> getAuthorityReservations()
                                                                throws java.lang.Exception
Retrieves all reservations for which this actor acts as a site.

Returns:
Throws:
java.lang.Exception

getReservation

java.util.Vector<java.util.Properties> getReservation(ReservationID rid)
                                                      throws java.lang.Exception
Retrieves the specified reservation record.

Parameters:
sliceName - Name of the containing slice
rid - Reservation identifier
Returns:
Throws:
java.lang.Exception

addBroker

void addBroker(IBrokerProxy broker)
               throws java.lang.Exception
Adds a new broker proxy record.

Parameters:
broker -
Throws:
java.lang.Exception

removeBroker

void removeBroker(IBrokerProxy broker)
                  throws java.lang.Exception
Removes the specified broker proxy record.

Parameters:
broker -
Throws:
java.lang.Exception

updateBroker

void updateBroker(IBrokerProxy broker)
                  throws java.lang.Exception
Updates the specified broker proxy record.

Parameters:
broker -
Throws:
java.lang.Exception

getBrokers

java.util.Vector<java.util.Properties> getBrokers()
                                                  throws java.lang.Exception
Retrieves all broker proxies.

Returns:
Throws:
java.lang.Exception

addConfigurationMapping

void addConfigurationMapping(java.lang.String key,
                             ConfigurationMapping map)
                             throws java.lang.Exception
Adds a new configuration mapping record.

Parameters:
key - key for the record
map - mapping object
Throws:
java.lang.Exception

updateConfigurationMapping

void updateConfigurationMapping(java.lang.String key,
                                ConfigurationMapping map)
                                throws java.lang.Exception
Updates the specified configuration mapping record.

Parameters:
key - record key
map - mapping object
Throws:
java.lang.Exception

removeConfigurationMapping

void removeConfigurationMapping(java.lang.String key)
                                throws java.lang.Exception
Removes the specified configuration mapping record.

Parameters:
key - key
Throws:
java.lang.Exception

getConfigurationMappings

java.util.Vector<java.util.Properties> getConfigurationMappings()
                                                                throws java.lang.Exception
Retrieves all configuration mapping records.

Returns:
a vector containing one or more properties lists representing configuration mapping records
Throws:
java.lang.Exception

getConfigurationMapping

java.util.Vector<java.util.Properties> getConfigurationMapping(java.lang.String key)
                                                               throws java.lang.Exception
Retrieves the specified configuration mapping record.

Parameters:
key - record key
Returns:
a vector containing a properties list
Throws:
java.lang.Exception

setLogger

void setLogger(LoggingTool logger)
Sets the logger object to be used by the database layer implementation.

Parameters:
logger - logger object

getLogger

LoggingTool getLogger()
Obtains the logger object used by the database layer implementation.

Returns:
logger object

setActorName

void setActorName(java.lang.String name)
                  throws java.lang.Exception
Sets the name of the actor this database belongs to.

Parameters:
name - actor name
Throws:
java.lang.Exception

registerReservationListener

void registerReservationListener(IStateChangeListener listener)
Registers a state change listener.

Parameters:
listener - to register

unregisterReservationListener

void unregisterReservationListener(IStateChangeListener listener)
Unregisters the state change listener.

Parameters:
listener - listener to unregister

setResetState

void setResetState(boolean value)
Indicates whether the database class should erase any previous database state. If true, when the database class starts it will clean any state in the database. Default: false.

Parameters:
value -

actorAdded

void actorAdded()
                throws java.lang.Exception
Performs initialization actions as a result of the actor being added to the container.

Throws:
java.lang.Exception


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