xdrs_impl.mysql
Class MySQLDBImplementation

java.lang.Object
  extended byxdrs_impl.genericdb.DBImplementation
      extended byxdrs_impl.mysql.MySQLDBImplementation

public class MySQLDBImplementation
extends DBImplementation

This class is an mysql impl for XDirectoryService.

Version:
$Revision: 1.1 $ $Date: 2005/05/06 21:31:07 $ (GMT)
Author:
matt, Gopi Kandaswamy

Constructor Summary
MySQLDBImplementation()
           
 
Method Summary
 void addDNForUser(java.sql.Connection connection, java.lang.String user, java.lang.String dn)
           
 void addGroup(java.sql.Connection connection, java.lang.String group, java.lang.String superGroup)
           
 void addMapping(java.sql.Connection connection, Mapping parent, java.lang.String path, java.lang.String type, java.lang.String typeNamespace, int id, java.lang.String owner, java.lang.String readWriteGroup, java.lang.String readOnlyGroup)
          Store the described mapping.
 void addUserToGroup(java.sql.Connection connection, java.lang.String user, java.lang.String group)
           
 int addXML(java.sql.Connection connection, org.gjt.xpp.XmlNode node)
           
 void create(java.sql.Connection connection)
          Create all tables etc.
 void deleteAllDNsForUser(java.sql.Connection connection, java.lang.String user)
           
 void deleteDNForUser(java.sql.Connection connection, java.lang.String user, java.lang.String dn)
           
 void deleteGroup(java.sql.Connection connection, java.lang.String group)
           
 void deleteMapping(java.sql.Connection connection, java.lang.String path)
          Delete the path's mapping.
 void deleteUser(java.sql.Connection connection, java.lang.String user)
           
 void deleteXML(java.sql.Connection connection, int id)
           
 void drop(java.sql.Connection connection)
          Drop all the tables etc.
 boolean existsXML(java.sql.Connection connection, int id)
           
 void getGroups(java.sql.Connection connection, java.lang.String user, java.util.Vector groupNamesVector)
           
 Mapping getMapping(java.sql.Connection connection, int parentId)
           
 Mapping getMapping(java.sql.Connection connection, java.lang.String path)
          Get a Mapping for the given path.
 Mapping[] getMappings(java.sql.Connection connection, int parent)
          Get all of the mappings who have the given parent.
 java.lang.String getUserForDN(java.sql.Connection connection, java.lang.String dn)
           
 org.gjt.xpp.XmlNode getXML(java.sql.Connection connection, int id)
           
 boolean isGroup(java.sql.Connection connection, java.lang.String group)
           
 boolean isUser(java.sql.Connection connection, java.lang.String user)
           
 java.lang.String[] keywordSearch(java.sql.Connection connection, java.lang.String[] keywords, boolean doAnd, int maxResults)
           
 java.util.Vector listGroups(java.sql.Connection connection)
           
 void listSubGroupsOfGroup(java.sql.Connection connection, java.lang.String group, java.util.Vector groupsVector, boolean recurse)
           
 java.util.Vector listUsers(java.sql.Connection connection)
           
 void listUsersOfGroup(java.sql.Connection connection, java.lang.String group, java.util.Vector usersVector, boolean recurse)
           
 boolean mappingExists(java.sql.Connection connection, java.lang.String path)
          Check to see if the path exists.
 void modifyMapping(java.sql.Connection connection, int parentID, java.lang.String path, java.lang.String type, java.lang.String typeNamespace, int id, java.lang.String owner, java.lang.String readWriteGroup, java.lang.String readOnlyGroup)
           
 void removeUserFromGroup(java.sql.Connection connection, java.lang.String user, java.lang.String group)
           
 void updateXML(java.sql.Connection connection, int id, org.gjt.xpp.XmlNode node)
           
 
Methods inherited from class xdrs_impl.genericdb.DBImplementation
addMapping, createHandlers, dropHandlers, getHandler, registerDefaultHandler, registerHandler, traceSqlFine, traceSqlFiner, traceSqlFinest, traceSqlResultFinest, traceSqlRowResultFine, traceSqlRowResultFine, traceSqlRowResultFine, traceSqlRowResultFiner, traceSqlRowResultFiner, traceSqlRowResultFinest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLDBImplementation

public MySQLDBImplementation()
Method Detail

create

public void create(java.sql.Connection connection)
            throws soaprmi.RemoteException,
                   java.sql.SQLException
Description copied from class: DBImplementation
Create all tables etc. needed for this implementation.

Specified by:
create in class DBImplementation
Parameters:
connection - A database connection.
Throws:
soaprmi.RemoteException
java.sql.SQLException

drop

public void drop(java.sql.Connection connection)
          throws soaprmi.RemoteException,
                 java.sql.SQLException
Description copied from class: DBImplementation
Drop all the tables etc. used for this implementation.

Specified by:
drop in class DBImplementation
Parameters:
connection - A database connection.
Throws:
java.sql.SQLException
soaprmi.RemoteException

mappingExists

public boolean mappingExists(java.sql.Connection connection,
                             java.lang.String path)
                      throws soaprmi.RemoteException,
                             java.sql.SQLException
Description copied from class: DBImplementation
Check to see if the path exists.

Specified by:
mappingExists in class DBImplementation
Parameters:
connection - A database connection.
path - The path to check.
Returns:
Whether the path exists or not.
Throws:
soaprmi.RemoteException
java.sql.SQLException

getMapping

public Mapping getMapping(java.sql.Connection connection,
                          java.lang.String path)
                   throws soaprmi.RemoteException
Description copied from class: DBImplementation
Get a Mapping for the given path.

Specified by:
getMapping in class DBImplementation
Parameters:
connection - A database connection.
path - The path for which a mapping is requested.
Returns:
a Mapping
Throws:
soaprmi.RemoteException

getMappings

public Mapping[] getMappings(java.sql.Connection connection,
                             int parent)
                      throws soaprmi.RemoteException,
                             java.sql.SQLException
Description copied from class: DBImplementation
Get all of the mappings who have the given parent.

Specified by:
getMappings in class DBImplementation
Parameters:
connection - A database connection.
parent - The parent's id.
Returns:
An array of Mappings containing the given parent's children.
Throws:
soaprmi.RemoteException
java.sql.SQLException

deleteMapping

public void deleteMapping(java.sql.Connection connection,
                          java.lang.String path)
                   throws soaprmi.RemoteException,
                          java.sql.SQLException
Description copied from class: DBImplementation
Delete the path's mapping.

Specified by:
deleteMapping in class DBImplementation
Parameters:
connection - A database connection.
path - The mapping's path.
Throws:
java.sql.SQLException
soaprmi.RemoteException

addMapping

public void addMapping(java.sql.Connection connection,
                       Mapping parent,
                       java.lang.String path,
                       java.lang.String type,
                       java.lang.String typeNamespace,
                       int id,
                       java.lang.String owner,
                       java.lang.String readWriteGroup,
                       java.lang.String readOnlyGroup)
                throws java.sql.SQLException
Description copied from class: DBImplementation
Store the described mapping.

Specified by:
addMapping in class DBImplementation
Parameters:
connection - A database connection.
parent - The mapping's parent.
path - The path to the mapping.
type - The mapping's type.
typeNamespace - The mapping's type's namespace.
id - The mapping's id.
Throws:
java.sql.SQLException

modifyMapping

public void modifyMapping(java.sql.Connection connection,
                          int parentID,
                          java.lang.String path,
                          java.lang.String type,
                          java.lang.String typeNamespace,
                          int id,
                          java.lang.String owner,
                          java.lang.String readWriteGroup,
                          java.lang.String readOnlyGroup)
                   throws java.sql.SQLException,
                          soaprmi.RemoteException
Specified by:
modifyMapping in class DBImplementation
Throws:
java.sql.SQLException
soaprmi.RemoteException

deleteXML

public void deleteXML(java.sql.Connection connection,
                      int id)
               throws java.sql.SQLException,
                      soaprmi.RemoteException
Specified by:
deleteXML in class DBImplementation
Throws:
java.sql.SQLException
soaprmi.RemoteException

updateXML

public void updateXML(java.sql.Connection connection,
                      int id,
                      org.gjt.xpp.XmlNode node)
               throws java.sql.SQLException,
                      org.gjt.xpp.XmlPullParserException,
                      soaprmi.RemoteException
Specified by:
updateXML in class DBImplementation
Throws:
java.sql.SQLException
org.gjt.xpp.XmlPullParserException
soaprmi.RemoteException

addXML

public int addXML(java.sql.Connection connection,
                  org.gjt.xpp.XmlNode node)
           throws java.sql.SQLException,
                  org.gjt.xpp.XmlPullParserException,
                  soaprmi.RemoteException
Specified by:
addXML in class DBImplementation
Throws:
java.sql.SQLException
org.gjt.xpp.XmlPullParserException
soaprmi.RemoteException

getXML

public org.gjt.xpp.XmlNode getXML(java.sql.Connection connection,
                                  int id)
                           throws java.sql.SQLException,
                                  org.gjt.xpp.XmlPullParserException,
                                  soaprmi.RemoteException
Specified by:
getXML in class DBImplementation
Throws:
java.sql.SQLException
org.gjt.xpp.XmlPullParserException
soaprmi.RemoteException

existsXML

public boolean existsXML(java.sql.Connection connection,
                         int id)
                  throws java.sql.SQLException,
                         soaprmi.RemoteException
Specified by:
existsXML in class DBImplementation
Throws:
java.sql.SQLException
soaprmi.RemoteException

keywordSearch

public java.lang.String[] keywordSearch(java.sql.Connection connection,
                                        java.lang.String[] keywords,
                                        boolean doAnd,
                                        int maxResults)
                                 throws java.sql.SQLException,
                                        soaprmi.RemoteException
Specified by:
keywordSearch in class DBImplementation
Throws:
java.sql.SQLException
soaprmi.RemoteException

getGroups

public void getGroups(java.sql.Connection connection,
                      java.lang.String user,
                      java.util.Vector groupNamesVector)
               throws soaprmi.RemoteException,
                      java.sql.SQLException
Specified by:
getGroups in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

listUsersOfGroup

public void listUsersOfGroup(java.sql.Connection connection,
                             java.lang.String group,
                             java.util.Vector usersVector,
                             boolean recurse)
                      throws soaprmi.RemoteException,
                             java.sql.SQLException
Specified by:
listUsersOfGroup in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

listSubGroupsOfGroup

public void listSubGroupsOfGroup(java.sql.Connection connection,
                                 java.lang.String group,
                                 java.util.Vector groupsVector,
                                 boolean recurse)
                          throws soaprmi.RemoteException,
                                 java.sql.SQLException
Specified by:
listSubGroupsOfGroup in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

listGroups

public java.util.Vector listGroups(java.sql.Connection connection)
                            throws soaprmi.RemoteException,
                                   java.sql.SQLException
Specified by:
listGroups in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

listUsers

public java.util.Vector listUsers(java.sql.Connection connection)
                           throws soaprmi.RemoteException,
                                  java.sql.SQLException
Specified by:
listUsers in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

addUserToGroup

public void addUserToGroup(java.sql.Connection connection,
                           java.lang.String user,
                           java.lang.String group)
                    throws soaprmi.RemoteException,
                           java.sql.SQLException
Specified by:
addUserToGroup in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

addGroup

public void addGroup(java.sql.Connection connection,
                     java.lang.String group,
                     java.lang.String superGroup)
              throws soaprmi.RemoteException,
                     java.sql.SQLException
Specified by:
addGroup in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

deleteUser

public void deleteUser(java.sql.Connection connection,
                       java.lang.String user)
                throws soaprmi.RemoteException,
                       java.sql.SQLException
Specified by:
deleteUser in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

deleteGroup

public void deleteGroup(java.sql.Connection connection,
                        java.lang.String group)
                 throws soaprmi.RemoteException,
                        java.sql.SQLException
Specified by:
deleteGroup in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

removeUserFromGroup

public void removeUserFromGroup(java.sql.Connection connection,
                                java.lang.String user,
                                java.lang.String group)
                         throws soaprmi.RemoteException,
                                java.sql.SQLException
Specified by:
removeUserFromGroup in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

getUserForDN

public java.lang.String getUserForDN(java.sql.Connection connection,
                                     java.lang.String dn)
                              throws soaprmi.RemoteException,
                                     java.sql.SQLException
Specified by:
getUserForDN in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

addDNForUser

public void addDNForUser(java.sql.Connection connection,
                         java.lang.String user,
                         java.lang.String dn)
                  throws soaprmi.RemoteException,
                         java.sql.SQLException
Specified by:
addDNForUser in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

deleteDNForUser

public void deleteDNForUser(java.sql.Connection connection,
                            java.lang.String user,
                            java.lang.String dn)
                     throws soaprmi.RemoteException,
                            java.sql.SQLException
Specified by:
deleteDNForUser in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

deleteAllDNsForUser

public void deleteAllDNsForUser(java.sql.Connection connection,
                                java.lang.String user)
                         throws soaprmi.RemoteException,
                                java.sql.SQLException
Specified by:
deleteAllDNsForUser in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

isUser

public boolean isUser(java.sql.Connection connection,
                      java.lang.String user)
               throws soaprmi.RemoteException,
                      java.sql.SQLException
Specified by:
isUser in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

isGroup

public boolean isGroup(java.sql.Connection connection,
                       java.lang.String group)
                throws soaprmi.RemoteException,
                       java.sql.SQLException
Specified by:
isGroup in class DBImplementation
Throws:
soaprmi.RemoteException
java.sql.SQLException

getMapping

public Mapping getMapping(java.sql.Connection connection,
                          int parentId)
                   throws soaprmi.RemoteException
Specified by:
getMapping in class DBImplementation
Throws:
soaprmi.RemoteException