orca.shirako.container.db
Class MySqlShirakoContainerDatabase

java.lang.Object
  extended by orca.util.db.MySqlBase
      extended by orca.shirako.container.db.MySqlShirakoContainerDatabase
All Implemented Interfaces:
IContainerDatabase, IInitialize, ISerialize, IShirakoContainerDatabase
Direct Known Subclasses:
MySqlContainerManagementDatabase

public class MySqlShirakoContainerDatabase
extends MySqlBase
implements IShirakoContainerDatabase


Field Summary
static java.lang.String DefaultMapUrl
          Mapping file to use
 
Fields inherited from class orca.util.db.MySqlBase
create, db, DefaultSchema, driverPath, initialized, joclFileLocation, logger, mapFile, mapper, mySqlPasswd, mySqlServer, mySqlServerPort, mySqlUser, pool, PropertyMySqlDb, PropertyMySqlPassword, PropertyMySqlPool, PropertyMySqlServer, PropertyMySqlServerPort, PropertyMySqlUser, resetState, schemaFile, source, TypeDefault
 
Constructor Summary
MySqlShirakoContainerDatabase()
           
MySqlShirakoContainerDatabase(java.lang.String mapFile)
           
 
Method Summary
 void addActor(IActor actor)
          Adds a new actor record to the database
 void addContainerProperties(java.util.Properties p)
          Adds the container properties list.
 void addProtocols(java.util.Properties p)
          Adds the protocols record to the database
 void addTime(java.util.Properties p)
          Adds the time record to the database
protected  java.util.Vector<java.util.Properties> createSearchResults(java.sql.ResultSet rs, java.lang.String prefix)
          Deprecated.  
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
 java.util.Vector<java.util.Properties> getActor(java.lang.String actorName)
          Retrieves the specified actor record
protected  java.lang.String getActorIdFromName(java.lang.String name)
          Deprecated.  
protected  java.lang.String getActorIdFromName(java.lang.String name, java.sql.Connection connection)
          Deprecated.  
 java.util.Vector<java.util.Properties> getActors()
          Retrieves the actors defined in this container
 java.util.Vector<java.util.Properties> getActors(java.lang.String actorName, int type)
          Retrieves the actors defined in this container
 java.util.Vector<java.util.Properties> getContainerProperties()
          Returns the container properties list.
 java.util.Vector<java.util.Properties> getProtocols()
          Retrieves the protocols record from the database
 java.util.Vector<java.util.Properties> getTime()
          Retrieves the time record from the database
 void removeActor(java.lang.String actorName)
          Removes the specified actor record
 void removeActorDatabase(java.lang.String actorName)
          Destroy the database for this actor.
protected  void resetDB(java.sql.Connection connection)
          Empty the database of all previous state
 void revisit(IActorIdentity actor, java.util.Properties properties)
           
 void updateActor(IActor actor)
          Updates the actor's database record
 void updateContainerProperties(java.util.Properties p)
          Updates the container properties list.
 
Methods inherited from class orca.util.db.MySqlBase
checkDb, checkDrivers, configure, constructQueryPartial, getConnection, getDb, getLogger, getMySqlPasswd, getMySqlServer, getMySqlServerPort, getMySqlUser, getPoolConfigLocation, getSchemaString, getServerConnection, initialize, loadDrivers, reset, 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.container.api.IContainerDatabase
getLogger, initialize, setLogger, setResetState
 
Methods inherited from interface orca.shirako.api.IInitialize
initialize
 
Methods inherited from interface orca.shirako.api.ISerialize
reset, save, save
 

Field Detail

DefaultMapUrl

public static final java.lang.String DefaultMapUrl
Mapping file to use

See Also:
Constant Field Values
Constructor Detail

MySqlShirakoContainerDatabase

public MySqlShirakoContainerDatabase()

MySqlShirakoContainerDatabase

public MySqlShirakoContainerDatabase(java.lang.String mapFile)
Method Detail

revisit

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

resetDB

protected void resetDB(java.sql.Connection connection)
                throws java.sql.SQLException
Empty the database of all previous state

Overrides:
resetDB in class MySqlBase
Throws:
java.sql.SQLException

getActorIdFromName

protected java.lang.String getActorIdFromName(java.lang.String name,
                                              java.sql.Connection connection)
                                       throws java.lang.Exception
Deprecated. 

Get the globally unique actor ID from the actor name. Use a subquery where possible instead

Parameters:
name -
connection -
Returns:
actor ID as String
Throws:
java.lang.Exception

getActorIdFromName

protected java.lang.String getActorIdFromName(java.lang.String name)
                                       throws java.lang.Exception
Deprecated. 

Get the globally unique actor ID from the actor name. Use a subquery where possible instead

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

createSearchResultsTyped

protected java.util.Vector<java.util.Properties> createSearchResultsTyped(java.sql.ResultSet rs,
                                                                          java.lang.String type)
                                                                   throws java.lang.Exception
Create a Properties list from a ResultSet obtained from a query

Parameters:
rs - The ResultSet
type - Object type (node, machine, etc)
Returns:
Translated properties list
Throws:
java.lang.Exception

createSearchResults

protected java.util.Vector<java.util.Properties> createSearchResults(java.sql.ResultSet rs,
                                                                     java.lang.String prefix)
                                                              throws java.lang.Exception
Deprecated. 

Throws:
java.lang.Exception

addActor

public void addActor(IActor actor)
              throws java.lang.Exception
Adds a new actor record to the database

Specified by:
addActor in interface IShirakoContainerDatabase
Parameters:
actor - actor to be added
Throws:
java.lang.Exception

removeActor

public void removeActor(java.lang.String actorName)
                 throws java.lang.Exception
Removes the specified actor record

Specified by:
removeActor in interface IShirakoContainerDatabase
Parameters:
actorName - actor name
Throws:
java.lang.Exception

removeActorDatabase

public void removeActorDatabase(java.lang.String actorName)
                         throws java.lang.Exception
Destroy the database for this actor. Applies to actors storing their database on the same database server as the container database.

Specified by:
removeActorDatabase in interface IShirakoContainerDatabase
Parameters:
actorName - actor name
Throws:
java.lang.Exception

updateActor

public void updateActor(IActor actor)
                 throws java.lang.Exception
Updates the actor's database record

Specified by:
updateActor in interface IShirakoContainerDatabase
Throws:
java.lang.Exception

getActors

public java.util.Vector<java.util.Properties> getActors()
                                                 throws java.lang.Exception
Retrieves the actors defined in this container

Specified by:
getActors in interface IShirakoContainerDatabase
Throws:
java.lang.Exception

getActors

public java.util.Vector<java.util.Properties> getActors(java.lang.String actorName,
                                                        int type)
                                                 throws java.lang.Exception
Retrieves the actors defined in this container

Specified by:
getActors in interface IShirakoContainerDatabase
Parameters:
actorName - actor name query string
type - actor type (seed AbstractActor.Type*)
Returns:
Throws:
java.lang.Exception

getActor

public java.util.Vector<java.util.Properties> getActor(java.lang.String actorName)
                                                throws java.lang.Exception
Retrieves the specified actor record

Specified by:
getActor in interface IShirakoContainerDatabase
Parameters:
actorName - actor name
Throws:
java.lang.Exception

addTime

public void addTime(java.util.Properties p)
             throws java.lang.Exception
Adds the time record to the database

Specified by:
addTime in interface IShirakoContainerDatabase
Throws:
java.lang.Exception

getTime

public java.util.Vector<java.util.Properties> getTime()
                                               throws java.lang.Exception
Retrieves the time record from the database

Specified by:
getTime in interface IShirakoContainerDatabase
Returns:
Throws:
java.lang.Exception

addProtocols

public void addProtocols(java.util.Properties p)
                  throws java.lang.Exception
Adds the protocols record to the database

Specified by:
addProtocols in interface IShirakoContainerDatabase
Throws:
java.lang.Exception

getProtocols

public java.util.Vector<java.util.Properties> getProtocols()
                                                    throws java.lang.Exception
Retrieves the protocols record from the database

Specified by:
getProtocols in interface IShirakoContainerDatabase
Returns:
Throws:
java.lang.Exception

addContainerProperties

public void addContainerProperties(java.util.Properties p)
                            throws java.lang.Exception
Description copied from interface: IContainerDatabase
Adds the container properties list.

Specified by:
addContainerProperties in interface IContainerDatabase
Parameters:
p - container properties list.
Throws:
java.lang.Exception

updateContainerProperties

public void updateContainerProperties(java.util.Properties p)
                               throws java.lang.Exception
Description copied from interface: IContainerDatabase
Updates the container properties list.

Specified by:
updateContainerProperties in interface IContainerDatabase
Parameters:
p - container properties list.
Throws:
java.lang.Exception

getContainerProperties

public java.util.Vector<java.util.Properties> getContainerProperties()
                                                              throws java.lang.Exception
Description copied from interface: IContainerDatabase
Returns the container properties list.

Specified by:
getContainerProperties in interface IContainerDatabase
Returns:
container properties list
Throws:
java.lang.Exception


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