xdrs_impl.hashtable
Class ServiceImpl

java.lang.Object
  extended byxdrs_impl.hashtable.ServiceImpl
All Implemented Interfaces:
NodeAuthorization, soaprmi.Remote, UserManagement, XDirectoryService

public class ServiceImpl
extends java.lang.Object
implements XDirectoryService

Implementation of XDRS that is based on hash table and uses XSoap for communication.

Version:
$Revision: 1.1 $ $Date: 2005/05/06 21:31:06 $ (GMT)
Author:
Aleksander Slominski

Field Summary
 
Fields inherited from interface xdrs.XDirectoryService
NAMESPACE, ROOT
 
Fields inherited from interface xdrs.authorization.NodeAuthorization
ADMIN, EVERYBODY, NOBODY
 
Constructor Summary
ServiceImpl()
           
 
Method Summary
 void addDNForUser(java.lang.String someOldDN, java.lang.String newDn)
           
 void addGroup(java.lang.String group, java.lang.String superGroup)
           
 void addGroupToSuperGroup(java.lang.String group, java.lang.String superGroup)
           
 void addNode(java.lang.String pathToDir, org.gjt.xpp.XmlNode node)
          Add the given node as a child of the node associated with the given path.
 void addUsersToGroup(java.lang.String[] users, java.lang.String group)
           
 void addUserToGroup(java.lang.String user, java.lang.String group)
           
 void copyNode(java.lang.String sourcePath, java.lang.String tagetPath)
           
 void copyNodes(java.lang.String[] sourcePaths, java.lang.String targetPath)
          Copy a set of nodes from one location to another.
 void createUser(java.lang.String user, java.lang.String dn)
           
 void deleteAllDNsForUser(java.lang.String user)
           
 void deleteDNForUser(java.lang.String user, java.lang.String dn)
           
 void deleteGroup(java.lang.String dn)
           
 void deleteGroups(java.lang.String[] dn)
           
 void deleteNodes(java.lang.String dirPath, java.lang.String[] childrenNames)
          Delete children nodes that are continaed in directory identified by path.
 void deleteUser(java.lang.String dn)
           
 void deleteUsers(java.lang.String[] dn)
           
 org.gjt.xpp.XmlNode[] getChildrenWithoutHtml(java.lang.String pathNode)
          Get list of XML nodes that are contained inside directory.
 java.lang.String[] getGroups(java.lang.String userName)
           
 org.gjt.xpp.XmlNode getNode(java.lang.String path)
          Get an XmlNode representation of whatever is at the given path.
 java.lang.String getNodeHtml(java.lang.String path)
          Get an XmlNode representation for the given path's html.
 java.lang.String getOwner(java.lang.String path)
           
 java.lang.String[] getPermissions(java.lang.String path)
           
 java.lang.String getReadOnlyGroup(java.lang.String pathToNode)
           
 java.lang.String getReadWriteGroup(java.lang.String pathToNode)
           
 java.lang.String getUserForDN()
           
 java.lang.String getUserForDN(java.lang.String dn)
           
 java.lang.String[] keywordSearch(java.lang.String[] keywords, boolean doAnd, int maxResults)
          Search using keywords to find nodes.
 java.lang.String[] listGroups()
           
 java.lang.String[] listSubGroupsOfGroup(java.lang.String group, boolean recurse)
           
 java.lang.String[] listUsers()
           
 java.lang.String[] listUsersOfGroup(java.lang.String group, boolean recurse)
           
 void modifyNode(java.lang.String path, org.gjt.xpp.XmlNode node)
          Update the values of a node, pointed to by the given path, with those in the given node.
 void moveNode(java.lang.String sourcePath, java.lang.String tagetPath)
           
 void moveNodes(java.lang.String[] sourcePaths, java.lang.String targetPath)
          Move a set of nodes from one location to another.
 void removeGroupFromSuperGroup(java.lang.String group, java.lang.String superGroup)
           
 void removeUserFromGroup(java.lang.String user, java.lang.String group)
           
 void removeUsersFromGroup(java.lang.String[] dns, java.lang.String group)
           
 void setPermissions(java.lang.String pathToDirectoryNode, java.lang.String dnOfOwner, java.lang.String dnOfReadWriteGroup, java.lang.String dnOfReadOnlyGroup, boolean recursive)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceImpl

public ServiceImpl()
            throws org.gjt.xpp.XmlPullParserException
Method Detail

getNode

public org.gjt.xpp.XmlNode getNode(java.lang.String path)
                            throws soaprmi.RemoteException
Description copied from interface: XDirectoryService
Get an XmlNode representation of whatever is at the given path.

Specified by:
getNode in interface XDirectoryService
Parameters:
path - The path from which to extract an XmlNode.
Returns:
An XmlNode representation for the given path.
Throws:
soaprmi.RemoteException - If the given path does not exist, or there is a problem generating the XmlNode.

getChildrenWithoutHtml

public org.gjt.xpp.XmlNode[] getChildrenWithoutHtml(java.lang.String pathNode)
                                             throws soaprmi.RemoteException
Description copied from interface: XDirectoryService
Get list of XML nodes that are contained inside directory. Returned nodes does not contain HTML.

Specified by:
getChildrenWithoutHtml in interface XDirectoryService
Returns:
List of XmlNode representations for children of this directory. If directory has no children
Throws:
soaprmi.RemoteException - If the given path does not exist, node identified by path is not direcotry.

getNodeHtml

public java.lang.String getNodeHtml(java.lang.String path)
                             throws soaprmi.RemoteException
Description copied from interface: XDirectoryService
Get an XmlNode representation for the given path's html.

Specified by:
getNodeHtml in interface XDirectoryService
Parameters:
path - The path whose html will be returned.
Returns:
An XmlNode representation for the given path's html.
Throws:
soaprmi.RemoteException - If the given path does not exist, there is a problem generating the XmlNode, or the node associated with the given path does not have html.

addNode

public void addNode(java.lang.String pathToDir,
                    org.gjt.xpp.XmlNode node)
             throws soaprmi.RemoteException
Description copied from interface: XDirectoryService
Add the given node as a child of the node associated with the given path. Due to the fact that nodes can only be added to existing paths, a default, root, path always exists and can be accessed through the ROOT class variable.

Specified by:
addNode in interface XDirectoryService
Parameters:
pathToDir - The proposed parent for the given node.
node - The node that will be added.
Throws:
soaprmi.RemoteException - If the given path does not exist, the given path plus the given node's name already exists, the given node is not of a supported type, or the given path points to a node that cannot have children.

copyNodes

public void copyNodes(java.lang.String[] sourcePaths,
                      java.lang.String targetPath)
               throws soaprmi.RemoteException
Description copied from interface: XDirectoryService
Copy a set of nodes from one location to another. The sourcePaths can be any type of nodes. If targetPath exists and is a directory node then the nodes associated with the sourcePaths are copied into the targetPath, as children. NOTE: In the future it would be nice to rename things as they are copied.

Specified by:
copyNodes in interface XDirectoryService
Parameters:
sourcePaths - The paths to the nodes to be copied.
Throws:
soaprmi.RemoteException - If the given sourcePaths do not exist, or the targetPath exists and is not a directory.

copyNode

public void copyNode(java.lang.String sourcePath,
                     java.lang.String tagetPath)
              throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

deleteNodes

public void deleteNodes(java.lang.String dirPath,
                        java.lang.String[] childrenNames)
                 throws soaprmi.RemoteException
Description copied from interface: XDirectoryService
Delete children nodes that are continaed in directory identified by path.

Specified by:
deleteNodes in interface XDirectoryService
Parameters:
dirPath - The path to the direcotry node
childrenNames - list of children nodes to delete.
Throws:
soaprmi.RemoteException - If the given path does not exist, there is a problem deleting the node, or if there is an attempt to delete the ROOT.

modifyNode

public void modifyNode(java.lang.String path,
                       org.gjt.xpp.XmlNode node)
                throws soaprmi.RemoteException
Description copied from interface: XDirectoryService
Update the values of a node, pointed to by the given path, with those in the given node.

Specified by:
modifyNode in interface XDirectoryService
Parameters:
path - The path to the node to be modified.
node - A node containing new values for specific fields.
Throws:
soaprmi.RemoteException - If the given path does not exist, the type of the given node's type does not match the type of the node associated with the given path, or the given node tries to change the name of the node associated with the given path.

moveNodes

public void moveNodes(java.lang.String[] sourcePaths,
                      java.lang.String targetPath)
               throws soaprmi.RemoteException
Description copied from interface: XDirectoryService
Move a set of nodes from one location to another. The sourcePaths can be any type of nodes. If targetPath exists and is a directory node then the nodes associated with the sourcePaths are moved into the targetPath, as children. NOTE: In the future it would be nice to rename things as they are moved.

Specified by:
moveNodes in interface XDirectoryService
Parameters:
sourcePaths - The paths to the nodes to be moved.
Throws:
soaprmi.RemoteException - If the given sourcePaths do not exist, or the targetPath exists and is not a directory.

moveNode

public void moveNode(java.lang.String sourcePath,
                     java.lang.String tagetPath)
              throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

keywordSearch

public java.lang.String[] keywordSearch(java.lang.String[] keywords,
                                        boolean doAnd,
                                        int maxResults)
                                 throws soaprmi.RemoteException
Description copied from interface: XDirectoryService
Search using keywords to find nodes.

Specified by:
keywordSearch in interface XDirectoryService
Parameters:
keywords - The keywords for which to search.
doAnd - Whether to AND the keywrods together or not.
maxResults - The max number of results to return.
Returns:
An array of paths that can be given to getNode().
Throws:
soaprmi.RemoteException

getOwner

public java.lang.String getOwner(java.lang.String path)
                          throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

getReadWriteGroup

public java.lang.String getReadWriteGroup(java.lang.String pathToNode)
                                   throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

getReadOnlyGroup

public java.lang.String getReadOnlyGroup(java.lang.String pathToNode)
                                  throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

setPermissions

public void setPermissions(java.lang.String pathToDirectoryNode,
                           java.lang.String dnOfOwner,
                           java.lang.String dnOfReadWriteGroup,
                           java.lang.String dnOfReadOnlyGroup,
                           boolean recursive)
                    throws soaprmi.RemoteException
Specified by:
setPermissions in interface NodeAuthorization
Throws:
soaprmi.RemoteException

createUser

public void createUser(java.lang.String user,
                       java.lang.String dn)
                throws soaprmi.RemoteException
Specified by:
createUser in interface UserManagement
Throws:
soaprmi.RemoteException

getUserForDN

public java.lang.String getUserForDN(java.lang.String dn)
                              throws soaprmi.RemoteException
Specified by:
getUserForDN in interface UserManagement
Throws:
soaprmi.RemoteException

addUserToGroup

public void addUserToGroup(java.lang.String user,
                           java.lang.String group)
                    throws soaprmi.RemoteException
Specified by:
addUserToGroup in interface UserManagement
Throws:
soaprmi.RemoteException

addUsersToGroup

public void addUsersToGroup(java.lang.String[] users,
                            java.lang.String group)
                     throws soaprmi.RemoteException
Specified by:
addUsersToGroup in interface UserManagement
Throws:
soaprmi.RemoteException

addGroup

public void addGroup(java.lang.String group,
                     java.lang.String superGroup)
              throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

deleteUser

public void deleteUser(java.lang.String dn)
                throws soaprmi.RemoteException
Specified by:
deleteUser in interface UserManagement
Throws:
soaprmi.RemoteException

deleteUsers

public void deleteUsers(java.lang.String[] dn)
                 throws soaprmi.RemoteException
Specified by:
deleteUsers in interface UserManagement
Throws:
soaprmi.RemoteException

deleteGroup

public void deleteGroup(java.lang.String dn)
                 throws soaprmi.RemoteException
Specified by:
deleteGroup in interface UserManagement
Throws:
soaprmi.RemoteException

deleteGroups

public void deleteGroups(java.lang.String[] dn)
                  throws soaprmi.RemoteException
Specified by:
deleteGroups in interface UserManagement
Throws:
soaprmi.RemoteException

removeUserFromGroup

public void removeUserFromGroup(java.lang.String user,
                                java.lang.String group)
                         throws soaprmi.RemoteException
Specified by:
removeUserFromGroup in interface UserManagement
Throws:
soaprmi.RemoteException

removeGroupFromSuperGroup

public void removeGroupFromSuperGroup(java.lang.String group,
                                      java.lang.String superGroup)
                               throws soaprmi.RemoteException
Specified by:
removeGroupFromSuperGroup in interface UserManagement
Throws:
soaprmi.RemoteException

addGroupToSuperGroup

public void addGroupToSuperGroup(java.lang.String group,
                                 java.lang.String superGroup)
                          throws soaprmi.RemoteException
Specified by:
addGroupToSuperGroup in interface UserManagement
Throws:
soaprmi.RemoteException

removeUsersFromGroup

public void removeUsersFromGroup(java.lang.String[] dns,
                                 java.lang.String group)
                          throws soaprmi.RemoteException
Specified by:
removeUsersFromGroup in interface UserManagement
Throws:
soaprmi.RemoteException

listUsersOfGroup

public java.lang.String[] listUsersOfGroup(java.lang.String group,
                                           boolean recurse)
                                    throws soaprmi.RemoteException
Specified by:
listUsersOfGroup in interface UserManagement
Throws:
soaprmi.RemoteException

listSubGroupsOfGroup

public java.lang.String[] listSubGroupsOfGroup(java.lang.String group,
                                               boolean recurse)
                                        throws soaprmi.RemoteException
Specified by:
listSubGroupsOfGroup in interface UserManagement
Throws:
soaprmi.RemoteException

listGroups

public java.lang.String[] listGroups()
                              throws soaprmi.RemoteException
Specified by:
listGroups in interface UserManagement
Throws:
soaprmi.RemoteException

getGroups

public java.lang.String[] getGroups(java.lang.String userName)
                             throws soaprmi.RemoteException
Specified by:
getGroups in interface UserManagement
Throws:
soaprmi.RemoteException

listUsers

public java.lang.String[] listUsers()
                             throws soaprmi.RemoteException
Specified by:
listUsers in interface UserManagement
Throws:
soaprmi.RemoteException

getUserForDN

public java.lang.String getUserForDN()
                              throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

addDNForUser

public void addDNForUser(java.lang.String someOldDN,
                         java.lang.String newDn)
                  throws soaprmi.RemoteException
Specified by:
addDNForUser in interface UserManagement
Throws:
soaprmi.RemoteException

deleteDNForUser

public void deleteDNForUser(java.lang.String user,
                            java.lang.String dn)
                     throws soaprmi.RemoteException
Specified by:
deleteDNForUser in interface UserManagement
Throws:
soaprmi.RemoteException

deleteAllDNsForUser

public void deleteAllDNsForUser(java.lang.String user)
                         throws soaprmi.RemoteException
Specified by:
deleteAllDNsForUser in interface UserManagement
Throws:
soaprmi.RemoteException

getPermissions

public java.lang.String[] getPermissions(java.lang.String path)
                                  throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException