orca.shirako.container.db
Class LdapShirakoContainerDatabase

java.lang.Object
  extended by orca.util.db.DatabaseBase
      extended by orca.util.db.LdapBase
          extended by orca.shirako.container.db.LdapShirakoContainerDatabase
All Implemented Interfaces:
IContainerDatabase, IInitialize, ISerialize, IShirakoContainerDatabase

public class LdapShirakoContainerDatabase
extends LdapBase
implements IShirakoContainerDatabase

Implementation of the Container Database interface for an LDAP database.


Field Summary
static java.lang.String Actors
           
static java.lang.String ActorsBase
           
protected  java.lang.String actorsBaseDN
          DN for actor sub-trees: per actor database
protected  java.lang.String actorsDN
          DN for actors: list of of actors
static java.lang.String DefaultContainerLdapMapUrl
          Default mapping file to use
static java.lang.String Protocols
           
protected  java.lang.String protocolsDN
          DN for protocols record
protected  java.lang.String protocolsPrefix
          Prefix for protocols record
static java.lang.String Time
           
protected  java.lang.String timeDN
          DN for time record
protected  java.lang.String timePrefix
          Prefix for time record
static java.lang.String TypeActor
           
static java.lang.String TypeProtocols
           
static java.lang.String TypeTime
           
 
Fields inherited from class orca.util.db.LdapBase
AllEntries, baseDN, bindDN, bindPasswd, bindPasswdBytes, cn, cnE, create, dc, dcE, DefaultMaxPhysicalConnections, DefaultMaxSharesPerPhysicalConnection, initialized, ldapServer, logger, mapFile, mapper, maxPhysicalConnections, maxSharesPerPhysicalConnection, obCodCluster, objectClass, objectClassE, obMisc, obOU, obShirako, obTop, ou, ouE, pool, PropertyLdapBaseDN, PropertyLdapBindDN, PropertyLdapPassword, PropertyLdapServer, resetState
 
Fields inherited from class orca.util.db.DatabaseBase
PropertyDBClassName
 
Constructor Summary
LdapShirakoContainerDatabase()
          Creates a new instance.
LdapShirakoContainerDatabase(java.lang.String mapFile)
          Creates a new instance using the specified mapping file.
 
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  void createHierarchy(com.novell.ldap.LDAPConnection connection, java.lang.String topPrefix)
          Creates the database hierarchy
protected  java.util.Vector<java.util.Properties> filterActorType(java.util.Vector<java.util.Properties> actors, int type)
          Filters actors by type
 java.util.Vector<java.util.Properties> getActor(java.lang.String name)
          Retrieves the specified actor record
 java.lang.String getActorBaseDN(java.lang.String name)
          Returns the DN of the given actor sub-tree
 java.lang.String getActorDN(java.lang.String name)
          Returns the actors DN.
 java.util.Vector<java.util.Properties> getActors()
          Retrieves the actors defined in this container
 java.util.Vector<java.util.Properties> getActors(java.lang.String name, int type)
          Retrieves the actors defined in this container
 java.lang.String getActorsBase()
          Returns the base for actor sub-trees.
 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
protected  void initDNs()
          Initializes DN names.
 void removeActor(java.lang.String actorName)
          Removes the specified actor record
 void removeActorDatabase(java.lang.String actorName)
          Destroy the database for this actor.
 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.LdapBase
checkBase, configure, deleteContainer, exists, getBaseDN, getBindDN, getConnection, getDatabaseData, getLogger, getPassword, getProperties, getServer, initialize, reset, returnConnection, save, save, search, searchBase, searchOne, searchSub, setBaseDN, setBindDN, setBindPassword, setLogger, setMaxPhysicalConnections, setMaxSharesPerPhysicalConnection, setResetState, setServer
 
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

DefaultContainerLdapMapUrl

public static final java.lang.String DefaultContainerLdapMapUrl
Default mapping file to use

See Also:
Constant Field Values

Actors

public static java.lang.String Actors

Time

public static java.lang.String Time

Protocols

public static java.lang.String Protocols

ActorsBase

public static java.lang.String ActorsBase

TypeActor

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

TypeTime

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

TypeProtocols

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

actorsDN

protected java.lang.String actorsDN
DN for actors: list of of actors


timeDN

protected java.lang.String timeDN
DN for time record


protocolsDN

protected java.lang.String protocolsDN
DN for protocols record


timePrefix

protected java.lang.String timePrefix
Prefix for time record


protocolsPrefix

protected java.lang.String protocolsPrefix
Prefix for protocols record


actorsBaseDN

protected java.lang.String actorsBaseDN
DN for actor sub-trees: per actor database

Constructor Detail

LdapShirakoContainerDatabase

public LdapShirakoContainerDatabase()
Creates a new instance.


LdapShirakoContainerDatabase

public LdapShirakoContainerDatabase(java.lang.String mapFile)
Creates a new instance using the specified mapping file.

Parameters:
mapFile -
Method Detail

revisit

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

initDNs

protected void initDNs()
Initializes DN names.

Overrides:
initDNs in class LdapBase

createHierarchy

protected void createHierarchy(com.novell.ldap.LDAPConnection connection,
                               java.lang.String topPrefix)
                        throws java.lang.Exception
Creates the database hierarchy

Overrides:
createHierarchy in class LdapBase
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 name,
                                                        int type)
                                                 throws java.lang.Exception
Retrieves the actors defined in this container

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

filterActorType

protected java.util.Vector<java.util.Properties> filterActorType(java.util.Vector<java.util.Properties> actors,
                                                                 int type)
Filters actors by type

Parameters:
actors -
type - See AbstractActor for type definitions
Returns:

getActor

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

Specified by:
getActor in interface IShirakoContainerDatabase
Parameters:
name - 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
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
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
Returns the container properties list.

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

getActorsBase

public java.lang.String getActorsBase()
Returns the base for actor sub-trees.

Returns:

getActorDN

public java.lang.String getActorDN(java.lang.String name)
Returns the actors DN.

Parameters:
name - actor name
Returns:

getActorBaseDN

public java.lang.String getActorBaseDN(java.lang.String name)
Returns the DN of the given actor sub-tree

Parameters:
name - actor name
Returns:


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