diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2007-04-27 23:17:58 +0000 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2007-04-27 23:17:58 +0000 |
commit | cbf08332dc9d3e1af6a8c79b1808fe1ce86ce4a6 (patch) | |
tree | 6a4c89e03522095ad3ac2943929129e91146b0f8 /ldap/clients/dsmlgw | |
parent | e230e448e4c38ae8725d39dc0157dc95f85aa4e9 (diff) | |
download | ds-cbf08332dc9d3e1af6a8c79b1808fe1ce86ce4a6.tar.gz ds-cbf08332dc9d3e1af6a8c79b1808fe1ce86ce4a6.tar.xz ds-cbf08332dc9d3e1af6a8c79b1808fe1ce86ce4a6.zip |
Resolves: #237356
Summary: Move DS Admin Code into Admin Server (Comment #5)
Description: DSMLGW and ORGCHART are moved out; removing from ldapserver
Diffstat (limited to 'ldap/clients/dsmlgw')
32 files changed, 0 insertions, 4966 deletions
diff --git a/ldap/clients/dsmlgw/Makefile b/ldap/clients/dsmlgw/Makefile deleted file mode 100644 index 25590cfe..00000000 --- a/ldap/clients/dsmlgw/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# BEGIN COPYRIGHT BLOCK -# This Program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; version 2 of the License. -# -# This Program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA 02111-1307 USA. -# -# In addition, as a special exception, Red Hat, Inc. gives You the additional -# right to link the code of this Program with code not covered under the GNU -# General Public License ("Non-GPL Code") and to distribute linked combinations -# including the two, subject to the limitations in this paragraph. Non-GPL Code -# permitted under this exception must only link to the code of this Program -# through those well defined interfaces identified in the file named EXCEPTION -# found in the source code files (the "Approved Interfaces"). The files of -# Non-GPL Code may instantiate templates or use macros or inline functions from -# the Approved Interfaces without causing the resulting work to be covered by -# the GNU General Public License. Only Red Hat, Inc. may make changes or -# additions to the list of Approved Interfaces. You must obey the GNU General -# Public License in all respects for all of the Program code and other code used -# in conjunction with the Program except the Non-GPL Code covered by this -# exception. If you modify this file, you may extend this exception to your -# version of the file, but you are not obligated to do so. If you do not wish to -# provide this exception without modification, you must delete this exception -# statement from your version and license this file solely under the GPL without -# exception. -# -# -# Copyright (C) 2005 Red Hat, Inc. -# All rights reserved. -# END COPYRIGHT BLOCK - -NOSTDCLEAN=true -NO_BUILD_NUM=true -COMPONENT_DEPS=true - - -BUILD_ROOT=../../.. - -include $(BUILD_ROOT)/nsconfig.mk -include $(BUILD_ROOT)/ldap/javarules.mk - -all: $(ANT_DEP) $(LDAPJDK_DEP) - @if [ ! -d $(DSMLGWJARS_BUILD_DIR) ] ; then \ - mkdir $(DSMLGWJARS_BUILD_DIR) ; \ - fi - @if [ ! -f $(DSMLGWJARS_BUILD_DIR)/axis.jar ]; then \ - if [ -f $(CLASS_DEST)/$(AXIS_REL_DIR)/lib/axis.jar ]; then \ - cp $(CLASS_DEST)/$(AXIS_REL_DIR)/lib/axis.jar $(DSMLGWJARS_BUILD_DIR) ; \ - fi ; \ - if [ -f $(CLASS_DEST)/$(AXIS_REL_DIR)/axis.jar ]; then \ - cp $(CLASS_DEST)/$(AXIS_REL_DIR)/axis.jar $(DSMLGWJARS_BUILD_DIR) ; \ - fi ; \ - fi - $(ANT) -Dglobaldist.dir=$(DSMLGWJARS_BUILD_DIR) -Dldapdist.dir=$(LDAPJDK_DIR) - -clean: - $(ANT) clean - diff --git a/ldap/clients/dsmlgw/build.xml b/ldap/clients/dsmlgw/build.xml deleted file mode 100644 index 0a050e11..00000000 --- a/ldap/clients/dsmlgw/build.xml +++ /dev/null @@ -1,111 +0,0 @@ -<?xml version='1.0'?> -<!-- BEGIN COPYRIGHT BLOCK - This Program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; version 2 of the License. - - This Program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place, Suite 330, Boston, MA 02111-1307 USA. - - In addition, as a special exception, Red Hat, Inc. gives You the additional - right to link the code of this Program with code not covered under the GNU - General Public License ("Non-GPL Code") and to distribute linked combinations - including the two, subject to the limitations in this paragraph. Non-GPL Code - permitted under this exception must only link to the code of this Program - through those well defined interfaces identified in the file named EXCEPTION - found in the source code files (the "Approved Interfaces"). The files of - Non-GPL Code may instantiate templates or use macros or inline functions from - the Approved Interfaces without causing the resulting work to be covered by - the GNU General Public License. Only Red Hat, Inc. may make changes or - additions to the list of Approved Interfaces. You must obey the GNU General - Public License in all respects for all of the Program code and other code used - in conjunction with the Program except the Non-GPL Code covered by this - exception. If you modify this file, you may extend this exception to your - version of the file, but you are not obligated to do so. If you do not wish to - provide this exception without modification, you must delete this exception - statement from your version and license this file solely under the GPL without - exception. - - - Copyright (C) 2005 Red Hat, Inc. - All rights reserved. - END COPYRIGHT BLOCK --> -<!-- ANT build script for the new dsml gateway --> -<!-- Possible to compile by hand, use - cd /ldapserver/ldap/clients/dsmlgw - ant -Dxerces=../../../../dist/classes/jakarta-tomcat-5.0.27/common/endorsed - --> -<project name="dsmlgw" default="dist" basedir="."> - -<!-- ******************** Adjustable Properties *********************** --> -<property name="mcom.root" value="../../.."/> -<property name="globaldist.dir" value="${mcom.root}/../dist/classes"/> -<property name="ldapdist.dir" value="${mcom.root}/../dist/classes"/> -<property name="app.name" value="dsmlgw"/> -<property name="taglib.name" value="dsmlgw"/> - -<property name="ldapjdk.jar" value="${ldapdist.dir}/ldapjdk.jar"/> -<property name="activation.jar" value="${globaldist.dir}/activation.jar"/> -<property name="jaf.jar" value="${globaldist.dir}/jaf.jar"/> -<property name="jaxrpc-api.jar" value="${globaldist.dir}/jaxrpc-api.jar"/> -<property name="jaxrpc.jar" value="${globaldist.dir}/jaxrpc.jar"/> -<property name="saaj.jar" value="${globaldist.dir}/saaj.jar"/> -<property name="xercesImpl.jar" value="${globaldist.dir}/xercesImpl.jar"/> -<property name="xmlParserAPIs.jar" value="${globaldist.dir}/xml-apis.jar"/> -<property name="axis.jar" value="${globaldist.dir}/axis.jar"/> -<property name="codec.jar" value="${globaldist.dir}/jakarta-commons-codec.jar"/> -<property environment="env"/> - -<path id="class.path"> -<pathelement location="${ldapjdk.jar}"/> -<pathelement location="${activation.jar}"/> -<pathelement location="${jaf.jar}"/> -<pathelement location="${jaxrpc-api.jar}"/> -<pathelement location="${jaxrpc.jar}"/> -<pathelement location="${saaj.jar}"/> - -<pathelement location="${xercesImpl.jar}"/> -<pathelement location="${xmlParserAPIs.jar}"/> -<pathelement location="${axis.jar}"/> -<pathelement location="${codec.jar}"/> -</path> - -<property name="build.dir" value="${mcom.root}/built/dsmlgw"/> -<property name="dist.dir" value="${mcom.root}/../dist/dsmlgw"/> - - - -<target name="prepare" description="prepares the output directories"> - <mkdir dir="${build.dir}"/> - <mkdir dir="${dist.dir}"/> -</target> - -<target name="library" depends="classpath,prepare" description="builds it"> -<javac srcdir="." destdir="${build.dir}" classpathref="class.path" debug="on"/> -</target> - - - <!-- Create the library distribution files --> -<target name="dist" depends="classpath,library" description="makes the distribution"> - <jar jarfile="${dist.dir}/dsmlgw.jar" basedir="${build.dir}"/> - - </target> - - <target name="clean" description="makes clean"> - <delete dir="${build.dir}"/> - <delete dir="${dist.dir}"/> - </target> - -<property name="classpath" refid="class.path"/> - <target name="classpath"> - <echo message="${classpath}"/> - </target> - - -</project> - diff --git a/ldap/clients/dsmlgw/misc/dsmlgw.cfg b/ldap/clients/dsmlgw/misc/dsmlgw.cfg deleted file mode 100644 index 2370987d..00000000 --- a/ldap/clients/dsmlgw/misc/dsmlgw.cfg +++ /dev/null @@ -1,50 +0,0 @@ -# BEGIN COPYRIGHT BLOCK -# This Program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; version 2 of the License. -# -# This Program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA 02111-1307 USA. -# -# In addition, as a special exception, Red Hat, Inc. gives You the additional -# right to link the code of this Program with code not covered under the GNU -# General Public License ("Non-GPL Code") and to distribute linked combinations -# including the two, subject to the limitations in this paragraph. Non-GPL Code -# permitted under this exception must only link to the code of this Program -# through those well defined interfaces identified in the file named EXCEPTION -# found in the source code files (the "Approved Interfaces"). The files of -# Non-GPL Code may instantiate templates or use macros or inline functions from -# the Approved Interfaces without causing the resulting work to be covered by -# the GNU General Public License. Only Red Hat, Inc. may make changes or -# additions to the list of Approved Interfaces. You must obey the GNU General -# Public License in all respects for all of the Program code and other code used -# in conjunction with the Program except the Non-GPL Code covered by this -# exception. If you modify this file, you may extend this exception to your -# version of the file, but you are not obligated to do so. If you do not wish to -# provide this exception without modification, you must delete this exception -# statement from your version and license this file solely under the GPL without -# exception. -# -# -# Copyright (C) 2005 Red Hat, Inc. -# All rights reserved. -# END COPYRIGHT BLOCK -# -#properties file for the -#Netscape DSMLGW -# DSML Gateway - -ServerHost=localhost -ServerPort=389 -BindDN= -BindPW= - -MinLoginPool=1 -MaxLoginPool=2 -MinPool=3 -MaxPool=15 diff --git a/ldap/clients/dsmlgw/misc/server-config.wsdd b/ldap/clients/dsmlgw/misc/server-config.wsdd deleted file mode 100644 index e9a57edd..00000000 --- a/ldap/clients/dsmlgw/misc/server-config.wsdd +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- BEGIN COPYRIGHT BLOCK - This Program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; version 2 of the License. - - This Program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place, Suite 330, Boston, MA 02111-1307 USA. - - In addition, as a special exception, Red Hat, Inc. gives You the additional - right to link the code of this Program with code not covered under the GNU - General Public License ("Non-GPL Code") and to distribute linked combinations - including the two, subject to the limitations in this paragraph. Non-GPL Code - permitted under this exception must only link to the code of this Program - through those well defined interfaces identified in the file named EXCEPTION - found in the source code files (the "Approved Interfaces"). The files of - Non-GPL Code may instantiate templates or use macros or inline functions from - the Approved Interfaces without causing the resulting work to be covered by - the GNU General Public License. Only Red Hat, Inc. may make changes or - additions to the list of Approved Interfaces. You must obey the GNU General - Public License in all respects for all of the Program code and other code used - in conjunction with the Program except the Non-GPL Code covered by this - exception. If you modify this file, you may extend this exception to your - version of the file, but you are not obligated to do so. If you do not wish to - provide this exception without modification, you must delete this exception - statement from your version and license this file solely under the GPL without - exception. - - - Copyright (C) 2005 Red Hat, Inc. - All rights reserved. - END COPYRIGHT BLOCK --> -<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> - <globalConfiguration> - <parameter name="adminPassword" value="admin"/> - <parameter name="sendMultiRefs" value="true"/> - <parameter name="sendXsiTypes" value="true"/> - <parameter name="attachments.implementation" value="org.apache.axis.attachments.AttachmentsImpl"/> - <parameter name="sendXMLDeclaration" value="true"/> - <requestFlow> - <handler type="java:org.apache.axis.handlers.JWSHandler"> - <parameter name="scope" value="session"/> - </handler> - <handler type="java:org.apache.axis.handlers.JWSHandler"> - <parameter name="scope" value="request"/> - <parameter name="extension" value=".jwr"/> - </handler> - </requestFlow> - </globalConfiguration> - <handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder"/> - <handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/> - <requestFlow name="checks"> - <handler type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/> - <handler type="java:org.apache.axis.handlers.SimpleAuthorizationHandler"/> - </requestFlow> - <handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/> - - <service name="dsmlgw" provider="Handler"> - <parameter name="handlerClass" value="com.netscape.dsml.gateway.gatewayHandler"/> - </service> - - <transport name="http"> - <requestFlow> - <handler type="URLMapper"/> - <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/> - </requestFlow> - <parameter name="qs:list" value="org.apache.axis.transport.http.QSListHandler"/> - <parameter name="qs:wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/> - <parameter name="qs:method" value="org.apache.axis.transport.http.QSMethodHandler"/> - </transport> - <transport name="local"> - <responseFlow> - <handler type="LocalResponder"/> - </responseFlow> - </transport> -</deployment> diff --git a/ldap/clients/dsmlgw/misc/web-app_2_3.dtd b/ldap/clients/dsmlgw/misc/web-app_2_3.dtd deleted file mode 100644 index 5e3ab01c..00000000 --- a/ldap/clients/dsmlgw/misc/web-app_2_3.dtd +++ /dev/null @@ -1,1063 +0,0 @@ -<!-- -Copyright (c) 2000 Sun Microsystems, Inc., -901 San Antonio Road, -Palo Alto, California 94303, U.S.A. -All rights reserved. - -Sun Microsystems, Inc. has intellectual property rights relating to -technology embodied in the product that is described in this document. -In particular, and without limitation, these intellectual property -rights may include one or more of the U.S. patents listed at -http://www.sun.com/patents and one or more additional patents or -pending patent applications in the U.S. and in other countries. - -This document and the product to which it pertains are distributed -under licenses restricting their use, copying, distribution, and -decompilation. This document may be reproduced and distributed but may -not be changed without prior written authorization of Sun and its -licensors, if any. - -Third-party software, including font technology, is copyrighted and -licensed from Sun suppliers. - -Sun, Sun Microsystems, the Sun logo, Java, JavaServer Pages, Java -Naming and Directory Interface, JDBC, JDK, JavaMail and and -Enterprise JavaBeans are trademarks or registered trademarks of Sun -Microsystems, Inc. in the U.S. and other countries. - -Federal Acquisitions: Commercial Software - Government Users Subject to -Standard License Terms and Conditions. - -DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED -CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED -WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR -NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH -DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. - - -_________________________________________________________________________ - -Copyright (c) 2000 Sun Microsystems, Inc., -901 San Antonio Road, -Palo Alto, California 94303, E'tats-Unis. -Tous droits re'serve's. - -Sun Microsystems, Inc. a les droits de proprie'te' intellectuels -relatants a` la technologie incorpore'e dans le produit qui est de'crit -dans ce document. En particulier, et sans la limitation, ces droits de -proprie'te' intellectuels peuvent inclure un ou plus des brevets -ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les -brevets plus supple'mentaires ou les applications de brevet en attente -dans les E'tats-Unis et dans les autres pays. - -Ce produit ou document est prote'ge' par un copyright et distribue' -avec des licences qui en restreignent l'utilisation, la copie, la -distribution, et la de'compilation. Ce documention associe n peut -e^tre reproduite et distribuer, par quelque moyen que ce soit, sans -l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de -licence, le cas e'che'ant. - -Le logiciel de'tenu par des tiers, et qui comprend la technologie -relative aux polices de caracte`res, est prote'ge' par un copyright et -licencie' par des fournisseurs de Sun. - -Sun, Sun Microsystems, le logo Sun, Java, JavaServer Pages, Java -Naming and Directory Interface, JDBC, JDK, JavaMail et and -Enterprise JavaBeans sont des marques de fabrique ou des marques -de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres -pays. - -LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS, -DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT -EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS -NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A -L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE -CONTREFAC,ON. ---> - -<!-- -This is the XML DTD for the Servlet 2.3 deployment descriptor. -All Servlet 2.3 deployment descriptors must include a DOCTYPE -of the following form: - - <!DOCTYPE web-app PUBLIC - "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - "http://java.sun.com/dtd/web-app_2_3.dtd"> - ---> - -<!-- -The following conventions apply to all J2EE deployment descriptor -elements unless indicated otherwise. - -- In elements that contain PCDATA, leading and trailing whitespace - in the data may be ignored. - -- In elements whose value is an "enumerated type", the value is - case sensitive. - -- In elements that specify a pathname to a file within the same - JAR file, relative filenames (i.e., those not starting with "/") - are considered relative to the root of the JAR file's namespace. - Absolute filenames (i.e., those starting with "/") also specify - names in the root of the JAR file's namespace. In general, relative - names are preferred. The exception is .war files where absolute - names are preferred for consistency with the servlet API. ---> - - -<!-- -The web-app element is the root of the deployment descriptor for -a web application. ---> -<!ELEMENT web-app (icon?, display-name?, description?, distributable?, -context-param*, filter*, filter-mapping*, listener*, servlet*, -servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, -error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, -login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)> - -<!-- -The auth-constraint element indicates the user roles that should -be permitted access to this resource collection. The role-name -used here must either correspond to the role-name of one of the -security-role elements defined for this web application, or be -the specially reserved role-name "*" that is a compact syntax for -indicating all roles in the web application. If both "*" and -rolenames appear, the container interprets this as all roles. -If no roles are defined, no user is allowed access to the portion of -the web application described by the containing security-constraint. -The container matches role names case sensitively when determining -access. - - -Used in: security-constraint ---> -<!ELEMENT auth-constraint (description?, role-name*)> - -<!-- -The auth-method element is used to configure the authentication -mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization -constraint, a user must have authenticated using the configured -mechanism. Legal values for this element are "BASIC", "DIGEST", -"FORM", or "CLIENT-CERT". - -Used in: login-config ---> -<!ELEMENT auth-method (#PCDATA)> - -<!-- -The context-param element contains the declaration of a web -application's servlet context initialization parameters. - -Used in: web-app ---> -<!ELEMENT context-param (param-name, param-value, description?)> - -<!-- -The description element is used to provide text describing the parent -element. The description element should include any information that -the web application war file producer wants to provide to the consumer of -the web application war file (i.e., to the Deployer). Typically, the tools -used by the web application war file consumer will display the description -when processing the parent element that contains the description. - -Used in: auth-constraint, context-param, ejb-local-ref, ejb-ref, -env-entry, filter, init-param, resource-env-ref, resource-ref, run-as, -security-role, security-role-ref, servlet, user-data-constraint, -web-app, web-resource-collection ---> -<!ELEMENT description (#PCDATA)> - -<!-- -The display-name element contains a short name that is intended to be -displayed by tools. The display name need not be unique. - -Used in: filter, security-constraint, servlet, web-app - -Example: - -<display-name>Employee Self Service</display-name> ---> -<!ELEMENT display-name (#PCDATA)> - -<!-- -The distributable element, by its presence in a web application -deployment descriptor, indicates that this web application is -programmed appropriately to be deployed into a distributed servlet -container - -Used in: web-app ---> -<!ELEMENT distributable EMPTY> - -<!-- -The ejb-link element is used in the ejb-ref or ejb-local-ref -elements to specify that an EJB reference is linked to an -enterprise bean. - -The name in the ejb-link element is composed of a -path name specifying the ejb-jar containing the referenced enterprise -bean with the ejb-name of the target bean appended and separated from -the path name by "#". The path name is relative to the war file -containing the web application that is referencing the enterprise bean. -This allows multiple enterprise beans with the same ejb-name to be -uniquely identified. - -Used in: ejb-local-ref, ejb-ref - -Examples: - - <ejb-link>EmployeeRecord</ejb-link> - - <ejb-link>../products/product.jar#ProductEJB</ejb-link> - ---> -<!ELEMENT ejb-link (#PCDATA)> - -<!-- -The ejb-local-ref element is used for the declaration of a reference to -an enterprise bean's local home. The declaration consists of: - - - an optional description - - the EJB reference name used in the code of the web application - that's referencing the enterprise bean - - the expected type of the referenced enterprise bean - - the expected local home and local interfaces of the referenced - enterprise bean - - optional ejb-link information, used to specify the referenced - enterprise bean - -Used in: web-app ---> -<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type, - local-home, local, ejb-link?)> - -<!-- -The ejb-ref element is used for the declaration of a reference to -an enterprise bean's home. The declaration consists of: - - - an optional description - - the EJB reference name used in the code of - the web application that's referencing the enterprise bean - - the expected type of the referenced enterprise bean - - the expected home and remote interfaces of the referenced - enterprise bean - - optional ejb-link information, used to specify the referenced - enterprise bean - -Used in: web-app ---> -<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type, - home, remote, ejb-link?)> - -<!-- -The ejb-ref-name element contains the name of an EJB reference. The -EJB reference is an entry in the web application's environment and is -relative to the java:comp/env context. The name must be unique -within the web application. - -It is recommended that name is prefixed with "ejb/". - -Used in: ejb-local-ref, ejb-ref - -Example: - -<ejb-ref-name>ejb/Payroll</ejb-ref-name> ---> -<!ELEMENT ejb-ref-name (#PCDATA)> - -<!-- -The ejb-ref-type element contains the expected type of the -referenced enterprise bean. - -The ejb-ref-type element must be one of the following: - - <ejb-ref-type>Entity</ejb-ref-type> - <ejb-ref-type>Session</ejb-ref-type> - -Used in: ejb-local-ref, ejb-ref ---> -<!ELEMENT ejb-ref-type (#PCDATA)> - -<!-- -The env-entry element contains the declaration of a web application's -environment entry. The declaration consists of an optional -description, the name of the environment entry, and an optional -value. If a value is not specified, one must be supplied -during deployment. ---> -<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?, -env-entry-type)> - -<!-- -The env-entry-name element contains the name of a web applications's -environment entry. The name is a JNDI name relative to the -java:comp/env context. The name must be unique within a web application. - -Example: - -<env-entry-name>minAmount</env-entry-name> - -Used in: env-entry ---> -<!ELEMENT env-entry-name (#PCDATA)> - -<!-- -The env-entry-type element contains the fully-qualified Java type of -the environment entry value that is expected by the web application's -code. - -The following are the legal values of env-entry-type: - - java.lang.Boolean - java.lang.Byte - java.lang.Character - java.lang.String - java.lang.Short - java.lang.Integer - java.lang.Long - java.lang.Float - java.lang.Double - -Used in: env-entry ---> -<!ELEMENT env-entry-type (#PCDATA)> - -<!-- -The env-entry-value element contains the value of a web application's -environment entry. The value must be a String that is valid for the -constructor of the specified type that takes a single String -parameter, or for java.lang.Character, a single character. - -Example: - -<env-entry-value>100.00</env-entry-value> - -Used in: env-entry ---> -<!ELEMENT env-entry-value (#PCDATA)> - -<!-- -The error-code contains an HTTP error code, ex: 404 - -Used in: error-page ---> -<!ELEMENT error-code (#PCDATA)> - -<!-- -The error-page element contains a mapping between an error code -or exception type to the path of a resource in the web application - -Used in: web-app ---> -<!ELEMENT error-page ((error-code | exception-type), location)> - -<!-- -The exception type contains a fully qualified class name of a -Java exception type. - -Used in: error-page ---> -<!ELEMENT exception-type (#PCDATA)> - -<!-- -The extension element contains a string describing an -extension. example: "txt" - -Used in: mime-mapping ---> -<!ELEMENT extension (#PCDATA)> - -<!-- -Declares a filter in the web application. The filter is mapped to -either a servlet or a URL pattern in the filter-mapping element, using -the filter-name value to reference. Filters can access the -initialization parameters declared in the deployment descriptor at -runtime via the FilterConfig interface. - -Used in: web-app ---> -<!ELEMENT filter (icon?, filter-name, display-name?, description?, -filter-class, init-param*)> - -<!-- -The fully qualified classname of the filter. - -Used in: filter ---> -<!ELEMENT filter-class (#PCDATA)> - -<!-- -Declaration of the filter mappings in this web application. The -container uses the filter-mapping declarations to decide which filters -to apply to a request, and in what order. The container matches the -request URI to a Servlet in the normal way. To determine which filters -to apply it matches filter-mapping declarations either on servlet-name, -or on url-pattern for each filter-mapping element, depending on which -style is used. The order in which filters are invoked is the order in -which filter-mapping declarations that match a request URI for a -servlet appear in the list of filter-mapping elements.The filter-name -value must be the value of the <filter-name> sub-elements of one of the -<filter> declarations in the deployment descriptor. - -Used in: web-app ---> -<!ELEMENT filter-mapping (filter-name, (url-pattern | servlet-name))> - -<!-- -The logical name of the filter. This name is used to map the filter. -Each filter name is unique within the web application. - -Used in: filter, filter-mapping ---> -<!ELEMENT filter-name (#PCDATA)> - -<!-- -The form-error-page element defines the location in the web app -where the error page that is displayed when login is not successful -can be found. The path begins with a leading / and is interpreted -relative to the root of the WAR. - -Used in: form-login-config ---> -<!ELEMENT form-error-page (#PCDATA)> - -<!-- -The form-login-config element specifies the login and error pages -that should be used in form based login. If form based authentication -is not used, these elements are ignored. - -Used in: login-config ---> -<!ELEMENT form-login-config (form-login-page, form-error-page)> - -<!-- -The form-login-page element defines the location in the web app -where the page that can be used for login can be found. The path -begins with a leading / and is interpreted relative to the root of the WAR. - -Used in: form-login-config ---> -<!ELEMENT form-login-page (#PCDATA)> - -<!-- -The home element contains the fully-qualified name of the enterprise -bean's home interface. - -Used in: ejb-ref - -Example: - -<home>com.aardvark.payroll.PayrollHome</home> ---> -<!ELEMENT home (#PCDATA)> - -<!-- -The http-method contains an HTTP method (GET | POST |...). - -Used in: web-resource-collection ---> -<!ELEMENT http-method (#PCDATA)> - -<!-- -The icon element contains small-icon and large-icon elements that -specify the file names for small and a large GIF or JPEG icon images -used to represent the parent element in a GUI tool. - -Used in: filter, servlet, web-app ---> -<!ELEMENT icon (small-icon?, large-icon?)> - -<!-- -The init-param element contains a name/value pair as an -initialization param of the servlet - -Used in: filter, servlet ---> -<!ELEMENT init-param (param-name, param-value, description?)> - -<!-- -The jsp-file element contains the full path to a JSP file within -the web application beginning with a `/'. - -Used in: servlet ---> -<!ELEMENT jsp-file (#PCDATA)> - -<!-- -The large-icon element contains the name of a file -containing a large (32 x 32) icon image. The file -name is a relative path within the web application's -war file. - -The image may be either in the JPEG or GIF format. -The icon can be used by tools. - -Used in: icon - -Example: - -<large-icon>employee-service-icon32x32.jpg</large-icon> ---> -<!ELEMENT large-icon (#PCDATA)> - -<!-- -The listener element indicates the deployment properties for a web -application listener bean. - -Used in: web-app ---> -<!ELEMENT listener (listener-class)> - -<!-- -The listener-class element declares a class in the application must be -registered as a web application listener bean. The value is the fully qualified classname of the listener class. - - -Used in: listener ---> -<!ELEMENT listener-class (#PCDATA)> - -<!-- -The load-on-startup element indicates that this servlet should be -loaded (instantiated and have its init() called) on the startup -of the web application. The optional contents of -these element must be an integer indicating the order in which -the servlet should be loaded. If the value is a negative integer, -or the element is not present, the container is free to load the -servlet whenever it chooses. If the value is a positive integer -or 0, the container must load and initialize the servlet as the -application is deployed. The container must guarantee that -servlets marked with lower integers are loaded before servlets -marked with higher integers. The container may choose the order -of loading of servlets with the same load-on-start-up value. - -Used in: servlet ---> -<!ELEMENT load-on-startup (#PCDATA)> - -<!-- - -The local element contains the fully-qualified name of the -enterprise bean's local interface. - -Used in: ejb-local-ref - ---> -<!ELEMENT local (#PCDATA)> - -<!-- - -The local-home element contains the fully-qualified name of the -enterprise bean's local home interface. - -Used in: ejb-local-ref ---> -<!ELEMENT local-home (#PCDATA)> - -<!-- -The location element contains the location of the resource in the web -application relative to the root of the web application. The value of -the location must have a leading `/'. - -Used in: error-page ---> -<!ELEMENT location (#PCDATA)> - -<!-- -The login-config element is used to configure the authentication -method that should be used, the realm name that should be used for -this application, and the attributes that are needed by the form login -mechanism. - -Used in: web-app ---> -<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)> - -<!-- -The mime-mapping element defines a mapping between an extension -and a mime type. - -Used in: web-app ---> -<!ELEMENT mime-mapping (extension, mime-type)> - -<!-- -The mime-type element contains a defined mime type. example: -"text/plain" - -Used in: mime-mapping ---> -<!ELEMENT mime-type (#PCDATA)> - -<!-- -The param-name element contains the name of a parameter. Each parameter -name must be unique in the web application. - - -Used in: context-param, init-param ---> -<!ELEMENT param-name (#PCDATA)> - -<!-- -The param-value element contains the value of a parameter. - -Used in: context-param, init-param ---> -<!ELEMENT param-value (#PCDATA)> - -<!-- -The realm name element specifies the realm name to use in HTTP -Basic authorization. - -Used in: login-config ---> -<!ELEMENT realm-name (#PCDATA)> - -<!-- -The remote element contains the fully-qualified name of the enterprise -bean's remote interface. - -Used in: ejb-ref - -Example: - -<remote>com.wombat.empl.EmployeeService</remote> ---> -<!ELEMENT remote (#PCDATA)> - -<!-- -The res-auth element specifies whether the web application code signs -on programmatically to the resource manager, or whether the Container -will sign on to the resource manager on behalf of the web application. In the -latter case, the Container uses information that is supplied by the -Deployer. - -The value of this element must be one of the two following: - - <res-auth>Application</res-auth> - <res-auth>Container</res-auth> - -Used in: resource-ref ---> -<!ELEMENT res-auth (#PCDATA)> - -<!-- -The res-ref-name element specifies the name of a resource manager -connection factory reference. The name is a JNDI name relative to the -java:comp/env context. The name must be unique within a web application. - -Used in: resource-ref ---> -<!ELEMENT res-ref-name (#PCDATA)> - -<!-- -The res-sharing-scope element specifies whether connections obtained -through the given resource manager connection factory reference can be -shared. The value of this element, if specified, must be one of the -two following: - - <res-sharing-scope>Shareable</res-sharing-scope> - <res-sharing-scope>Unshareable</res-sharing-scope> - -The default value is Shareable. - -Used in: resource-ref ---> -<!ELEMENT res-sharing-scope (#PCDATA)> - -<!-- -The res-type element specifies the type of the data source. The type -is specified by the fully qualified Java language class or interface -expected to be implemented by the data source. - -Used in: resource-ref ---> -<!ELEMENT res-type (#PCDATA)> - -<!-- -The resource-env-ref element contains a declaration of a web application's -reference to an administered object associated with a resource -in the web application's environment. It consists of an optional -description, the resource environment reference name, and an -indication of the resource environment reference type expected by -the web application code. - -Used in: web-app - -Example: - -<resource-env-ref> - <resource-env-ref-name>jms/StockQueue</resource-env-ref-name> - <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type> -</resource-env-ref> ---> -<!ELEMENT resource-env-ref (description?, resource-env-ref-name, - resource-env-ref-type)> - -<!-- -The resource-env-ref-name element specifies the name of a resource -environment reference; its value is the environment entry name used in -the web application code. The name is a JNDI name relative to the -java:comp/env context and must be unique within a web application. - -Used in: resource-env-ref ---> -<!ELEMENT resource-env-ref-name (#PCDATA)> - -<!-- -The resource-env-ref-type element specifies the type of a resource -environment reference. It is the fully qualified name of a Java -language class or interface. - -Used in: resource-env-ref ---> -<!ELEMENT resource-env-ref-type (#PCDATA)> - -<!-- -The resource-ref element contains a declaration of a web application's -reference to an external resource. It consists of an optional -description, the resource manager connection factory reference name, -the indication of the resource manager connection factory type -expected by the web application code, the type of authentication -(Application or Container), and an optional specification of the -shareability of connections obtained from the resource (Shareable or -Unshareable). - -Used in: web-app - -Example: - - <resource-ref> - <res-ref-name>jdbc/EmployeeAppDB</res-ref-name> - <res-type>javax.sql.DataSource</res-type> - <res-auth>Container</res-auth> - <res-sharing-scope>Shareable</res-sharing-scope> - </resource-ref> ---> -<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth, - res-sharing-scope?)> - -<!-- -The role-link element is a reference to a defined security role. The -role-link element must contain the name of one of the security roles -defined in the security-role elements. - -Used in: security-role-ref ---> -<!ELEMENT role-link (#PCDATA)> - -<!-- -The role-name element contains the name of a security role. - -The name must conform to the lexical rules for an NMTOKEN. - -Used in: auth-constraint, run-as, security-role, security-role-ref ---> -<!ELEMENT role-name (#PCDATA)> - -<!-- -The run-as element specifies the run-as identity to be used for the -execution of the web application. It contains an optional description, and -the name of a security role. - -Used in: servlet ---> -<!ELEMENT run-as (description?, role-name)> - -<!-- -The security-constraint element is used to associate security -constraints with one or more web resource collections - -Used in: web-app ---> -<!ELEMENT security-constraint (display-name?, web-resource-collection+, -auth-constraint?, user-data-constraint?)> - -<!-- -The security-role element contains the definition of a security -role. The definition consists of an optional description of the -security role, and the security role name. - -Used in: web-app - -Example: - - <security-role> - <description> - This role includes all employees who are authorized - to access the employee service application. - </description> - <role-name>employee</role-name> - </security-role> ---> -<!ELEMENT security-role (description?, role-name)> - -<!-- -The security-role-ref element contains the declaration of a security -role reference in the web application's code. The declaration consists -of an optional description, the security role name used in the code, -and an optional link to a security role. If the security role is not -specified, the Deployer must choose an appropriate security role. - -The value of the role-name element must be the String used as the -parameter to the EJBContext.isCallerInRole(String roleName) method -or the HttpServletRequest.isUserInRole(String role) method. - -Used in: servlet - ---> -<!ELEMENT security-role-ref (description?, role-name, role-link?)> - -<!-- -The servlet element contains the declarative data of a -servlet. If a jsp-file is specified and the load-on-startup element is -present, then the JSP should be precompiled and loaded. - -Used in: web-app ---> -<!ELEMENT servlet (icon?, servlet-name, display-name?, description?, -(servlet-class|jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*)> - -<!-- -The servlet-class element contains the fully qualified class name -of the servlet. - -Used in: servlet ---> -<!ELEMENT servlet-class (#PCDATA)> - -<!-- -The servlet-mapping element defines a mapping between a servlet -and a url pattern - -Used in: web-app ---> -<!ELEMENT servlet-mapping (servlet-name, url-pattern)> - -<!-- -The servlet-name element contains the canonical name of the -servlet. Each servlet name is unique within the web application. - -Used in: filter-mapping, servlet, servlet-mapping ---> -<!ELEMENT servlet-name (#PCDATA)> - -<!-- -The session-config element defines the session parameters for -this web application. - -Used in: web-app ---> -<!ELEMENT session-config (session-timeout?)> - -<!-- -The session-timeout element defines the default session timeout -interval for all sessions created in this web application. The -specified timeout must be expressed in a whole number of minutes. -If the timeout is 0 or less, the container ensures the default -behaviour of sessions is never to time out. - -Used in: session-config ---> -<!ELEMENT session-timeout (#PCDATA)> - -<!-- -The small-icon element contains the name of a file -containing a small (16 x 16) icon image. The file -name is a relative path within the web application's -war file. - -The image may be either in the JPEG or GIF format. -The icon can be used by tools. - -Used in: icon - -Example: - -<small-icon>employee-service-icon16x16.jpg</small-icon> ---> -<!ELEMENT small-icon (#PCDATA)> - -<!-- -The taglib element is used to describe a JSP tag library. - -Used in: web-app ---> -<!ELEMENT taglib (taglib-uri, taglib-location)> - -<!-- -the taglib-location element contains the location (as a resource -relative to the root of the web application) where to find the Tag -Libary Description file for the tag library. - -Used in: taglib ---> -<!ELEMENT taglib-location (#PCDATA)> - -<!-- -The taglib-uri element describes a URI, relative to the location -of the web.xml document, identifying a Tag Library used in the Web -Application. - -Used in: taglib ---> -<!ELEMENT taglib-uri (#PCDATA)> - -<!-- -The transport-guarantee element specifies that the communication -between client and server should be NONE, INTEGRAL, or -CONFIDENTIAL. NONE means that the application does not require any -transport guarantees. A value of INTEGRAL means that the application -requires that the data sent between the client and server be sent in -such a way that it can't be changed in transit. CONFIDENTIAL means -that the application requires that the data be transmitted in a -fashion that prevents other entities from observing the contents of -the transmission. In most cases, the presence of the INTEGRAL or -CONFIDENTIAL flag will indicate that the use of SSL is required. - -Used in: user-data-constraint ---> -<!ELEMENT transport-guarantee (#PCDATA)> - -<!-- -The url-pattern element contains the url pattern of the mapping. Must -follow the rules specified in Section 11.2 of the Servlet API -Specification. - -Used in: filter-mapping, servlet-mapping, web-resource-collection ---> -<!ELEMENT url-pattern (#PCDATA)> - -<!-- -The user-data-constraint element is used to indicate how data -communicated between the client and container should be protected. - -Used in: security-constraint ---> -<!ELEMENT user-data-constraint (description?, transport-guarantee)> - -<!-- -The web-resource-collection element is used to identify a subset -of the resources and HTTP methods on those resources within a web -application to which a security constraint applies. If no HTTP methods -are specified, then the security constraint applies to all HTTP -methods. - -Used in: security-constraint ---> -<!ELEMENT web-resource-collection (web-resource-name, description?, -url-pattern*, http-method*)> - -<!-- -The web-resource-name contains the name of this web resource -collection. - -Used in: web-resource-collection ---> -<!ELEMENT web-resource-name (#PCDATA)> - -<!-- -The welcome-file element contains file name to use as a default -welcome file, such as index.html - -Used in: welcome-file-list ---> -<!ELEMENT welcome-file (#PCDATA)> - -<!-- -The welcome-file-list contains an ordered list of welcome files -elements. - -Used in: web-app ---> -<!ELEMENT welcome-file-list (welcome-file+)> - -<!-- -The ID mechanism is to allow tools that produce additional deployment -information (i.e., information beyond the standard deployment -descriptor information) to store the non-standard information in a -separate file, and easily refer from these tool-specific files to the -information in the standard deployment descriptor. - -Tools are not allowed to add the non-standard information into the -standard deployment descriptor. ---> - -<!ATTLIST auth-constraint id ID #IMPLIED> -<!ATTLIST auth-method id ID #IMPLIED> -<!ATTLIST context-param id ID #IMPLIED> -<!ATTLIST description id ID #IMPLIED> -<!ATTLIST display-name id ID #IMPLIED> -<!ATTLIST distributable id ID #IMPLIED> -<!ATTLIST ejb-link id ID #IMPLIED> -<!ATTLIST ejb-local-ref id ID #IMPLIED> -<!ATTLIST ejb-ref id ID #IMPLIED> -<!ATTLIST ejb-ref-name id ID #IMPLIED> -<!ATTLIST ejb-ref-type id ID #IMPLIED> -<!ATTLIST env-entry id ID #IMPLIED> -<!ATTLIST env-entry-name id ID #IMPLIED> -<!ATTLIST env-entry-type id ID #IMPLIED> -<!ATTLIST env-entry-value id ID #IMPLIED> -<!ATTLIST error-code id ID #IMPLIED> -<!ATTLIST error-page id ID #IMPLIED> -<!ATTLIST exception-type id ID #IMPLIED> -<!ATTLIST extension id ID #IMPLIED> -<!ATTLIST filter id ID #IMPLIED> -<!ATTLIST filter-class id ID #IMPLIED> -<!ATTLIST filter-mapping id ID #IMPLIED> -<!ATTLIST filter-name id ID #IMPLIED> -<!ATTLIST form-error-page id ID #IMPLIED> -<!ATTLIST form-login-config id ID #IMPLIED> -<!ATTLIST form-login-page id ID #IMPLIED> -<!ATTLIST home id ID #IMPLIED> -<!ATTLIST http-method id ID #IMPLIED> -<!ATTLIST icon id ID #IMPLIED> -<!ATTLIST init-param id ID #IMPLIED> -<!ATTLIST jsp-file id ID #IMPLIED> -<!ATTLIST large-icon id ID #IMPLIED> -<!ATTLIST listener id ID #IMPLIED> -<!ATTLIST listener-class id ID #IMPLIED> -<!ATTLIST load-on-startup id ID #IMPLIED> -<!ATTLIST local id ID #IMPLIED> -<!ATTLIST local-home id ID #IMPLIED> -<!ATTLIST location id ID #IMPLIED> -<!ATTLIST login-config id ID #IMPLIED> -<!ATTLIST mime-mapping id ID #IMPLIED> -<!ATTLIST mime-type id ID #IMPLIED> -<!ATTLIST param-name id ID #IMPLIED> -<!ATTLIST param-value id ID #IMPLIED> -<!ATTLIST realm-name id ID #IMPLIED> -<!ATTLIST remote id ID #IMPLIED> -<!ATTLIST res-auth id ID #IMPLIED> -<!ATTLIST res-ref-name id ID #IMPLIED> -<!ATTLIST res-sharing-scope id ID #IMPLIED> -<!ATTLIST res-type id ID #IMPLIED> -<!ATTLIST resource-env-ref id ID #IMPLIED> -<!ATTLIST resource-env-ref-name id ID #IMPLIED> -<!ATTLIST resource-env-ref-type id ID #IMPLIED> -<!ATTLIST resource-ref id ID #IMPLIED> -<!ATTLIST role-link id ID #IMPLIED> -<!ATTLIST role-name id ID #IMPLIED> -<!ATTLIST run-as id ID #IMPLIED> -<!ATTLIST security-constraint id ID #IMPLIED> -<!ATTLIST security-role id ID #IMPLIED> -<!ATTLIST security-role-ref id ID #IMPLIED> -<!ATTLIST servlet id ID #IMPLIED> -<!ATTLIST servlet-class id ID #IMPLIED> -<!ATTLIST servlet-mapping id ID #IMPLIED> -<!ATTLIST servlet-name id ID #IMPLIED> -<!ATTLIST session-config id ID #IMPLIED> -<!ATTLIST session-timeout id ID #IMPLIED> -<!ATTLIST small-icon id ID #IMPLIED> -<!ATTLIST taglib id ID #IMPLIED> -<!ATTLIST taglib-location id ID #IMPLIED> -<!ATTLIST taglib-uri id ID #IMPLIED> -<!ATTLIST transport-guarantee id ID #IMPLIED> -<!ATTLIST url-pattern id ID #IMPLIED> -<!ATTLIST user-data-constraint id ID #IMPLIED> -<!ATTLIST web-app id ID #IMPLIED> -<!ATTLIST web-resource-collection id ID #IMPLIED> -<!ATTLIST web-resource-name id ID #IMPLIED> -<!ATTLIST welcome-file id ID #IMPLIED> -<!ATTLIST welcome-file-list id ID #IMPLIED> diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java deleted file mode 100644 index 30cb1349..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java +++ /dev/null @@ -1,242 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import org.w3c.dom.*; - -import org.apache.xerces.parsers.DOMParser; -import java.util.logging.*; -import netscape.ldap.controls.LDAPProxiedAuthControl; -import netscape.ldap.LDAPSearchConstraints; - -public class BatchProcessor { - - private static Logger logger = Logger.getLogger("com.netscape.dsml.gateway.BatchProcessor"); - - private boolean attribute_resumeOnError = false; - private boolean FirstRequest = true; - private boolean dontHalt = true; - - private javax.xml.soap.SOAPElement root = null; - private javax.xml.soap.SOAPElement batch = null; - private java.util.Vector requests = new java.util.Vector(1); - - static private javax.xml.soap.MessageFactory messageFactory ; - static private javax.xml.soap.SOAPFactory sef ; - - private IConnectionManager ldap_pool = null; - - public javax.xml.parsers.DocumentBuilderFactory dbf; - public javax.xml.parsers.DocumentBuilder builder; - LDAPSearchConstraints proxyAuth = null; - - public BatchProcessor(javax.xml.soap.SOAPBody sb) { - - root = (javax.xml.soap.SOAPElement) sb; - - - - } - - public void init() throws gatewayException { - - try { - ProxyConnMgrFactory pmc = new ProxyConnMgrFactory(); - ldap_pool = pmc.getInstance(); - } - catch (Exception e) { - throw new gatewayException( e.getMessage() ); - - } - - try { - dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance(); - builder = dbf.newDocumentBuilder(); - org.w3c.dom.Document d = builder.newDocument(); - - } - catch (Exception e) { - throw new gatewayException( e.getMessage() ); - } - - } - - public void setProxy(String DN){ - LDAPProxiedAuthControl ctrl = new LDAPProxiedAuthControl( DN, true ); - proxyAuth = new LDAPSearchConstraints(); - proxyAuth.setServerControls( ctrl ); - - } - - public boolean preprocess() throws javax.xml.soap.SOAPException { - - if (root.getChildElements().hasNext() && - ((javax.xml.soap.SOAPElement) root.getChildElements().next()).getLocalName().equalsIgnoreCase("batchRequest")) { - - this.batch = (javax.xml.soap.SOAPElement) root.getChildElements().next(); - - /* attributes for batchRequest: - * "reponseOrder" -- not implemented - * "processing" -- not implemented - * "onError" -- implemented - */ - if (batch.getAttribute("onError") == null ) - attribute_resumeOnError = false; - else - attribute_resumeOnError = (batch.getAttribute("onError").equalsIgnoreCase("resume ")) ? true : false ; - - java.util.Iterator i = batch.getChildElements(); - - while (i.hasNext()) { - requests.add( i.next() ); - logger.log(Level.INFO, "adding request"); - } - return true; - } - else { - // error, no batchrequest... exit gracefully - - logger.log(Level.INFO, "NO batchRequest in this envelope"); - return false; - } - - - - } - - void process(int index) { - - /* This is a hack: - * This code is required because of Axis' incomplete - * implementation. Without these, whenever getNodeValue() and friends are - * called, exceptions are deliberately thrown. When Axis is fully - * functional it should be able to be removed. The following lines - * probably impact performance negatively. */ - DOMParser p = new DOMParser(); - try { - p.parse(new org.xml.sax.InputSource(new java.io.StringReader(this.requests.get(index).toString()))); - } catch (Exception E) { E.printStackTrace(); } - /* END */ - - Document doc = p.getDocument(); - Node myRequest = doc.getDocumentElement(); - - String RequestType = myRequest.getLocalName(); - gatewayContext context = new gatewayContext(); - - - Node res = null; - if (proxyAuth != null) - context.setConstraints( proxyAuth); - context.setRootNode(myRequest.cloneNode(true)); - - logger.log(Level.INFO, "Processing: starting {0}", RequestType); - - if (FirstRequest && RequestType.equals("authRequest")){ - if (FirstRequest) { - - OperationAuth CurrentOperation = new OperationAuth(); - res = CurrentOperation.getResponse(context) ; - - FirstRequest = false; - } else { - // error - } - - } else if (RequestType.equals("searchRequest")) { - - OperationSearch CurrentOperation = new OperationSearch(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("modifyRequest")){ - - OperationModify CurrentOperation= new OperationModify(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("addRequest")) { - - OperationAdd CurrentOperation = new OperationAdd(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("delRequest")) { - - OperationDelete CurrentOperation = new OperationDelete(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("modDNRequest")) { - - OperationModifyDN CurrentOperation = new OperationModifyDN(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("compareRequest")) { - - OperationCompare CurrentOperation = new OperationCompare(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("extendedRequest")) { - - OperationExtended CurrentOperation = new OperationExtended(); - res = CurrentOperation.getResponse(context) ; - - } else { - // output = echoHeaderStringHandler.sef.createElement("errorReponse"); - } - - - - - requests.set(index,res); - logger.log(Level.INFO, "Processing: finished {0}", RequestType); - FirstRequest = false; - ldap_pool.releaseConnection( context.getLdapConnection() ); - } - - - - public boolean Error(){ - return !this.dontHalt; - } - - public int getRequestCount(){ - return this.requests.size(); - } - - public javax.xml.soap.SOAPElement getRequestItem(int index) { - return (javax.xml.soap.SOAPElement) this.requests.get(index); - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java deleted file mode 100644 index bafbfc4f..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java +++ /dev/null @@ -1,126 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import java.io.*; -import java.util.Properties; -import java.util.logging.*; - -public class Configuration { - private static Logger logger = Logger.getLogger("com.netscape.dsml.gateway.Configuration"); - - private static String propertiesFilename; - private final static String header = "properties file for the Netscape DSMLGW"; - private final static String[][] defaults = new String[][] - { { "MinPool", "5" }, - { "MaxPool", "10" }, - { "MinLoginPool", "2" }, - { "MaxLoginPool", "5" }, - { "ServerHost", "localhost" }, - { "ServerPort", "389" }, - { "BindDN", "" }, - { "BindPW" , "" }, - { "UseAuth", "false" } - }; - - private static Configuration _instance = null; - private static Object lock = new Object(); - private static Properties properties = null; - - /** Creates a new instance of Config */ - private Configuration() { - - propertiesFilename = System.getProperty("user.home","") + System.getProperty("file.separator") + "dsmlgw.cfg"; - logger.log( Level.CONFIG, "using properties filename " + propertiesFilename); - load(); - } - - public static Configuration getInstance() { - if (null == _instance ) { - synchronized(lock) { - if (_instance == null ) - _instance = new Configuration(); - - } - } - return _instance; - } - - - private void load() { - try { - - properties = new Properties(); - - for (int i=0; i< defaults.length; i++) - properties.setProperty(defaults[i][0], defaults[i][1] ); - - - FileInputStream in = null; - in = new FileInputStream(propertiesFilename); - properties.load(in); - - } catch (java.io.FileNotFoundException e) { - - System.err.println("Can't find properties file: " + propertiesFilename + ". " + - "Using defaults."); - - } catch (java.io.IOException e) { - - System.err.println("Can't read properties file: " + propertiesFilename + ". " + - "Using defaults."); - - } - - } - - - public int getMinPool() { return Integer.parseInt(properties.getProperty("MinPool")); } - public int getMaxPool() { return Integer.parseInt(properties.getProperty("MaxPool")); } - public int getMinLoginPool() { return Integer.parseInt(properties.getProperty("MinLoginPool")); } - public int getMaxLoginPool() { return Integer.parseInt(properties.getProperty("MaxLoginPool")); } - public int getServerPort() { return Integer.parseInt(properties.getProperty("ServerPort")); } - - public String getServerHost() { return properties.getProperty("ServerHost"); } - - public String getBindDN() { return properties.getProperty("BindDN"); } - public String getBindPW() { return properties.getProperty("BindPW"); } - - public boolean getUseAuth() { return Boolean.valueOf( properties.getProperty("UseAuth").trim() ).booleanValue(); } - -} - diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java deleted file mode 100644 index badc7945..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java +++ /dev/null @@ -1,171 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -/** - * Constants used in the code. - */ -public class Constants -{ - public static final String DSML20_URN = "urn:oasis:dsml:names:tc:DSML:2:0:core"; - public static final String BATCH_REQUEST = "batchRequest"; - public static final String BATCH_RESPONSE = "batchResponse"; - - public static final String DSML_REQUEST = "DSMLRequest"; - public static final String DSML_RESPONSE = "DSMLResponse"; - - public static final String AUTH_REQUEST = "authRequest"; - public static final String SEARCH_REQUEST = "searchRequest"; - public static final String MODIFY_REQUEST = "modifyRequest"; - public static final String ADD_REQUEST = "addRequest"; - public static final String DEL_REQUEST = "delRequest"; - public static final String MODDN_REQUEST = "modDNRequest"; - public static final String COMPARE_REQUEST = "compareRequest"; - public static final String ABANDON_REQUEST = "abandonRequest"; - public static final String EXTENDED_REQ = "extendedRequest"; - - - public static final String AUTH_RESPONSE = "authResponse"; - public static final String SEARCH_RES_ENTRY = "searchResultEntry"; - public static final String SEARCH_RES_REF = "searchResultReference"; - public static final String SEARCH_RES_DONE = "searchResultDone"; - public static final String MODIFY_RESPONSE = "modifyResponse"; - public static final String ADD_RESPONSE = "addResponse"; - public static final String DEL_RESPONSE = "delResponse"; - public static final String MODDN_RESPONSE = "modDNResponse"; - public static final String COMPARE_RESPONSE = "compareResponse"; - public static final String ABANDON_RESPONSE = "abandonResponse"; - public static final String EXTENDED_RESPONSE= "extendedResponse"; - public static final String ERROR_RESPONSE = "errorResponse"; - public static final String SEARCH_RESPONSE = "searchResponse"; - - public static final String ERROR_TYPE = "type"; - public static final String ERROR_MESSAGE = "message"; - - - public static final String REQUEST_ID = "requestID"; - - public static final String PROCESSING = "processing"; - public static final String SEQUENTIAL = "sequential"; - public static final String PARALLEL = "parallel"; - - public static final String RESPONSE_ORDER = "responseOrder"; - public static final String UNORDERED = "unOrdered"; - - public static final String ON_ERROR = "onError"; - public static final String RESUME = "resume"; - public static final String EXIT = "exit"; - - - public static final String NOT_ATTEMPTED = "notAttempted"; - public static final String UNKNOWN_REQ = "Unknown Request"; - - public static final String BINDREQ_ERROR_MESSAGE = "Found a BindRequest which is not the first request"; - public static final String BATCH_RESPONSE_START_TAG = "<batchResponse xmlns=\"" + DSML20_URN + "\">"; - public static final String BATCH_RESPONSE_END_TAG = "</batchResponse>"; - - public static final String DN = "dn"; - //Modify Request - public static final String ATTR = "attr"; - public static final String OPERATION = "operation"; - public static final String ADD_OPERATION = "add"; - public static final String DELETE_OPERATION = "delete"; - public static final String REPLACE_OPERATION = "replace"; - public static final String NAME = "name"; - public static final String VALUE = "value"; - public static final String RESULT_CODE = "resultCode"; - public static final String CODE = "code"; - public static final String DESC = "desc"; - - public static final String FILTER = "filter"; - public static final String SUBSTRINGS = "substrings"; - public static final String EQUALITY_MATCH = "equalityMatch"; - public static final String GREATER_OR_EQAUAL = "greaterOrEqual"; - public static final String LESS_OR_EQAUAL = "lessOrEqual"; - public static final String PRESENT = "present"; - public static final String APPROX_MATCH = "approxMatch"; - public static final String EXTENSIBLE_MATCH = "extensibleMatch"; - public static final String MATCHING_RULE = "matchingRule"; - public static final String DN_ATTRIBUTES = "dnAttributes"; - public static final String AND = "and"; - public static final String OR = "or"; - public static final String NOT = "not"; - - public static final String SUBSTRING_INITIAL = "initial"; - public static final String SUBSTRING_ANY = "any"; - public static final String SUBSTRING_FINAL = "final"; - - public static final String CONTROL = "control"; - public static final String CONTROL_TYPE = "type"; - public static final String CONTROL_CRITICALITY = "criticality"; - public static final String CONTROL_VALUE = "controlValue"; - - public static final String SCOPE = "scope"; - public static final String BASE_SCOPE = "baseObject"; - public static final String SINGLE_LEVEL_SCOPE = "singleLevel"; - public static final String WHOLE_TREE_SCOPE = "wholeSubTree"; - - - public static final String DREF_ALIASES = "derefAliases"; - public static final String NEVER_DREF_ALIASES = "neverDerefAliases"; - public static final String DEREF_IN_SEARCH = "derefInSearching"; - public static final String DREF_FIND_BASE_OBJ = "derefFindingBaseObj"; - public static final String DREF_ALWAYS = "derefAlways"; - - public static final String SIZE_LIMIT = "sizeLimit"; - public static final String TIME_LIMIT = "timeLimit"; - public static final String TYPES_ONLY = "typesOnly"; - - public static final String ATTRIBUTES = "attributes"; - public static final String ATTRIBUTE = "attribute"; - - public static final String ERRORMESSAGE = "errorMessage"; - public static final String MATCHED_DN = "matchedDN"; - public static final String ERR_REFERRAL_STR = "referral"; - public static final String REF = "ref"; - public static final String NEWRDN = "newrdn"; - public static final String DELETEOLDRDN = "deleteoldrdn"; - public static final String NEWSUPERIOR = "newSuperior"; - public static final String ASSERTION = "assertion"; - public static final String REQUESTNAME = "requestName"; - public static final String REQUESTVALUE = "requestValue"; - public static final String DSMLNS = "dsml:"; - - public static final int BATCH = 0; - public static final int DSML_REQ = 1; - public static final int DEFAULT_PORT = 389; -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java deleted file mode 100644 index f44dbcd3..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java +++ /dev/null @@ -1,76 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - - -import netscape.ldap.*; -import org.w3c.dom.*; - -/** - * - * @author elliot - * - * This {interface|class} is the standard request. Specific requests / reponses - * inherit from this. - */ -class GenericOperation { - org.w3c.dom.Node root = null; - LDAPConnection ldapConn = null; - javax.xml.soap.MessageFactory messageFactory = null ; - javax.xml.soap.SOAPFactory sef = null; - - /** Creates a new instance of OperationCompare */ - public GenericOperation() { - try { - messageFactory = javax.xml.soap.MessageFactory.newInstance(); - sef = javax.xml.soap.SOAPFactory.newInstance(); - } catch (Exception E) {E.printStackTrace();} - } - - - public void setRoot(org.w3c.dom.Node op) { - if (root == null) - root = op; - - } - - public void setLDAPConnection(LDAPConnection lc) { - if (ldapConn == null) - ldapConn = lc; - } - // abstract javax.xml.soap.SOAPElement getResponse(gatewayContext ctx); -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java deleted file mode 100644 index 96166a1d..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java +++ /dev/null @@ -1,51 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -/** - * This interface defines the factory interfaces. Each connection manager implements - * must use the factory interface. The design patterns used are: Abstract Factory, - * Factory Method and Functor patterns in the GoF book. - */ - -public interface IConnMgrFactoryFunctor -{ - /** - * @return An instance of the connection manager factory - */ - public IConnectionManager getInstance() throws Exception; -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java deleted file mode 100644 index 51867d29..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java +++ /dev/null @@ -1,59 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import java.io.IOException; -import netscape.ldap.LDAPConnection; - -public interface IConnectionManager { - - - public void shutdown(); - public LDAPConnection getConnection(); - public LDAPConnection getLoginConnection(); - public void releaseConnection(LDAPConnection ld); - /** - * release the connection - * - * @param the login ctx - * @param the LDAP connection - */ - public void releaseConnection(String loginCtx, LDAPConnection ld); - public LDAPConnection getConnection(String loginCtx); - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java deleted file mode 100644 index 09484b41..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java +++ /dev/null @@ -1,96 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -/** - * - * @author elliot - */ -public class LDAPAuthenticator { - - String DN = null; - String PW = null; - - - /** Creates a new instance of LDAPAuthenticator */ - public LDAPAuthenticator(String username, String password) { - DN = username; - PW = password; - } - - public int authenticate() { - - if (DN == null && PW == null) - return 0; - - LDAPConnection ldc = null; - - ProxyConnMgrFactory pmc = new ProxyConnMgrFactory(); - IConnectionManager ldap_pool= pmc.getInstance(); - - ldc = ldap_pool.getLoginConnection(); - - if (ldc != null) { - try { - ldc.authenticate( DN, PW ); - } catch ( LDAPException e ) { - switch( e.getLDAPResultCode() ) { - case LDAPException.NO_SUCH_OBJECT: - // System.out.println( "The specified user does not exist." ); - return LDAPException.NO_SUCH_OBJECT; - - case LDAPException.INVALID_CREDENTIALS: - // System.out.println( "Invalid password." ); - return LDAPException.INVALID_CREDENTIALS; - - default: - // System.out.println( "Error number: " + e.getLDAPResultCode() ); - // System.out.println( "Failed to authentice as " + DN ); - return e.getLDAPResultCode() ; - - } - } - // System.out.println( "Authenticated as " + DN ); - return 0; - } else { - - // System.out.println( "Can't establish connection to LDAP server"); - return LDAPException.UNAVAILABLE ; - } - } -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java deleted file mode 100644 index 4d84cd9c..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java +++ /dev/null @@ -1,126 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - -public class OperationAdd extends GenericOperation { - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - LDAPAttributeSet ldAttrSet = new LDAPAttributeSet(); - // XXX is this really necessary? - // if (ldAttrSet == null ) { - // throw new Exception("MEMORY_ALLOCATION_ERROR"); - // } - - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - - org.w3c.dom.NodeList nl = root.getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - try { - Node attr = nl.item(i).getFirstChild(); - if (attr.getNodeType() == Node.TEXT_NODE) - attr = attr.getNextSibling(); - - String attrName = nl.item(i).getAttributes().getNamedItem("name").getNodeValue(); - byte[] attrValue; - - if (nl.item(i).getFirstChild().getNodeType() == Node.ELEMENT_NODE) - attrValue = ParseValue.parseValueFromNode( nl.item(i).getFirstChild() ); - else - attrValue = ParseValue.parseValueFromNode( nl.item(i).getFirstChild().getNextSibling() ); - - - LDAPAttribute ldapAttr = new LDAPAttribute( attrName, attrValue); - - if (ldapAttr != null ) { - ldAttrSet.add(ldapAttr); - } - - - - } - catch (Exception e) { e.printStackTrace();} - } - - } - - int resultCode= 0; - String errorMessage = "completed"; - LDAPEntry entry = new LDAPEntry(dn,ldAttrSet); - javax.xml.soap.SOAPElement output = null; - - try { - - - - - if (ctx.getConstraints() != null) { - ldapConn.add(entry, ctx.getConstraints() ); } - else { - ldapConn.add( entry ); } - - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage(); - - - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("addResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - if (errorMessage != null) - sbe.addChildElement("errorMessage").addTextNode(errorMessage); - - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java deleted file mode 100644 index 3bf19717..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java +++ /dev/null @@ -1,65 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - -public class OperationAuth extends GenericOperation { - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("authResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer( netscape.ldap.LDAPException.AUTH_METHOD_NOT_SUPPORTED).toString() ); - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - } - - - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java deleted file mode 100644 index 28ff6157..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java +++ /dev/null @@ -1,111 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - -public class OperationCompare extends GenericOperation { - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - - LDAPAttribute attr = null; - org.w3c.dom.NodeList nl = root.getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - try { - if (nl.item(i).getLocalName().equals("assertion") ) { - - String field = nl.item(i).getAttributes().getNamedItem("name").getNodeValue(); - attr = new LDAPAttribute(field); - - NodeList Values = nl.item(i).getChildNodes(); - - for (int j=0; j< Values.getLength(); j++) { - if (Values.item(j).getNodeType() == Node.ELEMENT_NODE && - Values.item(j).getLocalName().equals("value")) { - attr.addValue(Values.item(j).getFirstChild().getNodeValue()); - - } - - } - } - } catch (Exception e) { } - } - } - - boolean result; - int resultCode= 0; - String errorMessage = "completed"; - - javax.xml.soap.SOAPElement output = null; - LDAPAttribute attribute=null; - - - - try { - if (ctx.getConstraints() != null) - result = ldapConn.compare(dn, attr, ctx.getConstraints() ); - else - result = ldapConn.compare(dn, attr); - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("modDNResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - if (errorMessage != null) - sbe.addChildElement("errorMessage").addTextNode(errorMessage); - - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - - } -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java deleted file mode 100644 index 5f673b57..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java +++ /dev/null @@ -1,87 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - - -public class OperationDelete extends GenericOperation { - - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - - int resultCode= 0; - String errorMessage = "completed"; - - javax.xml.soap.SOAPElement output = null; - - - - try { - if (ctx.getConstraints() != null) - ldapConn.delete(dn, ctx.getConstraints() ); - else - ldapConn.delete(dn); - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("deleteResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - if (errorMessage != null) - sbe.addChildElement("errorMessage").addTextNode(errorMessage); - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - - - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java deleted file mode 100644 index d168a440..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java +++ /dev/null @@ -1,122 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; -import netscape.ldap.util.ByteBuf; -import netscape.ldap.util.MimeBase64Decoder; - -public class OperationExtended extends GenericOperation { - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - - - - LDAPException ldException = null; - LDAPSearchResults results = null; - LDAPSearchConstraints searchConstraint = new LDAPSearchConstraints(); - java.util.Vector modifications = new java.util.Vector(1); - - String oid = new String(); - ByteBuf value=new ByteBuf(); - String binaryStr = null; - org.w3c.dom.NodeList nl = root.getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - try { - if (nl.item(i).getLocalName().equals("requestName") ) { - oid = nl.item(i).getFirstChild().getNodeValue().trim(); - - } else if (nl.item(i).getLocalName().equals("requestValue") ) { - - // Assuming the it is base64Binary - binaryStr = nl.item(i).getFirstChild().getNodeValue(); - ByteBuf inputBuf = new ByteBuf(binaryStr); - value = new ByteBuf(); - MimeBase64Decoder decoder = new MimeBase64Decoder(); - decoder.translate(inputBuf, value); - decoder.eof(value); - - } - - } catch (Exception e) { } - } - } - - - LDAPExtendedOperation extendedOperation = new LDAPExtendedOperation(oid, null ); - - int resultCode= 0; - String errorMessage = "completed"; - - javax.xml.soap.SOAPElement output = null; - - - LDAPExtendedOperation result = null; - try { - if (ctx.getConstraints() != null) - result = ldapConn.extendedOperation(extendedOperation, ctx.getConstraints() ); - else - result = ldapConn.extendedOperation(extendedOperation); - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("extendedResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - sbe.addChildElement("reponse").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("xsi:type"), "xsd:base64Binary" ).setNodeValue( result.getValue().toString() ); - - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - - - - } -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java deleted file mode 100644 index 17aa356b..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java +++ /dev/null @@ -1,166 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; -import java.util.logging.*; - -public class OperationModify extends GenericOperation { - private static Logger logger = Logger.getLogger("com.netscape.dsml.gateway.OperationModify"); - org.w3c.dom.Node root = null; - LDAPConnection ldapConn = null; - javax.xml.soap.MessageFactory messageFactory = null ; - javax.xml.soap.SOAPFactory sef = null; - - OperationModify(){ - try { - messageFactory = javax.xml.soap.MessageFactory.newInstance(); - sef = javax.xml.soap.SOAPFactory.newInstance(); - } catch (Exception E) {E.printStackTrace(); - } - } - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - - root = ctx.getRootNode(); - - - LDAPException ldException = null; - LDAPSearchResults results = null; - LDAPSearchConstraints searchConstraint = new LDAPSearchConstraints(); - java.util.Vector modifications = new java.util.Vector(1); - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - - org.w3c.dom.NodeList nl = root.getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - try { - if (nl.item(i).getLocalName().equals("modification") ) { - - // should check to make sure there's only one child to this filter - - Node mod = nl.item(i); - - String modify_field = mod.getAttributes().getNamedItem("name").getNodeValue().trim(); - String modify_op = mod.getAttributes().getNamedItem("operation").getNodeValue(); - - logger.log(Level.INFO, "modify_field: {0}", modify_field); - logger.log(Level.INFO, "modify_op: {0}", modify_op); - - int op = -1; - LDAPAttribute attr = new LDAPAttribute(modify_field); - - NodeList Values = mod.getChildNodes(); - - for (int j=0; j< Values.getLength(); j++) { - if (Values.item(j).getNodeType() == Node.ELEMENT_NODE && - Values.item(j).getLocalName().equals("value")) { - attr.addValue( ParseValue.parseValueFromNode(Values.item(j)) ); - - } - - } - - - - if (modify_op.equals("replace")) { - op =LDAPModification.REPLACE; - } else if (modify_op.equals("delete")) { - op =LDAPModification.DELETE; - } else if (modify_op.equals("add")) { - op =LDAPModification.ADD; - } - - modifications.add(new LDAPModification(op, attr)); - - } - - - - } - catch (Exception e) { e.printStackTrace();} - - } - } - - LDAPModification[] lm = new LDAPModification[modifications.size()]; - for (int i=0; i< modifications.size(); i++) - lm[i] = (LDAPModification) modifications.get(i); - - int resultCode= 0; - String errorMessage = "completed"; - - javax.xml.soap.SOAPElement output = null; - - ldapConn = ctx.getLdapConnection(); - - try { - if (ctx.getConstraints() != null) - ldapConn.modify(dn, lm, ctx.getConstraints() ); - else - ldapConn.modify(dn, lm); - - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - if (! ldapConn.isConnected()) { - errorMessage = "GATEWAY NOT CONNECTED"; - } - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("modifyResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - if (errorMessage != null) - sbe.addChildElement("errorMessage").addTextNode(errorMessage); - - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - - - } - - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java deleted file mode 100644 index b42025f0..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java +++ /dev/null @@ -1,125 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - -public class OperationModifyDN extends GenericOperation { - - org.w3c.dom.Node root = null; - LDAPConnection ldapConn = null; - javax.xml.soap.MessageFactory messageFactory = null ; - javax.xml.soap.SOAPFactory sef = null; - - OperationModifyDN(){ - try { - messageFactory = javax.xml.soap.MessageFactory.newInstance(); - sef = javax.xml.soap.SOAPFactory.newInstance(); - } catch (Exception E) {E.printStackTrace(); - } - } - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - LDAPException ldException = null; - LDAPSearchResults results = null; - LDAPSearchConstraints searchConstraint = new LDAPSearchConstraints(); - - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - String newRDN= root.getAttributes().getNamedItem("newrdn").getNodeValue().trim(); - - boolean deleteOldRDN= true; - - try { - if (root.getAttributes().getNamedItem("deleteoldrdn") != null) - deleteOldRDN = new Boolean( root.getAttributes().getNamedItem("deleteoldrdn").getNodeValue().trim()).booleanValue(); - } catch (Exception e) { } - - - // This is unsupported, but it's here for the sake of completion. - String newSuperior = null; - try { - if (root.getAttributes().getNamedItem("newSuperior") != null) - newSuperior = root.getAttributes().getNamedItem("newSuperior").getNodeValue().trim(); - } catch (Exception e) { newSuperior = null; } - - int resultCode= 0; - String errorMessage = "completed"; - - javax.xml.soap.SOAPElement output = null; - - - - try { - if (ctx.getConstraints() != null) - ldapConn.rename(dn, newRDN, newSuperior, deleteOldRDN,ctx.getConstraints() ); - else - ldapConn.rename(dn, newRDN, newSuperior, deleteOldRDN); - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("modDNResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - if (errorMessage != null) - sbe.addChildElement("errorMessage").addTextNode(errorMessage); - - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - - - } - - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java deleted file mode 100644 index 482abaee..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java +++ /dev/null @@ -1,352 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - -import java.util.logging.*; - -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Node; -import org.w3c.dom.traversal.NodeIterator; -import org.w3c.dom.traversal.DocumentTraversal; -import org.w3c.dom.traversal.TreeWalker; -import org.w3c.dom.traversal.NodeFilter; - -class OperationSearch extends GenericOperation { - - org.w3c.dom.Node root = null; - LDAPConnection ldapConn = null; - javax.xml.soap.MessageFactory messageFactory = null ; - javax.xml.soap.SOAPFactory sef = null; - private static Logger logger = - Logger.getLogger("com.netscape.dsml.service.ProxyConnectionManager"); - - OperationSearch(){ - try { - messageFactory = javax.xml.soap.MessageFactory.newInstance(); - sef = javax.xml.soap.SOAPFactory.newInstance(); - } catch (Exception E) {E.printStackTrace(); - } - } - - public void setRoot(org.w3c.dom.Node op){ - if (root == null) - root = op; - } - - public void setLDAPConnection(LDAPConnection lc) { - if (ldapConn == null) - ldapConn = lc; - } - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - - root = ctx.getRootNode(); - - - int scope = -1; - int derefAliases = -1; - - LDAPException ldException = null; - LDAPSearchResults results = null; - - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - String scopeRaw = root.getAttributes().getNamedItem("scope").getNodeValue().trim(); - String derefAliasesRaw = root.getAttributes().getNamedItem("derefAliases").getNodeValue().trim(); - - int sizeLimit = 0; - try { - if ( root.getAttributes().getNamedItem("sizeLimit") != null) - sizeLimit = Integer.parseInt( root.getAttributes().getNamedItem("sizeLimit").getNodeValue()); - } catch (Exception e) {} - - - int timeLimit = 0; - try { - if ( root.getAttributes().getNamedItem("timeLimit") != null) - timeLimit = Integer.parseInt( root.getAttributes().getNamedItem("timeLimit").getNodeValue()); - } catch (Exception e) {} - - boolean typesOnly = false; - try { - if ( root.getAttributes().getNamedItem("typesOnly") != null ) - typesOnly = Boolean.valueOf(root.getAttributes().getNamedItem("typesOnly").getNodeValue()).booleanValue(); - } catch (Exception e) {} - - - String attributeList[] = null; - java.util.Vector attributeRaw = new java.util.Vector(); - java.util.Vector Controls = new java.util.Vector(); - String filterString = new String(); - - root.normalize(); - - int whattoshow = NodeFilter.SHOW_ALL; - NodeFilter nodefilter = null; - boolean expandreferences = false; - - - org.w3c.dom.NodeList nl = root.getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - try { - if (nl.item(i).getLocalName().equals("filter") ) { - // should check to make sure there's only one child to this filter - NodeList filters = nl.item(i).getChildNodes(); - for (int j=0; j< filters.getLength(); j++) { - if (filters.item(j).getNodeType() == Node.ELEMENT_NODE){ - filterString = ParseFilter.parseFilterFromNode( filters.item(j)); - } - } - - - } else if (nl.item(i).getLocalName().equals("attributes") ) { - NodeList attributes = nl.item(i).getChildNodes(); - - for (int j=0; j< attributes.getLength(); j++) { - if (attributes.item(j).getNodeType() == Node.ELEMENT_NODE){ - attributeRaw.add( attributes.item(j).getAttributes().getNamedItem("name").getNodeValue() ); - } - } - attributeList= new String[ attributeRaw.size()]; - for (int j=0; j< attributeRaw.size(); j++) - attributeList[j] = (String) attributeRaw.get(j); - - } else if (nl.item(i).getLocalName().equals("control") ) { - Controls.add( ParseControl.parseControlFromNode(nl.item(i)) ); - - } - - } - catch (Exception e) { e.printStackTrace();} - - } } - // XXX - - if (scopeRaw.equals("baseObject")) - scope = ldapConn.SCOPE_BASE; - else if (scopeRaw.equals("singleLevel")) - scope = ldapConn.SCOPE_ONE; - else if (scopeRaw.equals("wholeSubtree")) - scope = ldapConn.SCOPE_SUB; - else - scope = ldapConn.SCOPE_BASE; - - - if (derefAliasesRaw.equals("neverDerefAliases")) - derefAliases = ldapConn.DEREF_NEVER; - else if (derefAliasesRaw.equals("derefInSearching")) - derefAliases = ldapConn.DEREF_SEARCHING; - else if (derefAliasesRaw.equals("derefFindingBaseObj")) - derefAliases = ldapConn.DEREF_FINDING; - else if (derefAliasesRaw.equals("derefAlways")) - derefAliases = ldapConn.DEREF_ALWAYS; - else - derefAliases = ldapConn.DEREF_NEVER; - - - - logger.log(Level.INFO, "dn: {0}", dn); - logger.log(Level.INFO, "scope: {0}", scopeRaw); - logger.log(Level.INFO, "derefAliases: {0}", derefAliasesRaw); - - logger.log(Level.INFO, "sizeLimit: {0}", String.valueOf(sizeLimit) ); - logger.log(Level.INFO, "timeLimit: {0}", String.valueOf(timeLimit) ); - logger.log(Level.INFO, "typesOnly: {0}", String.valueOf(typesOnly) ); - if (attributeList ==null) - logger.log(Level.INFO, "attributeList: {0}", "null"); - else - logger.log(Level.INFO, "attributeList: {0}", attributeList.toString() ); - logger.log(Level.INFO, "filter: {0}", filterString ); - - /* - * System.out.println("dn : " + dn ); - * System.out.println("scope : " + scopeRaw ); - * System.out.println("derefAliases : " + derefAliasesRaw ); - * System.out.println("sizeLimit : " + sizeLimit ); - * System.out.println("timeLimit : " + timeLimit ); - * System.out.println("typesOnly : " + typesOnly ); - * System.out.println("filterString : " + filterString ); - * - * System.out.println("attributeList[]"); - * if (attributeList == null) - * System.out.println("null"); - * else { - * for (int i=0; i < attributeList.length ; i++ ) - * System.out.println("attributeList[" + i + "] : " + attributeList[i]); - *} - */ - - int resultCode = 0; - String errorMessage = "completed"; - - ctx.setConstraints( new LDAPSearchConstraints() ); - ctx.getConstraints().setTimeLimit(timeLimit); - ctx.getConstraints().setDereference(derefAliases); - ctx.getConstraints().setMaxResults(sizeLimit); - - try { - if (Controls.size() >0 ) { - if (ctx.getConstraints() == null) { - ctx.setConstraints( new LDAPSearchConstraints() ); - } - // XXX this gave a class cast exception, don't understand why - - netscape.ldap.LDAPControl tmp[] = new netscape.ldap.LDAPControl[ Controls.size() ]; - for (int i=0; i< Controls.size(); i++) { - tmp[i] = (netscape.ldap.LDAPControl) Controls.get(i); - } - - ctx.getConstraints().setServerControls( tmp ); - - } - - ldapConn = ctx.getLdapConnection(); - - if (ctx.getConstraints() != null) - results = ldapConn.search(dn, scope, filterString, attributeList, false, ctx.getConstraints() ); - else - results = ldapConn.search( dn, scope, filterString, attributeList, false); - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = "LDAP Error code " + new Integer(resultCode).toString(); - // This line should work - // XXX errorMessage = LDAPException.errorCodeToString(resultCode); - E.printStackTrace(); - } - - - javax.xml.soap.SOAPEnvelope elementFactory = null; - javax.xml.soap.SOAPBody entryFactory = null; - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("searchResponse") ); - entryFactory = messageFactory.createMessage().getSOAPBody(); - elementFactory = messageFactory.createMessage().getSOAPPart().getEnvelope(); - } catch (Exception E) { }; - - if (results != null) { - while (results.hasMoreElements()) { - try { - LDAPEntry entry = results.next(); - LDAPAttributeSet attributeset = entry.getAttributeSet(); - java.util.Enumeration attribs = attributeset.getAttributes(); - dn = entry.getDN(); - - javax.xml.soap.SOAPBodyElement searchresultentry = null; - try { - searchresultentry = entryFactory.addBodyElement(elementFactory.createName("searchResultEntry") ); - searchresultentry.addAttribute(elementFactory.createName("dn"), dn); - sbe.addChildElement(searchresultentry); - } catch (Exception E) { E.printStackTrace(); } - - - while (attribs.hasMoreElements()) { - LDAPAttribute att = (LDAPAttribute) attribs.nextElement(); - - String[] values = att.getStringValueArray(); - javax.xml.soap.SOAPElement attr = null; - attr = searchresultentry.addChildElement( elementFactory.createName("attr")); - attr.addAttribute(elementFactory.createName( "name" ), att.getName() ); - - for (int k=0; k< values.length;k++) { - javax.xml.soap.SOAPElement val = attr.addChildElement("value"); - val.addTextNode( values[k] ); - } - - } - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - } catch (Exception E) { E.printStackTrace(); } - - } - - } - - try { - javax.xml.soap.SOAPBodyElement resultdone = null; - - resultdone = messageFactory.createMessage().getSOAPBody().addBodyElement(elementFactory.createName("searchResultDone") ); - - /* if there are controls to add to this envelope, they go in the searchresultdone tag */ - - netscape.ldap.LDAPControl serverControls[] = null; - if (results!=null) - serverControls = results.getResponseControls(); - - if (serverControls != null && serverControls.length >0) { - - for (int k=0; k< serverControls.length; k++) { - if ( serverControls[k] instanceof netscape.ldap.controls.LDAPVirtualListResponse ) { - netscape.ldap.controls.LDAPVirtualListResponse lvlr = (netscape.ldap.controls.LDAPVirtualListResponse) serverControls[k]; - javax.xml.soap.SOAPBodyElement ctl = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("control") ); - ctl.addAttribute( messageFactory.createMessage().getSOAPPart().getEnvelope().createName("type"), netscape.ldap.controls.LDAPVirtualListResponse.VIRTUALLISTRESPONSE ); - resultCode = lvlr.getResultCode(); - - javax.xml.soap.SOAPElement controlValue = messageFactory.createMessage().getSOAPBody().addChildElement("controlValue", "", ""); - controlValue.addChildElement("begin", "").addTextNode( new Integer( lvlr.getFirstPosition() ).toString() ); - controlValue.addChildElement("count", "").addTextNode( new Integer( lvlr.getContentCount() ).toString() ); - - resultdone.addChildElement( controlValue); - - resultdone.addChildElement(ctl); - } else if ( serverControls[k] instanceof netscape.ldap.controls.LDAPSortControl ) { - netscape.ldap.controls.LDAPSortControl lsc = (netscape.ldap.controls.LDAPSortControl) serverControls[k]; - javax.xml.soap.SOAPBodyElement ctl = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("control") ); - ctl.addAttribute( messageFactory.createMessage().getSOAPPart().getEnvelope().createName("type"), netscape.ldap.controls.LDAPSortControl.SORTRESPONSE ); - resultdone.addChildElement(ctl); - resultCode = lsc.getResultCode(); // new result code now by way of control - } - } - } /* end of control section */ - - - resultdone.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - sbe.addChildElement(resultdone); - } catch (Exception E) {E.printStackTrace(); } - - return sbe; - - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java deleted file mode 100644 index 41c977bc..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java +++ /dev/null @@ -1,160 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import org.w3c.dom.*; -import java.util.logging.*; - -public class ParseControl { - - public static netscape.ldap.LDAPControl parseControlFromNode(org.w3c.dom.Node n) { - Logger logger = Logger.getLogger("com.netscape.dsml.gateway.ParseControl"); - String type = null; - byte[] value = null; - boolean criticality = false; - - - try { - type = n.getAttributes().getNamedItem("type").getNodeValue(); - } catch (Exception e) { - // throw new gatewayException("control type can not be omitted"); - } - - try { - criticality = Boolean.valueOf( n.getAttributes().getNamedItem("criticality").getNodeValue() ).booleanValue(); - } catch (Exception e) { /* ignore */ } - - - netscape.ldap.LDAPControl lc = null; - if (type.equals( netscape.ldap.controls.LDAPSortControl.SORTREQUEST ) ) { - try { - java.util.Vector ldskv = new java.util.Vector(); - - org.w3c.dom.NodeList nl = n.getFirstChild().getNextSibling().getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - - if (nl.item(i).getLocalName().equals("attr") ) { - - // should check to make sure there's only one child to this filter - - Node mod = nl.item(i); - - String attribute = mod.getAttributes().getNamedItem("name").getNodeValue().trim(); - boolean reverse = false; - - try { - reverse = new Boolean( mod.getAttributes().getNamedItem("reverse").getNodeValue().trim()).booleanValue(); - } catch (Exception e) {} - - netscape.ldap.LDAPSortKey ldsk = new netscape.ldap.LDAPSortKey(attribute, reverse); - logger.log(Level.FINE, "SSS: reverse: {0}", String.valueOf(reverse)); - logger.log(Level.FINE, "SSS: attribute: {0}", attribute ); - - ldskv.add(ldsk); - - } - } - } - - netscape.ldap.LDAPSortKey sortkeys[] = new netscape.ldap.LDAPSortKey[ ldskv.size() ]; - for (int j=0; j< ldskv.size(); j++) - sortkeys[j] = (netscape.ldap.LDAPSortKey) ldskv.get(j); - lc = new netscape.ldap.controls.LDAPSortControl(sortkeys, criticality); - - } catch (Exception e) - { e.printStackTrace(); } - - - } else if (type.equals( netscape.ldap.controls.LDAPVirtualListControl.VIRTUALLIST ) ) { - //lc = new netscape.ldap.controls.LDAPVirtualListControl(,); - int index = 0; - int before = 0; - int after = 0; - int content = 0; - java.util.Vector ldskv = new java.util.Vector(); - - org.w3c.dom.NodeList nl = n.getFirstChild().getNextSibling().getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - - if (nl.item(i).getLocalName().equals("index") ) { - try { - index = Integer.parseInt( nl.item(i).getFirstChild().getNodeValue() ); - } catch (Exception e) {} - - } else if (nl.item(i).getLocalName().equals("before") ) { - try { - before = Integer.parseInt( nl.item(i).getFirstChild().getNodeValue() ); - } catch (Exception e) {} - - } else if (nl.item(i).getLocalName().equals("after") ) { - try { - after = Integer.parseInt( nl.item(i).getFirstChild().getNodeValue() ); - } catch (Exception e) {} - } else if (nl.item(i).getLocalName().equals("count") ) { - try { - content = Integer.parseInt( nl.item(i).getFirstChild().getNodeValue() ); - } catch (Exception e) {} - - - - } - } - } - - logger.log(Level.FINE, "VLV: index: {0}", String.valueOf(index)); - logger.log(Level.FINE, "VLV: before: {0}", String.valueOf(before)); - logger.log(Level.FINE, "VLV: after: {0}", String.valueOf(after)); - logger.log(Level.FINE, "VLV: content: {0}", String.valueOf(content)); - lc = new netscape.ldap.controls.LDAPVirtualListControl( index, before, after, content ); - - } else { - if (criticality) { - // throw new gatewayException("unrecognized control oid"); - } else { - // do nothing - } - - } - - - - return lc; - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java deleted file mode 100644 index 5302c734..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java +++ /dev/null @@ -1,182 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import org.w3c.dom.*; -import java.util.logging.*; - -public class ParseFilter { - - public static String parseFilterFromNode(org.w3c.dom.Node n) { - Logger logger = Logger.getLogger("com.netscape.dsml.gateway.FilterProcess"); - StringBuffer sb = new java.lang.StringBuffer(); - String output = new String(); - - if ( n != null && n.getNodeType() != Node.TEXT_NODE) { - String NodeName = n.getLocalName(); - - if ( NodeName.equals("present") ) { - logger.log(Level.ALL, "got filter: present"); - sb.append(n.getAttributes().getNamedItem("name").getNodeValue()); - sb.append("=*"); - - } else if ( NodeName.equals("and") ) { - logger.log(Level.FINE, "got filter: and"); - Node it = n.getFirstChild(); - - sb.append('&'); - - while (it != null ) { - if (it.getNodeType() != Node.TEXT_NODE) - sb.append( parseFilterFromNode( it ) ); - it = it.getNextSibling(); - } - - } else if ( NodeName.equals("or") ) { - logger.log(Level.FINE, "got filter: or"); - Node it = n.getFirstChild(); - - sb.append('|'); - - while (it != null ) { - if (it.getNodeType() != Node.TEXT_NODE) - sb.append( parseFilterFromNode( it ) ); - it = it.getNextSibling(); - } - - } else if ( NodeName.equals("not") ) { - logger.log(Level.FINE, "got filter: not"); - Node it = n.getFirstChild(); - - sb.append('!'); - - if (it.getNodeType() == Node.TEXT_NODE) - it = it.getNextSibling(); - - sb.append( parseFilterFromNode(it) ); - - } else if ( NodeName.equals("greaterOrEqual") ) { - logger.log(Level.FINE, "got filter: greaterOrEqual"); - sb.append(n.getAttributes().getNamedItem("name").getNodeValue()); - sb.append(">="); - - Node it = n.getFirstChild(); - if (it.getNodeType() == Node.TEXT_NODE) - it = it.getNextSibling(); - - sb.append(it.getFirstChild().getNodeValue()); - - // if (n.getFirstChild().getNextSibling().getFirstChild().getNodeValue() != null) - // sb.append(it.getFirstChild().getNodeValue()); - // else - // sb.append( n.getFirstChild().getFirstChild().getNodeValue()); - - } else if ( NodeName.equals("lessOrEqual") ) { - logger.log(Level.FINE, "got filter: lessOrEqual"); - sb.append(n.getAttributes().getNamedItem("name").getNodeValue()); - sb.append("<="); - Node it = n.getFirstChild(); - if (it.getNodeType() == Node.TEXT_NODE) - it = it.getNextSibling(); - - sb.append(it.getFirstChild().getNodeValue()); - - } else if ( NodeName.equals("equalityMatch") ) { - logger.log(Level.FINE, "got filter: equalityMatch"); - logger.log(Level.FINER," eq: " + n.getAttributes().getNamedItem("name").getNodeValue()); - sb.append(n.getAttributes().getNamedItem("name").getNodeValue() ); - logger.log(Level.FINER," eq: = "); - sb.append('='); - Node it = n.getFirstChild(); - if (it.getNodeType() == Node.TEXT_NODE) - it = it.getNextSibling(); - - sb.append(it.getFirstChild().getNodeValue()); - - - } else if ( NodeName.equals("approxMatch") ) { - logger.log(Level.FINE, "got filter: approxMatch"); - sb.append(n.getAttributes().getNamedItem("name").getNodeValue() ); - sb.append("~="); - Node it = n.getFirstChild(); - if (it.getNodeType() == Node.TEXT_NODE) - it = it.getNextSibling(); - - sb.append(it.getFirstChild().getNodeValue()); - - - } else if ( NodeName.equals("substrings") ) { - logger.log(Level.FINE, "got filter: substrings"); - - Node it = n.getFirstChild(); - - sb.append(n.getAttributes().getNamedItem("name").getNodeValue()); - sb.append('='); - - boolean noStar = false; - - - while (it != null) { - - if (it.getNodeType() != Node.TEXT_NODE){ - if (it.getLocalName().equals("any")){ - if ( ! noStar ) - sb.append('*'); - noStar = true; - sb.append(it.getFirstChild().getNodeValue()); - sb.append('*'); - } else if (it.getLocalName().equals("initial")){ - noStar = true; - sb.append(it.getFirstChild().getNodeValue()); - sb.append('*'); - } if (it.getLocalName().equals("final")){ - if (! noStar) - sb.append('*'); - sb.append(it.getFirstChild().getNodeValue()); - } - } - it=it.getNextSibling(); - } - } else return new String(); - - - } - logger.log(Level.INFO, "returning: (" + sb.toString() + ")" ); - return new StringBuffer().append('(').append(sb).append(')').toString(); - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java deleted file mode 100644 index c1697f17..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java +++ /dev/null @@ -1,79 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import org.apache.commons.codec.binary.Base64; - -/** - * - * @author elliot - */ -public class ParseValue { - - /** Creates a new instance of ParseValue */ - public ParseValue() { - } - - public static byte[] parseValueFromNode(org.w3c.dom.Node n) { - byte[] ret = null; - // <xsd:union memberTypes="xsd:string xsd:base64Binary xsd:anyURI"/> - - org.w3c.dom.Node type = n.getAttributes().getNamedItem("xsi:type"); - if (type != null && type.getNodeValue().equalsIgnoreCase("xsd:base64Binary") ) { - // This value is encoded in base64. decode it. - Base64 bd = new Base64(); - try { - ret = bd.decode( n.getFirstChild().getNodeValue().getBytes() ) ; - } - catch (org.w3c.dom.DOMException de) { - ret = "".getBytes(); - } - catch (Exception e) { - // couldn't decode auth info - } - - } else { - // anyURI is unsupported. - ret = new String(n.getFirstChild().getNodeValue()).getBytes(); - - } - return ret; - - } - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java deleted file mode 100644 index a7fb6870..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -/** - * This provides a factory interface to the proxy connection manager. In the - * proxy mode, the user connections are bound to the directory server using a - * proxy user. - */ - -public class ProxyConnMgrFactory implements IConnMgrFactoryFunctor { - - public ProxyConnMgrFactory() { - } - - /** - * @return An instance of the connection manager - * - * @exception DSMLConfigException if unable to initialize. - */ - public synchronized IConnectionManager getInstance() { - - if (_proxyConnMgr == null) { - _proxyConnMgr = ProxyConnectionManager.getInstance(); - } - return _proxyConnMgr; - } - private ProxyConnectionManager _proxyConnMgr= null; - - - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java deleted file mode 100644 index 86577c2a..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java +++ /dev/null @@ -1,289 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import java.lang.Exception ; -import java.util.*; -import java.util.logging.*; -import netscape.ldap.LDAPConnection; -import netscape.ldap.util.ConnectionPool; -import netscape.ldap.LDAPConstraints; -import netscape.ldap.LDAPSearchConstraints; -import netscape.ldap.controls.LDAPProxiedAuthControl; -import netscape.ldap.LDAPBind; -import netscape.ldap.LDAPException; -import java.io.IOException; - -/** - * ProxyConnectionManager is respossible for creating a pool of connections - * to the directory server. The pool is initialized with configured set of - * connections. Two pools are created; one for authentication and the other - * for operations. The pool parameters (max and min) can be configured. - * - */ -class ProxyConnectionManager implements IConnectionManager { - /* - * Default maximum backlog queue size - */ - static final int MAX_BACKLOG = 100; - static final String LDAP_MAXBACKLOG = "maxbacklog"; - static final String LDAP_REFERRAL = "referral"; - - - private static Logger logger = - Logger.getLogger("com.netscape.dsml.service.ProxyConnectionManager"); - static private ConnectionPool _ldapPool = null; - static private ConnectionPool _ldapLoginPool = null; - static private LDAPConnection _trialConn = null; - static private LDAPSearchConstraints _defaultSearchConstraints = null; - static private ProxyConnectionManager m_instance = null; - - private String m_host = null; - private int m_port = 0; - private String m_user = ""; - private String m_password = ""; - - /** - * Initialize by reading the informaton from the config manager. - * - * throws DSMLConfigException if unable to get the config - * information. - */ - private ProxyConnectionManager() { - init(); - } - - - private void init() { - // Get an instance of the config manager - Configuration config = Configuration.getInstance(); - - m_host = config.getServerHost(); - m_port = config.getServerPort(); - m_user = config.getBindDN(); - m_password = config.getBindPW(); - - logger.log(Level.INFO, "m_host: {0}", m_host); - logger.log(Level.INFO, "m_port: {0}", String.valueOf(m_port) ); - logger.log(Level.INFO, "m_user: {0}", m_user); - logger.log(Level.INFO, "m_password: {0}", m_password); - - logger.log(Level.FINER, "Initializing the ldap pool"); - initLdapPool( config.getMinPool(), config.getMaxPool()); - - logger.log(Level.FINER, "Initializing the ldap LOGIN pool"); - initLoginPool(config.getMinLoginPool(), config.getMaxLoginPool()); - - logger.log(Level.FINER, "Pool initialization done"); - } - - - /** - * create the singelton LDAPLayer object if it doesn't exist already. - * - * @exception DSMLConfigException if unable initialize configurations. - */ - public static synchronized ProxyConnectionManager getInstance( ) { - if (m_instance == null) { - m_instance = new ProxyConnectionManager(); - } - return m_instance; - } - - /** - * Get a connection to authenticate. - * - * @return a ldap connection handle - * - */ - public LDAPConnection getLoginConnection() { - if (_ldapLoginPool == null ) { - return null; - } - return _ldapLoginPool.getConnection(); - } - - /** - * Returns the connection (used for authentication) to the pool. - * - */ - public void releaseLoginConnection(String _loginCtx, LDAPConnection conn ) { - // Release the connection - _ldapLoginPool.close( conn ); - } - - public void releaseLoginConnection(LDAPConnection conn ) { - // Release the connection - _ldapLoginPool.close( conn ); - } - - /** - * Get connection from pool. This connection is used for - * all operations except authentication. - * - * @param the loginctx (or the authenticated token) - * @return connection that is available to use or null otherwise - */ - public LDAPConnection getConnection(String loginCtx) { - - // XXX this behaves poorly if the server goes down. - if (_ldapPool == null ) { - return null; - } - - LDAPConnection conn ; - - conn= _ldapPool.getConnection(); - - return conn; - } - - - public LDAPConnection getConnection() { - return getConnection(""); - } - - /** - * Just call the pool method to release the connection so that the - * given connection is free for others to use - * - * @param the login ctx used. - * @param conn connection in the pool to be released for others to use - */ - public void releaseConnection( String loginCtx, LDAPConnection conn ) { - // Since we return the connecton to the pool and use a - //proxy mode, loginCtx is not used. - // XXX should change function signature - - if (_ldapPool == null || conn == null) return; - - // XXX reset the original constraints after before connection is released - // conn.setSearchConstraints(_defaultSearchConstraints); - - // A soft close on the connection. - // Returns the connection to the pool and make it available. - _ldapPool.close( conn ); - } - - - public void releaseConnection( LDAPConnection conn ) { - if (_ldapPool == null || conn == null) - return; - - // reset the original constraints - //conn.setSearchConstraints(_defaultSearchConstraints); - - // A soft close on the connection. - // Returns the connection to the pool and make it available. - _ldapPool.close( conn ); - } - - - /** - * Initialize the pool shared by all. It is expected that the - * host and port (and all configuration) information has been - * initialized. - */ - private synchronized void initLdapPool(int poolMin, int poolMax) { - // Don't do anything if pool is already initialized - if (_ldapPool != null) { - logger.log(Level.FINER, "The pool is already initialized"); - return; - } - int maxBackLog = 10; - boolean referrals = false; - - try { - logger.log(Level.FINER, "Host={0}", m_host); - logger.log(Level.FINER, "Port={0}", String.valueOf(m_port) ); - logger.log(Level.FINER, "DN={0}", m_user); - logger.log(Level.FINE, "password={0}", m_password); - - _ldapPool = new ConnectionPool(poolMin, poolMax, m_host, m_port, m_user, m_password); - - logger.log(Level.FINER, "Pool initialized"); - - } catch (LDAPException lde) { - _ldapPool = null; - logger.log(Level.SEVERE, "Pool not initialized\nError Code: " + - lde.getLDAPResultCode() + "\n" + lde.getMessage() ); - - } catch (Exception ex) { - //logger.log(Level.SEVERE, "Pool init failed:{0}", ex.getMessage()); - //XXX throw new Exception("couldn't connect to ldap server"); - - } - } - - /* - * Initialize the login pool. This pool of connections is used - * for authentication. - */ - private synchronized void initLoginPool(int poolMin, int poolMax) { - if ( _ldapLoginPool != null) - return; - - LDAPConnection conn = new LDAPConnection(); - logger.log(Level.FINER, "Creating the LOGIN Pool"); - try { - conn.connect(3, m_host, m_port, m_user, m_password); - _ldapLoginPool = new ConnectionPool(poolMin, poolMax, m_host, m_port, m_user, m_password); - - } catch (LDAPException lde) { - _ldapLoginPool = null; - logger.log(Level.SEVERE, "Pool not initialized\nError Code: " + - lde.getLDAPResultCode() + "\n" + - lde.getMessage() ); - - } catch (Exception ex) { - // logger.log(Level.SEVERE, "Pool init failed:{0}", ex.getMessage()); - //XXX throw new Exception("couldn't connect to ldap server"); - _ldapLoginPool = null; - } - } - - public void shutdown() { - try { - _ldapPool.destroy(); - } catch (java.lang.NullPointerException e ) {} - try { - _ldapLoginPool.destroy(); - } catch (java.lang.NullPointerException e) {} - } - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java deleted file mode 100644 index 7dbed1a8..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java +++ /dev/null @@ -1,127 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - - -/** - * - * @author elliot - */ -public class gatewayContext { - - - /** - * Holds value of property ldapConnection. - */ - private LDAPConnection ldapConnection; - - /** - * Holds value of property constraints. - */ - private netscape.ldap.LDAPSearchConstraints constraints; - - /** - * Holds value of property rootNode. - */ - private org.w3c.dom.Node rootNode; - - /** - * Getter for property ldapConnection. - * @return Value of property ldapConnection. - */ - public LDAPConnection getLdapConnection() { - - if (this.ldapConnection == null || this.ldapConnection.isConnected() == false ) { - - IConnectionManager ldap_pool = null; - try { - ProxyConnMgrFactory pmc = new ProxyConnMgrFactory(); - ldap_pool = pmc.getInstance(); - } - catch (Exception e) { - - } - this.ldapConnection = ldap_pool.getConnection(); - } - - return this.ldapConnection; - } - - /** - * Setter for property ldapConnection. - * @param ldapConnection New value of property ldapConnection. - */ - public void setLdapConnection(LDAPConnection ldapConnection) { - // this.ldapConnection = ldapConnection; - } - - /** - * Getter for property constraints. - * @return Value of property constraints. - */ - public netscape.ldap.LDAPSearchConstraints getConstraints() { - return this.constraints; - } - - /** - * Setter for property constraints. - * @param constraints New value of property constraints. - */ - public void setConstraints(netscape.ldap.LDAPSearchConstraints constraints) { - this.constraints = constraints; - } - - /** - * Getter for property rootNode. - * @return Value of property rootNode. - */ - public org.w3c.dom.Node getRootNode() { - return this.rootNode; - } - - /** - * Setter for property rootNode. - * @param rootNode New value of property rootNode. - */ - public void setRootNode(org.w3c.dom.Node rootNode) { - this.rootNode = rootNode; - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java deleted file mode 100644 index 006bf05d..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java +++ /dev/null @@ -1,65 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ - -package com.netscape.dsml.gateway; - -public class gatewayException extends Exception { - - /** Creates a new instance of gatewayException */ - public gatewayException(String message) { - super(message); - } - - public gatewayException() { - super("LDAP Server Unavailable"); - } - - public Throwable getCause() { - Throwable retValue; - - retValue = super.getCause(); - return retValue; - } - - public String getMessage() { - String retValue; - - retValue = super.getMessage(); - return retValue; - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java deleted file mode 100644 index b20438df..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java +++ /dev/null @@ -1,256 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ - -package com.netscape.dsml.gateway; - -import java.io.*; -import java.util.Iterator; -import javax.xml.namespace.QName; -import javax.xml.parsers.*; -import javax.xml.rpc.handler.Handler; -import javax.xml.rpc.handler.HandlerInfo; -import javax.xml.rpc.handler.soap.SOAPMessageContext; -import javax.xml.soap.Name; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPHeader; -import javax.xml.soap.SOAPHeaderElement; -import javax.xml.soap.SOAPMessage; -import javax.xml.soap.SOAPPart; -import javax.xml.soap.SOAPConstants; -import javax.xml.transform.*; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import org.w3c.dom.Document; -import org.xml.sax.*; -import org.w3c.dom.*; -import javax.xml.soap.*; -import org.apache.axis.AxisFault; -import org.apache.axis.Message; -import org.apache.axis.MessageContext; -import org.apache.axis.handlers.BasicHandler; -import org.apache.commons.codec.binary.Base64; - -public class gatewayHandler extends BasicHandler { - private HandlerInfo handlerInfo; - static private javax.xml.soap.MessageFactory messageFactory ; - static private javax.xml.soap.SOAPFactory sef ; - private static boolean ready = false; - - public gatewayHandler() { - super(); - - try { - messageFactory = javax.xml.soap.MessageFactory.newInstance(); - sef = javax.xml.soap.SOAPFactory.newInstance(); - } catch (Exception e) { } - } - - - public void invoke(MessageContext context) throws AxisFault { - if (context.getPastPivot() == false) { - handleRequest(context); - } - } - - public void cleanup() { - super.cleanup(); - } - - - protected void finalize() { - new ProxyConnMgrFactory().getInstance().shutdown(); - } - - - public boolean handleRequest(MessageContext context) { - /* - * this section will set user, pwd, if it came via a http authentication header - * - */ - Configuration config = Configuration.getInstance(); - String tmp = (String)context.getProperty("Authorization"); - - String user=null ; - String pwd =null; - if ( tmp != null ) - tmp = tmp.trim(); - if ( tmp != null && tmp.startsWith("Basic ") ) { - - int i ; - Base64 bd = new Base64(); - try { - tmp = new String( (bd.decode(tmp.substring(6).getBytes() ))); - } - catch (Exception e) { - // couldn't decode auth info - } - - i = tmp.indexOf( ':' ); - if ( i == -1 ) - user = new String(tmp) ; - else - user = new String(tmp.substring( 0, i)); - - if ( i != -1 ) { - pwd= new String(tmp.substring(i+1)); - if ( pwd != null && pwd.equals("") ) pwd = null ; - - } - } - - org.apache.axis.Message out_m = null; - SOAPEnvelope out_env = null; - javax.xml.soap.SOAPBody out_body = null; - javax.xml.soap.SOAPElement out_fResponse = null; - - try { - javax.xml.soap.SOAPPart sp = ((SOAPMessageContext) context).getMessage().getSOAPPart(); - javax.xml.soap.SOAPEnvelope se = sp.getEnvelope(); - javax.xml.soap.SOAPBody sb = se.getBody(); - - out_m= new Message(context.getRequestMessage().getSOAPEnvelope()); - out_env = out_m.getSOAPPart().getEnvelope(); - out_body = out_env.getBody(); - out_fResponse = out_body.addBodyElement(out_env.createName("batchResponse")); - out_fResponse.addAttribute(out_env.createName("xmlns"), "urn:oasis:names:tc:DSML:2:0:core"); - - int authorizationCode = new com.netscape.dsml.gateway.LDAPAuthenticator(user, pwd).authenticate(); - - if (config.getUseAuth() && authorizationCode >0 ) { - out_fResponse.addChildElement("errorResponse").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), String.valueOf(authorizationCode) ); - } - else { - BatchProcessor batchProcessor = new BatchProcessor(sb); - batchProcessor.init(); - - if (config.getUseAuth()) - batchProcessor.setProxy(user); - else - batchProcessor.setProxy(""); - - boolean preprocess_successful = batchProcessor.preprocess(); - Message request= context.getRequestMessage(); - if (request != null) - { - java.util.Iterator request_elements = request.getSOAPBody().getChildElements(); - if (request_elements != null) - { - if (request_elements.hasNext()){ - ((org.apache.axis.message.RPCElement) request_elements.next()).detachNode(); - } - } - } - - - if (preprocess_successful) { - int i = -1; - int NumberRequests = batchProcessor.getRequestCount(); - - while (++i < NumberRequests && ! batchProcessor.Error()) { - batchProcessor.process(i); - SOAPElement RequestedItem = batchProcessor.getRequestItem(i); - if ( RequestedItem != null ) - out_fResponse.addChildElement( RequestedItem ); - } - } - - if ( out_fResponse.getChildElements().hasNext() == false) { - try { - /* This is slightly inaccurate. This simply checks to see if the batch is empty, and if it is, return - * something. the error isn't always 91, but hopefully it's slightly more descriptive to the end user */ - out_fResponse.addChildElement("errorResponse").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), "91" ); - } - catch (javax.xml.soap.SOAPException soapException) { } /* Not important to catch this */ - } - } - } - catch (gatewayException gwe) { - try { - out_fResponse.addChildElement("errorResponse").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), "81" ); - } - catch (javax.xml.soap.SOAPException soapException) { - /* We did our best to try and exit gracefully. Give up. */ - } - } - - catch (javax.xml.soap.SOAPException soapException) { - } - catch (Exception e) { - e.printStackTrace(); - - } - - /* To return false means do not try and continue onto the - * deployed service. Since we context.setProperty our - * SOAPResponse message, it will be sent as soon as the request - * turns the other way into a reponse. - */ - context.setResponseMessage( (Message)out_m ); - return false; - - } - - - - public boolean handleFault(MessageContext context) { - return false; - } - - public void init(HandlerInfo config) { - handlerInfo = config; - } - - public QName[] getHeaders() { - return handlerInfo.getHeaders(); - } - - public void destroy() { - - /* Bad things happen if the pool isn't shutdown before the servlet goes away */ - IConnectionManager ldap_pool = null; - ProxyConnMgrFactory pmc = new ProxyConnMgrFactory(); - try { - ldap_pool = pmc.getInstance(); - ldap_pool.shutdown(); - } - catch (Exception e) { } - - - } - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java deleted file mode 100644 index 232eaca2..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java +++ /dev/null @@ -1,73 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import javax.activation.DataHandler; - - -/** - * This is the dummy endpoint for axis. It doesn't actually do anything. The - * "real" meat is in gatewayHandler. - * @author elliot@bozemanpass.com - */ -public class gatewayService { - - - public gatewayService() { - } - - /** - * - * @param inputData - * @return - */ - public javax.activation.DataHandler process( javax.activation.DataHandler inputData) { - return inputData; - } - - /** - * - * @param inputData the javax.activation.DataHandler "attachment" of the incoming xml data - * from the SOAP client. - * @return the javax.activation.DataHandler "attachment" of the outgoing xml data - * (responses) to the SOAP client. - */ - public javax.activation.DataHandler batchRequest(javax.activation.DataHandler inputData) { - return inputData; - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java deleted file mode 100644 index afc86414..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java +++ /dev/null @@ -1,102 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.test; - - -import java.util.Properties; -import java.io.*; -import java.net.*; -import java.io.FileInputStream; -import javax.xml.transform.stream.StreamSource; -import javax.xml.soap.*; -/** - * - * @author elliot - */ -public class SOAPClient { - - private String in = null; - private String out = null; - private String SOAPUrl = null; - - public SOAPClient() { } - - public void setIn(String in) { - this.in = in; - } - - public void setOut(String out) { - this.out = out; - } - - public void setSOAPUrl(String SOAPUrl) { - this.SOAPUrl = SOAPUrl; - } - - public void go() throws Exception { - - String SOAPAction = ""; - - URL url = new URL(SOAPUrl); - URLConnection connection = url.openConnection(); - HttpURLConnection httpConn = (HttpURLConnection) connection; - - FileInputStream fin = new FileInputStream(in); - FileOutputStream fout = new FileOutputStream(out); - - SOAPMessage message = javax.xml.soap.MessageFactory.newInstance().createMessage(); - - SOAPPart soapPart = message.getSOAPPart(); - - StreamSource preppedMsgSrc = new StreamSource(new FileInputStream(in)); - - soapPart.setContent(preppedMsgSrc); - message.saveChanges(); - - SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection(); - - SOAPMessage response = con.call(message, url); - - response.writeTo(fout); - - fout.close(); - fin.close(); - con.close(); - - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java deleted file mode 100644 index c43307c9..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java +++ /dev/null @@ -1,131 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.test; - -import javax.xml.parsers.*; -import org.w3c.dom.*; -import org.w3c.dom.traversal.*; -import org.xml.sax.SAXException; -import java.io.IOException; -import java.io.File; - -public class dsmlClient { - - - public dsmlClient() { - } - - - public static void main(String[] args) { - File f = null; - - if (args.length==2) { - try { - - SOAPClient mySoapClient = new SOAPClient(); - f = File.createTempFile("TET-DSML",null); - f.deleteOnExit(); - mySoapClient.setIn( args[1] ); - mySoapClient.setOut( f.getPath() ); - - mySoapClient.setSOAPUrl( args[0] ); - // mySoapClient.setSOAPUrl("http://desktop3:8180/axis/services/dsmlgw"); - - mySoapClient.go(); } - catch (Exception e) { - e.printStackTrace(); - System.exit( 254 ); // no response or other error like it's not a dsml file - - } - - - - try { - java.io.BufferedReader in = new java.io.BufferedReader(new java.io.FileReader(f)); - String str; - while ((str = in.readLine()) != null) { - System.out.println(str); - } - in.close(); - } catch (IOException e) { - } - - try { - javax.xml.parsers.DocumentBuilder db= javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder(); - org.w3c.dom.Document doc = db.parse( f ); - - // Create the NodeIterator - DocumentTraversal traversable = (DocumentTraversal) doc; - NodeIterator iterator = traversable.createNodeIterator(doc, NodeFilter.SHOW_ALL , null, true); - - // Iterate over the comments - Node node; - while ((node = iterator.nextNode()) != null) { - if (node.getNodeName().equals("resultCode")) { - int result = Integer.parseInt(node.getAttributes().getNamedItem("code").getNodeValue()); - System.exit(result); - } else if (node.getNodeName().equals("errorResponse ")) { - int result = Integer.parseInt(node.getAttributes().getNamedItem("code").getNodeValue()); - System.exit(result); - } else if (node.getNodeName().equals("faultcode")) { - System.exit(253); - } - } - - } - catch (javax.xml.parsers.ParserConfigurationException pce ) { - pce.printStackTrace(); - System.exit( 254 ); } - catch (org.xml.sax.SAXException saxe) { - saxe.printStackTrace(); - System.exit( 254 ); } // ? - catch (java.io.IOException ioe) { - ioe.printStackTrace(); - System.exit( 254 ); } // bad url - catch (Exception e) { - e.printStackTrace(); - System.exit( 254 ); } // bad url - - } - else { - System.err.println("wrong number of arguments"); - System.err.println("usage: dsmlClient soap-url dsml-file"); - System.exit(255); // wrong arguments - } - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java deleted file mode 100644 index 15d336f8..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java +++ /dev/null @@ -1,91 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.test; - -import javax.xml.parsers.*; -import org.w3c.dom.*; -import org.w3c.dom.traversal.*; -import org.xml.sax.SAXException; -import java.io.IOException; -import java.io.File; -import java.io.BufferedReader; -import java.io.FileReader; - -public class dsmlSearch { - - public static void main(String[] args) { - File f = null; - - if (args.length==2) { - try { - - SOAPClient mySoapClient = new SOAPClient(); - f = File.createTempFile("TET-DSML",null); - f.deleteOnExit(); - mySoapClient.setIn( args[1] ); - mySoapClient.setOut( f.getPath() ); - - mySoapClient.setSOAPUrl( args[0] ); - - mySoapClient.go(); } - catch (Exception e) { - e.printStackTrace(); - System.exit( 254 ); // no response or other error like it's not a dsml file - - } - - try { - BufferedReader in = new BufferedReader(new FileReader( f.getPath() )); - String str; - while (( str = in.readLine()) != null) { - - System.out.println(str); } - in.close(); } - catch (IOException e) { - e.printStackTrace(); - System.exit( 254 ); - } - - } - else { - System.err.println("wrong number of arguments"); - System.err.println("usage: dsmlSearch soap-url dsml-file"); - System.exit(255); // wrong arguments - } - } - -} |