orca.manage.container.db
Class MySqlContainerManagementDatabase

java.lang.Object
  extended by orca.util.db.MySqlBase
      extended by orca.shirako.container.db.MySqlShirakoContainerDatabase
          extended by orca.manage.container.db.MySqlContainerManagementDatabase
All Implemented Interfaces:
IContainerDatabase, IContainerManagementDatabase, IUserDatabase, IExtensionsDatabase, IManagerObjectDatabase, IPackageDatabase, IPortalPluginDatabase, IInitialize, ISerialize, IShirakoContainerDatabase

public class MySqlContainerManagementDatabase
extends MySqlShirakoContainerDatabase
implements IContainerManagementDatabase

An implementation of CodManagementDatabase and PackageDatabase for MySql


Field Summary
protected  java.lang.String adminFirst
          Admin name and login.
protected  java.lang.String adminLast
          Admin name and login.
protected  java.lang.String adminLogin
          Admin name and login.
static java.lang.String DefaultCodManagementMapUrl
          Default mapping file to use.
static java.lang.String PropertyAdminFirst
          First name of the admin user.
static java.lang.String PropertyAdminLast
          Last name of the admin user.
static java.lang.String PropertyAdminLogin
          Login for the admin user.
static java.lang.String SiteName
          Site name attribute.
 
Fields inherited from class orca.shirako.container.db.MySqlShirakoContainerDatabase
DefaultMapUrl
 
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
MySqlContainerManagementDatabase()
          Create a new instance using the default mapping file
 
Method Summary
protected  void addAdminUser()
          Adds a record for the admin user, if necessary
 void addManagerObject(ManagerObject manager)
          Registers a new manager object
 void addPackage(ExtensionPackage pack)
          Add a new extension package record
 void addPlugin(Plugin plg)
          Adds a new plugin record
 void addPortalPlugin(PortalPluginDescriptor descriptor)
          Registers a new portal plugin
 void addUser(User user)
          Creates a new user record
 void configure(java.util.Properties p)
           
 java.util.Vector<java.util.Properties> getManagerObject(ID id)
          Returns the specified manager object
 java.util.Vector<java.util.Properties> getManagerObjects()
          Retrieves all manager object
 java.util.Vector<java.util.Properties> getManagerObjects(java.lang.String actorName)
          Retrieves all manager objects associated with the given actor
 java.util.Vector<java.util.Properties> getManagerObjectsContainer()
          Retrieves all manager objects that are not associated with actors
 java.util.Vector<java.util.Properties> getPackage(PackageId id)
          Return the specified package record
protected  java.lang.String getPackageKeyFromId(PackageId id)
           
protected  java.lang.String getPackageKeyFromId(PackageId id, java.sql.Connection connection)
           
 java.util.Vector<java.util.Properties> getPackages()
          Return all package records
 java.util.Vector<java.util.Properties> getPlugin(PackageId packageId, PluginId pluginId)
          Returns the specified plugin record
 java.util.Vector<java.util.Properties> getPlugins(int type)
          Returns all plugins that match the specified type
 java.util.Vector<java.util.Properties> getPlugins(int type, int actorType)
          Returns all plugins that match the specified type and are associated with the given actor type.
 java.util.Vector<java.util.Properties> getPlugins(PackageId packageId, int type)
          Returns all plugins that belong to the specified package and match the specified type.
 java.util.Vector<java.util.Properties> getPlugins(PackageId packageId, int type, int actorType)
          Returns all plugins that belong to the specified package, match the type, and are associated with the given actor type.
 java.util.Vector<java.util.Properties> getPortalPlugin(java.lang.String key)
          Returns the specified portal plugin
 java.util.Vector<java.util.Properties> getPortalPlugins()
          Retrieves all registered portal plugins
 java.util.Vector<java.util.Properties> getPortalPlugins(java.lang.String actorName)
          Retrieves all registered portal plugins for the given actor
 java.util.Vector<java.util.Properties> getPortalPluginsContainer()
          Retrieves all portal plugins that are not associated with a specific actor.
 java.util.Vector<java.util.Properties> getUser(java.lang.String userName)
          Retrieves the specified user record
 java.util.Vector<java.util.Properties> getUsers()
          Retrieves all user records
 void initialize()
          Initializes the object.
 void removeManagerObject(ID id)
          Removes the specified manager object
 void removeManagerObjects(java.lang.String actorName)
          Removes all manager objects associated with the specified actor
 void removePackage(PackageId id)
          Removes the specified package record
 void removePlugin(PackageId packageId, PluginId pluginId)
          Removes the specified plugin record
 void removePlugins(PackageId packageId)
          Removes all plugin records for the specified package
 void removePortalPlugin(java.lang.String key)
          Removes the specified portal plugin
 void removePortalPlugins(java.lang.String actorName)
          Removes all plugin records associated with the given actor.
 void removeUser(java.lang.String user)
          Removes the specified user record
 void reset(java.util.Properties p)
          De-serializes the object from the given properties list.
 void save(java.util.Properties p)
          Serializes the object into the given properties list.
 void updateUser(User user)
          Updates the specified user record
 
Methods inherited from class orca.shirako.container.db.MySqlShirakoContainerDatabase
addActor, addContainerProperties, addProtocols, addTime, createSearchResults, createSearchResultsTyped, getActor, getActorIdFromName, getActorIdFromName, getActors, getActors, getContainerProperties, getProtocols, getTime, removeActor, removeActorDatabase, resetDB, revisit, updateActor, updateContainerProperties
 
Methods inherited from class orca.util.db.MySqlBase
checkDb, checkDrivers, constructQueryPartial, getConnection, getDb, getLogger, getMySqlPasswd, getMySqlServer, getMySqlServerPort, getMySqlUser, getPoolConfigLocation, getSchemaString, getServerConnection, loadDrivers, returnConnection, 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.container.api.IShirakoContainerDatabase
addActor, addProtocols, addTime, getActor, getActors, getActors, getProtocols, getTime, removeActor, removeActorDatabase, updateActor
 
Methods inherited from interface orca.container.api.IContainerDatabase
addContainerProperties, getContainerProperties, getLogger, setLogger, setResetState, updateContainerProperties
 
Methods inherited from interface orca.shirako.api.ISerialize
save
 

Field Detail

PropertyAdminFirst

public static java.lang.String PropertyAdminFirst
First name of the admin user.


PropertyAdminLast

public static java.lang.String PropertyAdminLast
Last name of the admin user.


PropertyAdminLogin

public static java.lang.String PropertyAdminLogin
Login for the admin user.


DefaultCodManagementMapUrl

public static java.lang.String DefaultCodManagementMapUrl
Default mapping file to use.


SiteName

public static java.lang.String SiteName
Site name attribute.


adminFirst

protected java.lang.String adminFirst
Admin name and login.


adminLast

protected java.lang.String adminLast
Admin name and login.


adminLogin

protected java.lang.String adminLogin
Admin name and login.

Constructor Detail

MySqlContainerManagementDatabase

public MySqlContainerManagementDatabase()
Create a new instance using the default mapping file

Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Description copied from interface: IInitialize
Initializes the object.

Specified by:
initialize in interface IContainerDatabase
Specified by:
initialize in interface IInitialize
Overrides:
initialize in class MySqlBase
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 MySqlBase
Parameters:
p - properties list to serialize the object into
Throws:
java.lang.Exception

configure

public void configure(java.util.Properties p)
               throws java.lang.Exception
Overrides:
configure in class MySqlBase
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 MySqlBase
Parameters:
p - properties list containing the serialized version of the object
Throws:
java.lang.Exception

addAdminUser

protected void addAdminUser()
                     throws java.lang.Exception
Adds a record for the admin user, if necessary

Throws:
java.lang.Exception

getUsers

public java.util.Vector<java.util.Properties> getUsers()
                                                throws java.lang.Exception
Description copied from interface: IUserDatabase
Retrieves all user records

Specified by:
getUsers in interface IUserDatabase
Returns:
Throws:
java.lang.Exception

getUser

public java.util.Vector<java.util.Properties> getUser(java.lang.String userName)
                                               throws java.lang.Exception
Description copied from interface: IUserDatabase
Retrieves the specified user record

Specified by:
getUser in interface IUserDatabase
Parameters:
userName - user name
Returns:
Throws:
java.lang.Exception

addUser

public void addUser(User user)
             throws java.lang.Exception
Description copied from interface: IUserDatabase
Creates a new user record

Specified by:
addUser in interface IUserDatabase
Parameters:
user - user
Throws:
java.lang.Exception

updateUser

public void updateUser(User user)
                throws java.lang.Exception
Description copied from interface: IUserDatabase
Updates the specified user record

Specified by:
updateUser in interface IUserDatabase
Throws:
java.lang.Exception

removeUser

public void removeUser(java.lang.String user)
                throws java.lang.Exception
Description copied from interface: IUserDatabase
Removes the specified user record

Specified by:
removeUser in interface IUserDatabase
Throws:
java.lang.Exception

addPackage

public void addPackage(ExtensionPackage pack)
                throws java.lang.Exception
Description copied from interface: IPackageDatabase
Add a new extension package record

Specified by:
addPackage in interface IPackageDatabase
Throws:
java.lang.Exception

removePackage

public void removePackage(PackageId id)
                   throws java.lang.Exception
Description copied from interface: IPackageDatabase
Removes the specified package record

Specified by:
removePackage in interface IPackageDatabase
Throws:
java.lang.Exception

getPackage

public java.util.Vector<java.util.Properties> getPackage(PackageId id)
                                                  throws java.lang.Exception
Description copied from interface: IPackageDatabase
Return the specified package record

Specified by:
getPackage in interface IPackageDatabase
Returns:
Throws:
java.lang.Exception

getPackages

public java.util.Vector<java.util.Properties> getPackages()
                                                   throws java.lang.Exception
Description copied from interface: IPackageDatabase
Return all package records

Specified by:
getPackages in interface IPackageDatabase
Returns:
Throws:
java.lang.Exception

getPackageKeyFromId

protected java.lang.String getPackageKeyFromId(PackageId id,
                                               java.sql.Connection connection)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

getPackageKeyFromId

protected java.lang.String getPackageKeyFromId(PackageId id)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

addPlugin

public void addPlugin(Plugin plg)
               throws java.lang.Exception
Description copied from interface: IPackageDatabase
Adds a new plugin record

Specified by:
addPlugin in interface IPackageDatabase
Throws:
java.lang.Exception

removePlugin

public void removePlugin(PackageId packageId,
                         PluginId pluginId)
                  throws java.lang.Exception
Description copied from interface: IPackageDatabase
Removes the specified plugin record

Specified by:
removePlugin in interface IPackageDatabase
Throws:
java.lang.Exception

removePlugins

public void removePlugins(PackageId packageId)
                   throws java.lang.Exception
Description copied from interface: IPackageDatabase
Removes all plugin records for the specified package

Specified by:
removePlugins in interface IPackageDatabase
Throws:
java.lang.Exception

getPlugins

public java.util.Vector<java.util.Properties> getPlugins(PackageId packageId,
                                                         int type)
                                                  throws java.lang.Exception
Description copied from interface: IPackageDatabase
Returns all plugins that belong to the specified package and match the specified type.

Specified by:
getPlugins in interface IPackageDatabase
Returns:
Throws:
java.lang.Exception

getPlugins

public java.util.Vector<java.util.Properties> getPlugins(PackageId packageId,
                                                         int type,
                                                         int actorType)
                                                  throws java.lang.Exception
Description copied from interface: IPackageDatabase
Returns all plugins that belong to the specified package, match the type, and are associated with the given actor type.

Specified by:
getPlugins in interface IPackageDatabase
Returns:
Throws:
java.lang.Exception

getPlugins

public java.util.Vector<java.util.Properties> getPlugins(int type,
                                                         int actorType)
                                                  throws java.lang.Exception
Description copied from interface: IPackageDatabase
Returns all plugins that match the specified type and are associated with the given actor type.

Specified by:
getPlugins in interface IPackageDatabase
Returns:
Throws:
java.lang.Exception

getPlugins

public java.util.Vector<java.util.Properties> getPlugins(int type)
                                                  throws java.lang.Exception
Description copied from interface: IPackageDatabase
Returns all plugins that match the specified type

Specified by:
getPlugins in interface IPackageDatabase
Returns:
Throws:
java.lang.Exception

getPlugin

public java.util.Vector<java.util.Properties> getPlugin(PackageId packageId,
                                                        PluginId pluginId)
                                                 throws java.lang.Exception
Description copied from interface: IPackageDatabase
Returns the specified plugin record

Specified by:
getPlugin in interface IPackageDatabase
Returns:
Throws:
java.lang.Exception

addPortalPlugin

public void addPortalPlugin(PortalPluginDescriptor descriptor)
                     throws java.lang.Exception
Description copied from interface: IPortalPluginDatabase
Registers a new portal plugin

Specified by:
addPortalPlugin in interface IPortalPluginDatabase
Throws:
java.lang.Exception

removePortalPlugin

public void removePortalPlugin(java.lang.String key)
                        throws java.lang.Exception
Description copied from interface: IPortalPluginDatabase
Removes the specified portal plugin

Specified by:
removePortalPlugin in interface IPortalPluginDatabase
Parameters:
key - Key identifying the portal plugin
Throws:
java.lang.Exception

removePortalPlugins

public void removePortalPlugins(java.lang.String actorName)
                         throws java.lang.Exception
Description copied from interface: IPortalPluginDatabase
Removes all plugin records associated with the given actor.

Specified by:
removePortalPlugins in interface IPortalPluginDatabase
Parameters:
actorName - actor name
Throws:
java.lang.Exception

getPortalPlugin

public java.util.Vector<java.util.Properties> getPortalPlugin(java.lang.String key)
                                                       throws java.lang.Exception
Description copied from interface: IPortalPluginDatabase
Returns the specified portal plugin

Specified by:
getPortalPlugin in interface IPortalPluginDatabase
Parameters:
key - Key identifying the portal plugin
Returns:
Throws:
java.lang.Exception

getPortalPlugins

public java.util.Vector<java.util.Properties> getPortalPlugins()
                                                        throws java.lang.Exception
Description copied from interface: IPortalPluginDatabase
Retrieves all registered portal plugins

Specified by:
getPortalPlugins in interface IPortalPluginDatabase
Returns:
Throws:
java.lang.Exception

getPortalPlugins

public java.util.Vector<java.util.Properties> getPortalPlugins(java.lang.String actorName)
                                                        throws java.lang.Exception
Description copied from interface: IPortalPluginDatabase
Retrieves all registered portal plugins for the given actor

Specified by:
getPortalPlugins in interface IPortalPluginDatabase
Parameters:
actorName - actor name
Returns:
Throws:
java.lang.Exception

getPortalPluginsContainer

public java.util.Vector<java.util.Properties> getPortalPluginsContainer()
                                                                 throws java.lang.Exception
Description copied from interface: IPortalPluginDatabase
Retrieves all portal plugins that are not associated with a specific actor.

Specified by:
getPortalPluginsContainer in interface IPortalPluginDatabase
Returns:
Throws:
java.lang.Exception

addManagerObject

public void addManagerObject(ManagerObject manager)
                      throws java.lang.Exception
Description copied from interface: IManagerObjectDatabase
Registers a new manager object

Specified by:
addManagerObject in interface IManagerObjectDatabase
Parameters:
manager - The manager object
Throws:
java.lang.Exception

removeManagerObject

public void removeManagerObject(ID id)
                         throws java.lang.Exception
Description copied from interface: IManagerObjectDatabase
Removes the specified manager object

Specified by:
removeManagerObject in interface IManagerObjectDatabase
Parameters:
id - Unique identifier of the manager object
Throws:
java.lang.Exception

removeManagerObjects

public void removeManagerObjects(java.lang.String actorName)
                          throws java.lang.Exception
Description copied from interface: IManagerObjectDatabase
Removes all manager objects associated with the specified actor

Specified by:
removeManagerObjects in interface IManagerObjectDatabase
Throws:
java.lang.Exception

getManagerObject

public java.util.Vector<java.util.Properties> getManagerObject(ID id)
                                                        throws java.lang.Exception
Description copied from interface: IManagerObjectDatabase
Returns the specified manager object

Specified by:
getManagerObject in interface IManagerObjectDatabase
Returns:
Throws:
java.lang.Exception

getManagerObjects

public java.util.Vector<java.util.Properties> getManagerObjects()
                                                         throws java.lang.Exception
Description copied from interface: IManagerObjectDatabase
Retrieves all manager object

Specified by:
getManagerObjects in interface IManagerObjectDatabase
Returns:
Throws:
java.lang.Exception

getManagerObjects

public java.util.Vector<java.util.Properties> getManagerObjects(java.lang.String actorName)
                                                         throws java.lang.Exception
Description copied from interface: IManagerObjectDatabase
Retrieves all manager objects associated with the given actor

Specified by:
getManagerObjects in interface IManagerObjectDatabase
Parameters:
actorName - Name of the actor
Returns:
Throws:
java.lang.Exception

getManagerObjectsContainer

public java.util.Vector<java.util.Properties> getManagerObjectsContainer()
                                                                  throws java.lang.Exception
Description copied from interface: IManagerObjectDatabase
Retrieves all manager objects that are not associated with actors

Specified by:
getManagerObjectsContainer in interface IManagerObjectDatabase
Returns:
Throws:
java.lang.Exception


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