|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.util.db.MySqlBase
orca.shirako.plugins.db.MySqlDatabase
public class MySqlDatabase
| Field Summary | |
|---|---|
protected java.lang.String |
actorId
|
protected java.lang.String |
actorName
Cache the Actor Name and unique ID |
static java.lang.String |
DefaultConfigUrl
Default Mapping file |
static java.lang.String |
DefaultType
|
static java.lang.String |
PropertyReservationID
|
protected java.util.HashSet<IStateChangeListener> |
reservationListeners
Listeners for database reservation update events |
| Fields inherited from class orca.util.db.MySqlBase |
|---|
create, db, DefaultSchema, driverPath, joclFileLocation, logger, mapFile, mapper, mySqlPasswd, mySqlServer, mySqlServerPort, mySqlUser, pool, PropertyMySqlDb, PropertyMySqlPassword, PropertyMySqlPool, PropertyMySqlServer, PropertyMySqlServerPort, PropertyMySqlUser, resetState, schemaFile, source, TypeDefault |
| Constructor Summary | |
|---|---|
MySqlDatabase()
|
|
MySqlDatabase(java.lang.String configFile)
|
|
| 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. |
protected java.util.Vector<java.util.Properties> |
createSearchResults(java.sql.ResultSet rs,
java.lang.String prefix)
|
protected java.util.Vector<java.util.Properties> |
createSearchResultsTyped(java.sql.ResultSet rs,
java.lang.String type)
Create a Properties list from a ResultSet obtained from a query |
protected java.lang.String |
getActorIdFromName(java.lang.String name)
|
protected java.lang.String |
getActorIdFromName(java.lang.String name,
java.sql.Connection connection)
|
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. |
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. |
protected java.lang.String |
getSliceIdFromGuid(SliceID guid)
Get the auto-generated key from the Slice Name |
protected java.lang.String |
getSliceIdFromGuid(SliceID guid,
java.sql.Connection connection)
|
java.util.Vector<java.util.Properties> |
getSlices()
Retrieves all slice records. |
void |
initialize()
Initializes the object. |
protected void |
notifyReservationListeners(IReservation r,
ReservationState from,
ReservationState to)
Notifies the reservation listeners about the fact that a state change was successfully committed to the database |
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 |
revisit(IActor a,
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 |
setActorName(java.lang.String actorName)
Sets the name of the actor this database belongs to. |
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 class orca.util.db.MySqlBase |
|---|
checkDb, checkDrivers, configure, constructQueryPartial, getConnection, getDb, getLogger, getMySqlPasswd, getMySqlServer, getMySqlServerPort, getMySqlUser, getPoolConfigLocation, getSchemaString, getServerConnection, loadDrivers, reset, resetDB, returnConnection, save, save, setDb, setLogger, setMySqlPasswd, setMySqlServer, setMySqlServerPort, setMySqlUser, setPoolConfigLocation, setResetState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface orca.shirako.api.IDatabase |
|---|
getLogger, setLogger, setResetState |
| Methods inherited from interface orca.shirako.api.ISerialize |
|---|
reset, save, save |
| Field Detail |
|---|
public static final java.lang.String DefaultConfigUrl
public static final java.lang.String PropertyReservationID
public static final java.lang.String DefaultType
protected java.lang.String actorName
protected java.lang.String actorId
protected java.util.HashSet<IStateChangeListener> reservationListeners
| Constructor Detail |
|---|
public MySqlDatabase()
public MySqlDatabase(java.lang.String configFile)
| Method Detail |
|---|
public void initialize()
throws java.lang.Exception
IInitialize
initialize in interface IInitializeinitialize in class MySqlBasejava.lang.Exception
public void actorAdded()
throws java.lang.Exception
IDatabase
actorAdded in interface IDatabasejava.lang.Exception
public void revisit(IActor a,
java.util.Properties p)
IRecover
revisit in interface IRecovera - actor object the component belongs top - properties list containing configuration data about the
component
protected java.lang.String getActorIdFromName(java.lang.String name,
java.sql.Connection connection)
throws java.lang.Exception
java.lang.Exception
protected java.lang.String getActorIdFromName(java.lang.String name)
throws java.lang.Exception
java.lang.Exception
protected java.lang.String getSliceIdFromGuid(SliceID guid)
throws java.lang.Exception
sliceName -
java.lang.Exception
protected java.lang.String getSliceIdFromGuid(SliceID guid,
java.sql.Connection connection)
throws java.lang.Exception
java.lang.Exception
protected java.util.Vector<java.util.Properties> createSearchResults(java.sql.ResultSet rs,
java.lang.String prefix)
throws java.lang.Exception
java.lang.Exception
protected java.util.Vector<java.util.Properties> createSearchResultsTyped(java.sql.ResultSet rs,
java.lang.String type)
throws java.lang.Exception
rs - The ResultSettype - Object type (node, machine, etc)
java.lang.Exception
public void addSlice(Slice slice)
throws java.lang.Exception
IDatabase
addSlice in interface IDatabaseslice - Slice object
java.lang.Exception
public void updateSlice(Slice slice)
throws java.lang.Exception
IDatabase
updateSlice in interface IDatabaseslice - slice object
java.lang.Exception
public void removeSlice(SliceID sliceID)
throws java.lang.Exception
IDatabase
removeSlice in interface IDatabasesliceID - slice name
java.lang.Exception
public java.util.Vector<java.util.Properties> getSlices()
throws java.lang.Exception
IDatabase
getSlices in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getInventorySlices()
throws java.lang.Exception
IDatabase
getInventorySlices in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getClientSlices()
throws java.lang.Exception
IDatabase
getClientSlices in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getSlice(SliceID sliceID)
throws java.lang.Exception
IDatabase
getSlice in interface IDatabasesliceID - slice name
java.lang.Exception
public java.util.Vector<java.util.Properties> getSlice(ResourceType type)
throws java.lang.Exception
IDatabase
getSlice in interface IDatabasetype - resource type associated with the slice
java.lang.Exception
public void addReservation(ResourceReservation reservation)
throws java.lang.Exception
IDatabase
addReservation in interface IDatabasejava.lang.Exception
public void updateReservation(ResourceReservation reservation)
throws java.lang.Exception
IDatabase
updateReservation in interface IDatabasejava.lang.Exception
public void removeReservation(ReservationID rid)
throws java.lang.Exception
IDatabase
removeReservation in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getReservations(SliceID sliceID)
throws java.lang.Exception
IDatabase
getReservations in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getClientReservations()
throws java.lang.Exception
IDatabase
getClientReservations in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getHoldings()
throws java.lang.Exception
IDatabase
getHoldings in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getAgentReservations()
throws java.lang.Exception
IDatabase
getAgentReservations in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getAuthorityReservations()
throws java.lang.Exception
IDatabase
getAuthorityReservations in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getReservations()
throws java.lang.Exception
IDatabase
getReservations in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getReservation(ReservationID rid)
throws java.lang.Exception
IDatabase
getReservation in interface IDatabaserid - Reservation identifier
java.lang.Exception
public void addBroker(IBrokerProxy broker)
throws java.lang.Exception
IDatabase
addBroker in interface IDatabasejava.lang.Exception
public void removeBroker(IBrokerProxy broker)
throws java.lang.Exception
IDatabase
removeBroker in interface IDatabasejava.lang.Exception
public void updateBroker(IBrokerProxy broker)
throws java.lang.Exception
IDatabase
updateBroker in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getBrokers()
throws java.lang.Exception
IDatabase
getBrokers in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getConfigurationMappings()
throws java.lang.Exception
IDatabase
getConfigurationMappings in interface IDatabasejava.lang.Exception
public java.util.Vector<java.util.Properties> getConfigurationMapping(java.lang.String key)
throws java.lang.Exception
IDatabase
getConfigurationMapping in interface IDatabasekey - record key
java.lang.Exception
public void addConfigurationMapping(java.lang.String key,
ConfigurationMapping map)
throws java.lang.Exception
IDatabase
addConfigurationMapping in interface IDatabasekey - key for the recordmap - mapping object
java.lang.Exception
public void updateConfigurationMapping(java.lang.String key,
ConfigurationMapping map)
throws java.lang.Exception
IDatabase
updateConfigurationMapping in interface IDatabasekey - record keymap - mapping object
java.lang.Exception
public void removeConfigurationMapping(java.lang.String key)
throws java.lang.Exception
IDatabase
removeConfigurationMapping in interface IDatabasekey - key
java.lang.Exceptionpublic void setActorName(java.lang.String actorName)
IDatabase
setActorName in interface IDatabaseactorName - actor namepublic void registerReservationListener(IStateChangeListener listener)
registerReservationListener in interface IDatabaselistener - public void unregisterReservationListener(IStateChangeListener listener)
unregisterReservationListener in interface IDatabaselistener -
protected void notifyReservationListeners(IReservation r,
ReservationState from,
ReservationState to)
throws java.lang.Exception
r - reservationfrom - state beforeto - state after
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||