orca.cod.plugins.db
Class LdapCodDatabase

java.lang.Object
  extended by orca.util.db.DatabaseBase
      extended by orca.util.db.LdapBase
          extended by orca.shirako.plugins.db.LdapDatabase
              extended by orca.sharp.plugins.db.LdapClientDatabase
                  extended by orca.cod.plugins.db.LdapCodDatabase
All Implemented Interfaces:
CodDatabase, ClientDatabase, IDatabase, IInitialize, IRecover, ISerialize
Direct Known Subclasses:
LdapAuthorityCodDatabase

public class LdapCodDatabase
extends LdapClientDatabase
implements CodDatabase

Implementation of CodDatabase for LDAP.


Field Summary
static java.lang.String DefaultServiceManagerLdapMapUrl
          Default mapping file
static java.lang.String Hosts
           
static java.lang.String ObjectClassCodNode
           
static java.lang.String TypeMachine
           
static java.lang.String TypeNode
           
static java.lang.String TypeStorage
           
 
Fields inherited from class orca.sharp.plugins.db.LdapClientDatabase
Client, Clients, clientsDN, DefaultClientsLdapMapUrl
 
Fields inherited from class orca.shirako.plugins.db.LdapDatabase
actorName, Brokers, brokersDN, ConfigMappings, configMappingsDN, Configs, configsDN, DefaultConfigUrl, Inventory, inventoryDN, ObjectClassReservation, ObjectClassSlice, Peers, peersDN, PropertyNodeState, PropertyReservationID, reservationListeners, Reservations, Slices, slicesDN, TypeBroker, TypeConfigMapping, TypeReservation, TypeSlice
 
Fields inherited from class orca.util.db.LdapBase
AllEntries, baseDN, bindDN, bindPasswd, bindPasswdBytes, cn, cnE, create, dc, dcE, DefaultMaxPhysicalConnections, DefaultMaxSharesPerPhysicalConnection, 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
LdapCodDatabase()
          Creates a new instance using the default mapping file.
LdapCodDatabase(java.lang.String mapFile)
          Creates a new instance using the specified mapping file.
 
Method Summary
 void addHandlerInvocation(java.lang.String type, Node node, java.util.Properties p)
          Adds a handler invocation record
 void addNode(Node node)
          Adds a database record for the specified node.
protected  void createSliceHierarchy(com.novell.ldap.LDAPConnection connection, Slice slice)
          Creates the slice hierarchy
protected  java.lang.String getHostsDN(Slice slice)
          Returns the hosts DN for the given slice
protected  java.lang.String getHostsDN(SliceID sliceID)
          Returns the hosts DN for the given slice
 java.util.Vector<java.util.Properties> getInventoryNodes(int type, int state)
          Retrieves all nodes from all inventory slices that are from the specified type and are in the specified state.
 java.util.Vector<java.util.Properties> getNode(NodeID nodeID)
          Retrieves the specified node record.
protected  java.lang.String getNodeDN(Node n)
          Returns the DN for the specified node
protected  java.lang.String getNodeDN(NodeID nid)
          Returns the DN for the specified reservation
protected  java.lang.String getNodeDN(Node n, SliceID sliceID)
          Returns the DN for the specified node
protected  java.lang.String getNodeDN(SliceID sliceID, NodeID nodeID)
          Returns the DN for the specified node
 java.util.Vector<java.util.Properties> getNodes(int type, int state)
          Retrieves all nodes from all slices that are from the specified type and are in the specified state.
 java.util.Vector<java.util.Properties> getNodes(NodeID[] ids)
          Retrieves the specified nodes
 java.util.Vector<java.util.Properties> getNodes(ReservationID rid)
          Retrieves all nodes for the specified reservation
 java.util.Vector<java.util.Properties> getNodes(ReservationID rid, int state)
          Retrieves all nodes for the reservation that are in the specified state.
 java.util.Vector<java.util.Properties> getNodes(SliceID sliceID)
          Retrieves all nodes in the specified slice
 java.util.Vector<java.util.Properties> getNodes(SliceID sliceID, int state)
          Retrieves all nodes in the specified slice that are in the specified state
 void removeHandlerInvocation(java.lang.String type, Node node, java.util.Properties p)
          Removes a handler invocation record
 void removeNode(NodeID nodeID)
          Removes the database record for the specified node.
 void updateNode(Node node)
          Updates the corresponding node record.
 
Methods inherited from class orca.sharp.plugins.db.LdapClientDatabase
addClient, createHierarchy, getClient, getClientDN, getClientPrefix, getClients, initDNs, removeClient, updateClient
 
Methods inherited from class orca.shirako.plugins.db.LdapDatabase
actorAdded, addBroker, addConfigurationMapping, addReservation, addSlice, getAgentReservations, getAuthorityReservations, getBrokerDN, getBrokers, getClientReservations, getClientSlices, getConfigurationMapping, getConfigurationMappingDN, getConfigurationMappings, getHoldings, getInventorySlices, getReservation, getReservationDN, getReservationDN, getReservations, getReservations, getReservationsDN, getSlice, getSlice, getSliceDN, getSlices, initialize, notifyReservationListeners, registerReservationListener, removeBroker, removeConfigurationMapping, removeReservation, removeSlice, revisit, setActorName, unregisterReservationListener, updateBroker, updateConfigurationMapping, updateReservation, updateSlice
 
Methods inherited from class orca.util.db.LdapBase
checkBase, configure, deleteContainer, exists, getBaseDN, getBindDN, getConnection, getDatabaseData, getLogger, getPassword, getProperties, getServer, 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.shirako.api.IDatabase
actorAdded, addBroker, addConfigurationMapping, addReservation, addSlice, getAgentReservations, getAuthorityReservations, getBrokers, getClientReservations, getClientSlices, getConfigurationMapping, getConfigurationMappings, getHoldings, getInventorySlices, getLogger, getReservation, getReservations, getReservations, getSlice, getSlice, getSlices, registerReservationListener, removeBroker, removeConfigurationMapping, removeReservation, removeSlice, setActorName, setLogger, setResetState, unregisterReservationListener, updateBroker, updateConfigurationMapping, updateReservation, updateSlice
 
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
 

Field Detail

DefaultServiceManagerLdapMapUrl

public static final java.lang.String DefaultServiceManagerLdapMapUrl
Default mapping file

See Also:
Constant Field Values

Hosts

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

ObjectClassCodNode

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

TypeNode

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

TypeMachine

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

TypeStorage

public static final java.lang.String TypeStorage
See Also:
Constant Field Values
Constructor Detail

LdapCodDatabase

public LdapCodDatabase()
Creates a new instance using the default mapping file.


LdapCodDatabase

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

Parameters:
mapFile -
Method Detail

createSliceHierarchy

protected void createSliceHierarchy(com.novell.ldap.LDAPConnection connection,
                                    Slice slice)
                             throws java.lang.Exception
Creates the slice hierarchy

Overrides:
createSliceHierarchy in class LdapDatabase
Parameters:
connection - connection object
slice - slice
Throws:
java.lang.Exception

addHandlerInvocation

public void addHandlerInvocation(java.lang.String type,
                                 Node node,
                                 java.util.Properties p)
                          throws java.lang.Exception
Description copied from interface: CodDatabase
Adds a handler invocation record

Specified by:
addHandlerInvocation in interface CodDatabase
Throws:
java.lang.Exception

removeHandlerInvocation

public void removeHandlerInvocation(java.lang.String type,
                                    Node node,
                                    java.util.Properties p)
                             throws java.lang.Exception
Description copied from interface: CodDatabase
Removes a handler invocation record

Specified by:
removeHandlerInvocation in interface CodDatabase
Throws:
java.lang.Exception

addNode

public void addNode(Node node)
             throws java.lang.Exception
Description copied from interface: CodDatabase
Adds a database record for the specified node.

Specified by:
addNode in interface CodDatabase
Parameters:
node - node object
Throws:
java.lang.Exception

updateNode

public void updateNode(Node node)
                throws java.lang.Exception
Description copied from interface: CodDatabase
Updates the corresponding node record.

Specified by:
updateNode in interface CodDatabase
Parameters:
node - node object
Throws:
java.lang.Exception

removeNode

public void removeNode(NodeID nodeID)
                throws java.lang.Exception
Description copied from interface: CodDatabase
Removes the database record for the specified node.

Specified by:
removeNode in interface CodDatabase
Parameters:
nodeID - node identifier
Throws:
java.lang.Exception

getNode

public java.util.Vector<java.util.Properties> getNode(NodeID nodeID)
                                               throws java.lang.Exception
Description copied from interface: CodDatabase
Retrieves the specified node record.

Specified by:
getNode in interface CodDatabase
Parameters:
nodeID - node identifier
Returns:
Throws:
java.lang.Exception

getNodes

public java.util.Vector<java.util.Properties> getNodes(ReservationID rid)
                                                throws java.lang.Exception
Description copied from interface: CodDatabase
Retrieves all nodes for the specified reservation

Specified by:
getNodes in interface CodDatabase
Parameters:
rid - Reservation id
Returns:
Throws:
java.lang.Exception

getNodes

public java.util.Vector<java.util.Properties> getNodes(ReservationID rid,
                                                       int state)
                                                throws java.lang.Exception
Description copied from interface: CodDatabase
Retrieves all nodes for the reservation that are in the specified state.

Specified by:
getNodes in interface CodDatabase
Parameters:
rid - Reservation
state - Node state
Returns:
Throws:
java.lang.Exception

getNodes

public java.util.Vector<java.util.Properties> getNodes(SliceID sliceID)
                                                throws java.lang.Exception
Description copied from interface: CodDatabase
Retrieves all nodes in the specified slice

Specified by:
getNodes in interface CodDatabase
Returns:
Throws:
java.lang.Exception

getNodes

public java.util.Vector<java.util.Properties> getNodes(SliceID sliceID,
                                                       int state)
                                                throws java.lang.Exception
Description copied from interface: CodDatabase
Retrieves all nodes in the specified slice that are in the specified state

Specified by:
getNodes in interface CodDatabase
Parameters:
sliceID - sliceName
Returns:
Throws:
java.lang.Exception

getNodes

public java.util.Vector<java.util.Properties> getNodes(NodeID[] ids)
                                                throws java.lang.Exception
Description copied from interface: CodDatabase
Retrieves the specified nodes

Specified by:
getNodes in interface CodDatabase
Parameters:
ids - an array of node identifiers
Throws:
java.lang.Exception

getNodes

public java.util.Vector<java.util.Properties> getNodes(int type,
                                                       int state)
                                                throws java.lang.Exception
Description copied from interface: CodDatabase
Retrieves all nodes from all slices that are from the specified type and are in the specified state.

Specified by:
getNodes in interface CodDatabase
Parameters:
type - type
state - state
Returns:
Throws:
java.lang.Exception

getInventoryNodes

public java.util.Vector<java.util.Properties> getInventoryNodes(int type,
                                                                int state)
                                                         throws java.lang.Exception
Description copied from interface: CodDatabase
Retrieves all nodes from all inventory slices that are from the specified type and are in the specified state.

Specified by:
getInventoryNodes in interface CodDatabase
Parameters:
type - type
state - state
Returns:
Throws:
java.lang.Exception

getHostsDN

protected java.lang.String getHostsDN(SliceID sliceID)
Returns the hosts DN for the given slice

Parameters:
sliceID - slice identifier

getHostsDN

protected java.lang.String getHostsDN(Slice slice)
Returns the hosts DN for the given slice

Parameters:
slice - slice
Returns:

getNodeDN

protected java.lang.String getNodeDN(Node n)
Returns the DN for the specified node

Parameters:
n - node
Returns:

getNodeDN

protected java.lang.String getNodeDN(Node n,
                                     SliceID sliceID)
Returns the DN for the specified node

Parameters:
n - node
sliceName - slice name
Returns:

getNodeDN

protected java.lang.String getNodeDN(SliceID sliceID,
                                     NodeID nodeID)
Returns the DN for the specified node

Parameters:
sliceName - slice name
nodeId - node node id
Returns:

getNodeDN

protected java.lang.String getNodeDN(NodeID nid)
                              throws java.lang.Exception
Returns the DN for the specified reservation

Parameters:
rid - reservation id
Returns:
Throws:
java.lang.Exception


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