orca.cod.plugins.db
Class LdapAuthorityCodDatabase

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
                      extended by orca.cod.plugins.db.LdapAuthorityCodDatabase
All Implemented Interfaces:
AuthorityCodDatabase, CodDatabase, ClientDatabase, IDatabase, IInitialize, IRecover, ISerialize

public class LdapAuthorityCodDatabase
extends LdapCodDatabase
implements AuthorityCodDatabase

Implementation of AuthorityCodDatabase for LDAP.


Field Summary
static java.lang.String DefaultAuthorityLdapMapUrl
          Default mapping file
static java.lang.String Inventory
           
protected  java.lang.String machinesDN
          DN for machine records
static java.lang.String Networking
           
static java.lang.String nodePointer
          Node pointer to follow: maps to the machine this node is pointed to
static java.lang.String obDns
           
static java.lang.String obMachine
           
static java.lang.String ouInventory
           
static java.lang.String PropertyMachinePointer
          Machine pointer to follow
static java.lang.String PropertyMachinesDN
          Property name of the machines DN.
static java.lang.String PropertyStorageDN
          Property name of the storage serveers DN.
static java.lang.String ResourcePools
           
static java.lang.String ResourceTypes
           
protected  java.lang.String storageDN
          DN for storage servers
static java.lang.String TypeNetworking
           
static java.lang.String TypeResourcePool
           
static java.lang.String TypeResourceType
           
 
Fields inherited from class orca.cod.plugins.db.LdapCodDatabase
DefaultServiceManagerLdapMapUrl, Hosts, ObjectClassCodNode, TypeMachine, TypeNode, 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, 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
LdapAuthorityCodDatabase()
          Create a new instance using the default mapping
 
Method Summary
 void addMachine(Machine machine)
          Adds a new machine record
protected  void attachIP(java.util.Properties p)
          Attaches the IP address and host name for a machine
protected  void createHierarchy(com.novell.ldap.LDAPConnection connection, java.lang.String topPrefix)
          
 java.util.Vector<java.util.Properties> getClientNodes(int type, int state)
          Retrieves all nodes from all client slices that are in the specified state and are from the given type.
 java.util.Vector<java.util.Properties> getHostedNodes(java.lang.String machineName)
          Returns a list of nodes hosted on the specified machine
 java.util.Vector<java.util.Properties> getMachine(NodeID id)
          Retrieves the specified machine record using the node identifier.
 java.util.Vector<java.util.Properties> getMachine(java.lang.String name)
          Retrieves the specified machine record
 java.lang.String getMachineNodeDN(java.lang.String name)
           
 java.util.Vector<java.util.Properties> getMachines()
          Retrieves all machine records (that belong to this site)
 java.util.Vector<java.util.Properties> getStorageServer(java.lang.String name)
          Retrieves the specified storage server record
 java.util.Vector<java.util.Properties> getStorageServers()
          Retrieves all storage server records
 void removeMachine(java.lang.String name)
          Removes the specified machine 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 setMachinesDN(java.lang.String DN)
           
 void setStorageDN(java.lang.String dn)
           
 void updateMachine(Machine machine)
          Updates the specified machine record
 
Methods inherited from class orca.cod.plugins.db.LdapCodDatabase
addHandlerInvocation, addNode, createSliceHierarchy, getHostsDN, getHostsDN, getInventoryNodes, getNode, getNodeDN, getNodeDN, getNodeDN, getNodeDN, getNodes, getNodes, getNodes, getNodes, getNodes, getNodes, removeHandlerInvocation, removeNode, updateNode
 
Methods inherited from class orca.sharp.plugins.db.LdapClientDatabase
addClient, 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, returnConnection, 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.cod.plugins.db.CodDatabase
addHandlerInvocation, addNode, getInventoryNodes, getNode, getNodes, getNodes, getNodes, getNodes, getNodes, getNodes, removeHandlerInvocation, removeNode, updateNode
 
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
save
 
Methods inherited from interface orca.shirako.api.IRecover
revisit
 

Field Detail

DefaultAuthorityLdapMapUrl

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

See Also:
Constant Field Values

TypeResourceType

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

TypeResourcePool

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

TypeNetworking

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

ResourceTypes

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

ResourcePools

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

Networking

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

Inventory

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

ouInventory

public static java.lang.String ouInventory

obDns

public static java.lang.String obDns

obMachine

public static java.lang.String obMachine

nodePointer

public static final java.lang.String nodePointer
Node pointer to follow: maps to the machine this node is pointed to

See Also:
Constant Field Values

PropertyMachinePointer

public static final java.lang.String PropertyMachinePointer
Machine pointer to follow

See Also:
Constant Field Values

PropertyMachinesDN

public static final java.lang.String PropertyMachinesDN
Property name of the machines DN.

See Also:
Constant Field Values

PropertyStorageDN

public static final java.lang.String PropertyStorageDN
Property name of the storage serveers DN.

See Also:
Constant Field Values

machinesDN

protected java.lang.String machinesDN
DN for machine records


storageDN

protected java.lang.String storageDN
DN for storage servers

Constructor Detail

LdapAuthorityCodDatabase

public LdapAuthorityCodDatabase()
Create a new instance using the default mapping

Method Detail

createHierarchy

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

Overrides:
createHierarchy in class LdapClientDatabase
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 LdapBase
Parameters:
p - properties list to serialize the object into
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 LdapBase
Parameters:
p - properties list containing the serialized version of the object
Throws:
java.lang.Exception

getMachines

public java.util.Vector<java.util.Properties> getMachines()
                                                   throws java.lang.Exception
Retrieves all machine records (that belong to this site)

Specified by:
getMachines in interface AuthorityCodDatabase
Returns:
Throws:
java.lang.Exception

getMachine

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

Specified by:
getMachine in interface AuthorityCodDatabase
Returns:
Throws:
java.lang.Exception

getMachine

public java.util.Vector<java.util.Properties> getMachine(NodeID id)
                                                  throws java.lang.Exception
Description copied from interface: AuthorityCodDatabase
Retrieves the specified machine record using the node identifier.

Specified by:
getMachine in interface AuthorityCodDatabase
Parameters:
id - node identifier
Returns:
Throws:
java.lang.Exception

attachIP

protected void attachIP(java.util.Properties p)
                 throws java.lang.Exception
Attaches the IP address and host name for a machine

Parameters:
p - serialized machine properties
Throws:
java.lang.Exception

addMachine

public void addMachine(Machine machine)
                throws java.lang.Exception
Adds a new machine record

Specified by:
addMachine in interface AuthorityCodDatabase
Throws:
java.lang.Exception

updateMachine

public void updateMachine(Machine machine)
                   throws java.lang.Exception
Updates the specified machine record

Specified by:
updateMachine in interface AuthorityCodDatabase
Throws:
java.lang.Exception

removeMachine

public void removeMachine(java.lang.String name)
                   throws java.lang.Exception
Removes the specified machine record

Specified by:
removeMachine in interface AuthorityCodDatabase
Throws:
java.lang.Exception

getHostedNodes

public java.util.Vector<java.util.Properties> getHostedNodes(java.lang.String machineName)
                                                      throws java.lang.Exception
Returns a list of nodes hosted on the specified machine

Specified by:
getHostedNodes in interface AuthorityCodDatabase
Parameters:
machineName - machine name
Returns:
Throws:
java.lang.Exception

getStorageServers

public java.util.Vector<java.util.Properties> getStorageServers()
                                                         throws java.lang.Exception
Retrieves all storage server records

Specified by:
getStorageServers in interface AuthorityCodDatabase
Returns:
Throws:
java.lang.Exception

getStorageServer

public java.util.Vector<java.util.Properties> getStorageServer(java.lang.String name)
                                                        throws java.lang.Exception
Retrieves the specified storage server record

Specified by:
getStorageServer in interface AuthorityCodDatabase
Parameters:
name - Server name
Returns:
Throws:
java.lang.Exception

getClientNodes

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

Specified by:
getClientNodes in interface AuthorityCodDatabase
Parameters:
type - type
state - state
Returns:
Throws:
java.lang.Exception

setMachinesDN

public void setMachinesDN(java.lang.String DN)

setStorageDN

public void setStorageDN(java.lang.String dn)

getMachineNodeDN

public java.lang.String getMachineNodeDN(java.lang.String name)


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