pax_global_header00006660000000000000000000000064152552516060014521gustar00rootroot0000000000000052 comment=07ff47facb55193c778be3f65d92ab404f880575 apache-directory-ldap-api-cfb3cee/000077500000000000000000000000001525525160600172655ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/.asf.yaml000066400000000000000000000021051525525160600207760ustar00rootroot00000000000000# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. github: rulesets: - name: "Default Branch Protection" type: branch branches: includes: - "~DEFAULT_BRANCH" - "release/*" - "rel/*" excludes: [] bypass_teams: - root restrict_deletion: true restrict_force_push: true apache-directory-ldap-api-cfb3cee/.github/000077500000000000000000000000001525525160600206255ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/.github/dependabot.yml000066400000000000000000000020371525525160600234570ustar00rootroot00000000000000# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. version: 2 updates: - package-ecosystem: "maven" directory: "/" schedule: interval: "daily" cooldown: default-days: 5 - package-ecosystem: github-actions directory: / schedule: interval: weekly cooldown: default-days: 5 apache-directory-ldap-api-cfb3cee/.github/workflows/000077500000000000000000000000001525525160600226625ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/.github/workflows/codeql-analysis.yml000066400000000000000000000100401525525160600264700ustar00rootroot00000000000000# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # # You may wish to alter this file to override the set of languages analyzed, # or to provide custom queries or build logic. # # ******** NOTE ******** # We have attempted to detect the languages in your repository. Please check # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # name: "CodeQL" on: push: branches: [ "master" ] pull_request: # The branches below must be a subset of the branches above branches: [ "master" ] schedule: - cron: '20 5 * * 3' permissions: contents: read jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: [ 'java' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Use only 'java' to analyze code written in Java, Kotlin or both # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality - name: Set up Java 21 uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: java-version: '21' distribution: 'temurin' # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9 # â„šī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun # If the Autobuild fails above, remove it and uncomment the following three lines. # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. # - run: | # echo "Run, Build Application using script" # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9 with: category: "/language:${{matrix.language}}" apache-directory-ldap-api-cfb3cee/.github/workflows/pull-request-build.yaml000066400000000000000000000012121525525160600273010ustar00rootroot00000000000000name: "Build and Test" on: pull_request: branches: ['master'] permissions: contents: read jobs: build-java-21: runs-on: ubuntu-latest permissions: contents: read pull-requests: read timeout-minutes: 130 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up JDK 21 uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: java-version: '21' distribution: 'temurin' cache: maven - name: Build with Apache Maven run: mvn -U clean install -Djava.awt.headless=true -fae -B apache-directory-ldap-api-cfb3cee/.github/workflows/scorecards.yml000066400000000000000000000061321525525160600255370ustar00rootroot00000000000000# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. name: Scorecards supply-chain security on: # Only the default branch is supported. branch_protection_rule: schedule: - cron: '43 19 * * 1' push: branches: [ "master" ] # Declare default permissions as read only. permissions: read-all jobs: analysis: name: Scorecards analysis runs-on: ubuntu-latest permissions: # Needed to upload the results to code-scanning dashboard. security-events: write # Used to receive a badge. id-token: write # Needs for private repositories. contents: read actions: read steps: - name: "Checkout code" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # tag=v3.0.0 with: persist-credentials: false - name: "Run analysis" uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4 with: results_file: results.sarif results_format: sarif # (Optional) Read-only PAT token. Uncomment the `repo_token` line below if: # - you want to enable the Branch-Protection check on a *public* repository, or # - you are installing Scorecards on a *private* repository # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. # repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} # Publish the results for public repositories to enable scorecard badges. For more details, see # https://github.com/ossf/scorecard-action#publishing-results. # For private repositories, `publish_results` will automatically be set to `false`, regardless # of the value entered here. publish_results: true # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # tag=v7.0.1 with: name: SARIF file path: results.sarif retention-days: 5 # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" uses: github/codeql-action/upload-sarif@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9 with: sarif_file: results.sarif apache-directory-ldap-api-cfb3cee/.gitignore000066400000000000000000000003041525525160600212520ustar00rootroot00000000000000target maven-eclipse.xml lib .externalToolBuilders felix-cache .project .classpath .settings eclipse-classes *.log *.iml *.ipr bin dependency-reduced-pom.xml META-INF # intellij idea folder .idea apache-directory-ldap-api-cfb3cee/AGENTS.md000066400000000000000000000011261525525160600205700ustar00rootroot00000000000000 # Agent Guide for directory-ldap-api ## Security Security model: [SECURITY.md](./SECURITY.md) -> the Apache Directory umbrella threat model at https://github.com/apache/directory-server/blob/master/THREAT_MODEL.md This repository is the LDAP protocol API and ASN.1/BER codec library. Agents scanning it should consult the umbrella threat model (LDAP codec addendum) before reporting issues. apache-directory-ldap-api-cfb3cee/Jenkinsfile000066400000000000000000000063471525525160600214630ustar00rootroot00000000000000/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ pipeline { agent any tools { maven 'maven_3_latest' jdk params.jdkVersion } options { // Configure an overall timeout for the build of ten hours. timeout(time: 20, unit: 'HOURS') // When we have test-fails e.g. we don't need to run the remaining steps buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5')) } parameters { choice(name: 'nodeLabel', choices: ['ubuntu', 'arm', 'Windows']) choice(name: 'jdkVersion', choices: ['jdk_11_latest', 'jdk_17_latest', 'jdk_21_latest', 'jdk_25_latest', 'jdk_26_latest', 'jdk_11_latest_windows', 'jdk_17_latest_windows', 'jdk_21_latest_windows', 'jdk_25_latest_windows']) booleanParam(name: 'deployEnabled', defaultValue: true) booleanParam(name: 'sonarEnabled', defaultValue: true) booleanParam(name: 'testsEnabled', defaultValue: true) } triggers { cron('@weekly') pollSCM('@daily') } stages { stage('Initialization') { steps { echo "running on ${env.NODE_NAME}" echo 'Building branch ' + env.BRANCH_NAME echo 'Using PATH ' + env.PATH } } stage('Cleanup') { steps { echo 'Cleaning up the workspace' deleteDir() } } stage('Checkout') { steps { echo 'Checking out branch ' + env.BRANCH_NAME checkout scm } } /* Commented Java 17, it fails with chekstyle */ /* stage('Build JDK 17 Linux') { tools { jdk "jdk_17_latest" } steps { echo 'Building JDK 17 Linux' sh 'java -version' sh 'mvn -version' sh 'mvn clean install' } } */ stage('Build JDK 21 Linux') { tools { jdk "jdk_21_latest" } steps { echo 'Building JDK 21 Linux' sh 'java -version' sh 'mvn -version' sh 'mvn clean install -Pserial -Djava.security.manager=allow' } } stage('Build JDK 25 Linux') { tools { jdk "jdk_25_latest" } steps { echo 'Building JDK 25 Linux' sh 'java -version' sh 'mvn -version' sh 'mvn clean install -Pserial -Djava.security.manager=allow' } } stage('Build JDK 26 Linux') { tools { jdk "jdk_26_latest" } steps { echo 'Building JDK 26 Linux' sh 'java -version' sh 'mvn -version' sh 'mvn clean install -Pserial -Djava.security.manager=allow' } } } } apache-directory-ldap-api-cfb3cee/Jenkinsfile.old000066400000000000000000000112101525525160600222210ustar00rootroot00000000000000/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ pipeline { agent none options { buildDiscarder(logRotator(numToKeepStr: '10')) timeout(time: 8, unit: 'HOURS') } triggers { cron('@weekly') pollSCM('@daily') } stages { stage ('Debug') { options { timeout(time: 1, unit: 'HOURS') retry(2) } agent { docker { label 'ubuntu' image 'apachedirectory/maven-build:jdk-11' alwaysPull true args '-v $HOME/.m2:/home/hnelson/.m2' } } steps { sh 'env' } post { always { deleteDir() } } } stage ('Build and Test') { parallel { /* stage ('Linux Java 11') { options { timeout(time: 4, unit: 'HOURS') retry(2) } agent { docker { label 'ubuntu' image 'apachedirectory/maven-build:jdk-11' alwaysPull true args '-v $HOME/.m2:/home/hnelson/.m2' } } steps { sh 'mvn -U -V clean verify' } post { always { junit '**/target/surefire-reports/*.xml' deleteDir() } } } stage ('Linux Java 17') { options { timeout(time: 4, unit: 'HOURS') retry(2) } agent { docker { label 'ubuntu' image 'apachedirectory/maven-build:jdk-17' alwaysPull true args '-v $HOME/.m2:/home/hnelson/.m2' } } steps { sh 'mvn -U -V clean verify' } post { always { deleteDir() } } }*/ stage ('Linux Java 21') { options { timeout(time: 4, unit: 'HOURS') retry(2) } agent { docker { label 'ubuntu' image 'apachedirectory/maven-build:jdk-21' alwaysPull true args '-v $HOME/.m2:/home/hnelson/.m2' } } steps { sh 'mvn -U -V clean verify' } post { always { deleteDir() } } }/* stage ('Windows Java 11') { options { timeout(time: 4, unit: 'HOURS') retry(2) } agent { label 'Windows' } steps { bat ''' set JAVA_HOME=F:\\jenkins\\tools\\java\\latest11 set MAVEN_OPTS="-Xmx512m" F:\\jenkins\\tools\\maven\\latest3\\bin\\mvn -U -V clean verify ''' } post { always { deleteDir() } } } */ } } stage ('Deploy') { options { timeout(time: 2, unit: 'HOURS') retry(2) } agent { label 'ubuntu && !H28 && !H36 && !H40' } // https://cwiki.apache.org/confluence/display/INFRA/JDK+Installation+Matrix // https://cwiki.apache.org/confluence/display/INFRA/Maven+Installation+Matrix steps { sh ''' export JAVA_HOME=/home/jenkins/tools/java/latest1.8 export MAVEN_OPTS="-Xmx512m" /home/jenkins/tools/maven/latest3/bin/mvn -U -V clean deploy -DskipTests ''' } post { always { deleteDir() } } } } post { failure { mail to: 'notifications@directory.apache.org', subject: "Jenkins pipeline failed: ${currentBuild.fullDisplayName}", body: "Jenkins build URL: ${env.BUILD_URL}" } fixed { mail to: 'notifications@directory.apache.org', subject: "Jenkins pipeline fixed: ${currentBuild.fullDisplayName}", body: "Jenkins build URL: ${env.BUILD_URL}" } } } apache-directory-ldap-api-cfb3cee/LICENSE000066400000000000000000000447021525525160600203010ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================================================================== slf4j 1.7.25 license: -------------------------------------------------------------------------------------------------- Copyright (c) 2004-2017 QOS.ch All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================================================================== jBCrypt 0.4.1 license -------------------------------------------------------------------------------------------------- jBCrypt is subject to the following license: /* * Copyright (c) 2006 Damien Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ ================================================================================================== LDAP Schema files -------------------------------------------------------------------------------------------------- ## Portions Copyright (C) The Internet Society (1997-2003). ## All Rights Reserved. ## ## This document and translations of it may be copied and furnished to ## others, and derivative works that comment on or otherwise explain it ## or assist in its implementation may be prepared, copied, published ## and distributed, in whole or in part, without restriction of any ## kind, provided that the above copyright notice and this paragraph are ## included on all such copies and derivative works. However, this ## document itself may not be modified in any way, such as by removing ## the copyright notice or references to the Internet Society or other ## Internet organizations, except as needed for the purpose of ## developing Internet standards in which case the procedures for ## copyrights defined in the Internet Standards process must be ## followed, or as required to translate it into languages other than ## English. ## ## The limited permissions granted above are perpetual and will not be ## revoked by the Internet Society or its successors or assigns. ## ## This document and the information contained herein is provided on an ## "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING ## TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ## BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION ## HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF ## MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ---------------------------------------------------------------- The OpenLDAP Public License Version 2.8, 17 August 2003 Redistribution and use of this software and associated documentation ("Software"), with or without modification, are permitted provided that the following conditions are met: 1. Redistributions in source form must retain copyright statements and notices, 2. Redistributions in binary form must reproduce applicable copyright statements and notices, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution, and 3. Redistributions must contain a verbatim copy of this document. The OpenLDAP Foundation may revise this license from time to time. Each revision is distinguished by a version number. You may use this Software under terms of this license revision or under the terms of any subsequent revision of the license. THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S) OR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The names of the authors and copyright holders must not be used in advertising or otherwise to promote the sale, use or other dealing in this Software without specific, written prior permission. Title to copyright in this Software shall at all times remain with copyright holders. OpenLDAP is a registered trademark of the OpenLDAP Foundation. Copyright 1999-2003 The OpenLDAP Foundation, Redwood City, California, USA. All Rights Reserved. Permission to copy and distribute verbatim copies of this document is granted. ========================================================================== ANTLR 2 License -------------------------------------------------------------------------- We reserve no legal rights to the ANTLR--it is fully in the public domain. An individual or company may do whatever they wish with source code distributed with ANTLR or the code generated by ANTLR, including the incorporation of ANTLR, or its output, into commerical software. We encourage users to develop software with ANTLR. However, we do ask that credit is given to us for developing ANTLR. By "credit", we mean that if you use ANTLR or incorporate any source code into one of your programs (commercial product, research project, or otherwise) that you acknowledge this fact somewhere in the documentation, research report, etc... If you like ANTLR and have developed a nice tool with the output, please mention that you developed it using ANTLR. In addition, we ask that the headers remain intact in our source code. As long as these guidelines are kept, we expect to continue enhancing this system and expect to make other tools available as they are completed. apache-directory-ldap-api-cfb3cee/NOTICE000066400000000000000000000002651525525160600201740ustar00rootroot00000000000000Apache Directory LDAP API Copyright 2003-2026 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (https://www.apache.org/). apache-directory-ldap-api-cfb3cee/README.md000077500000000000000000000055441525525160600205570ustar00rootroot00000000000000 [![Maven Central](https://maven-badges.sml.io/maven-central/org.apache.directory.api/api-parent/badge.svg)](https://maven-badges.sml.io/maven-central/org.apache.directory.api/api-parent) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/apache/directory-ldap-api/badge)](https://api.securityscorecards.dev/projects/github.com/apache/directory-ldap-api) Apache Directory LDAP API ========================= The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API). This is a "schema aware" API with some convenient ways to access all types of LDAP servers, not only ApacheDS but any LDAP server. The API is OSGI ready and extensible. New controls, schema elements and network layer could be added or used in the near future. https://directory.apache.org/api/ Export Notice ========================== This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See for more information. The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code. The following provides more details on the included cryptographic software: https://www.bouncycastle.org/ apache-directory-ldap-api-cfb3cee/SECURITY.md000066400000000000000000000024771525525160600210700ustar00rootroot00000000000000 # Security Policy ## Reporting a Vulnerability Apache Directory follows the [ASF security process](https://www.apache.org/security/). Report privately to `security@apache.org` (PMC: `private@directory.apache.org`); do not open public issues/PRs for security reports. ## Threat Model `apache/directory-ldap-api` is the LDAP protocol API and ASN.1/BER codec library within the Apache Directory project. Its security context is covered by the Apache Directory umbrella threat model (LDAP codec addendum): https://github.com/apache/directory-server/blob/master/THREAT_MODEL.md apache-directory-ldap-api-cfb3cee/all/000077500000000000000000000000001525525160600200355ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/all/.gitignore000066400000000000000000000002501525525160600220220ustar00rootroot00000000000000target maven-eclipse.xml lib .externalToolBuilders felix-cache .project .classpath .settings eclipse-classes *.log *.iml *.ipr bin dependency-reduced-pom.xml META-INF apache-directory-ldap-api-cfb3cee/all/pom.xml000066400000000000000000000114531525525160600213560ustar00rootroot00000000000000 4.0.0 org.apache.directory.api api-parent 2.1.9 api-all Apache Directory API All ${project.groupId} api-asn1-api ${project.groupId} api-asn1-ber ${project.groupId} api-dsml-engine ${project.groupId} api-dsml-parser ${project.groupId} api-i18n ${project.groupId} api-ldap-client-api ${project.groupId} api-ldap-codec-core ${project.groupId} api-ldap-codec-standalone ${project.groupId} api-ldap-extras-aci ${project.groupId} api-ldap-extras-codec ${project.groupId} api-ldap-extras-codec-api ${project.groupId} api-ldap-extras-sp ${project.groupId} api-ldap-extras-trigger ${project.groupId} api-ldap-extras-util ${project.groupId} api-ldap-model ${project.groupId} api-ldap-net-mina ${project.groupId} api-ldap-schema-converter ${project.groupId} api-ldap-schema-data ${project.groupId} api-util org.apache.maven.plugins maven-shade-plugin package shade ${project.groupId} true true org.apache.directory.ldap.api.all apache-directory-ldap-api-cfb3cee/all/src/000077500000000000000000000000001525525160600206245ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/all/src/main/000077500000000000000000000000001525525160600215505ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/all/src/main/appended-resources/000077500000000000000000000000001525525160600253405ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/all/src/main/appended-resources/META-INF/000077500000000000000000000000001525525160600265005ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/all/src/main/appended-resources/META-INF/LICENSE000066400000000000000000000021261525525160600275060ustar00rootroot00000000000000-------------------------------------------------------------- ANTLR 2 License ANTLR 2 License We reserve no legal rights to the ANTLR--it is fully in the public domain. An individual or company may do whatever they wish with source code distributed with ANTLR or the code generated by ANTLR, including the incorporation of ANTLR, or its output, into commerical software. We encourage users to develop software with ANTLR. However, we do ask that credit is given to us for developing ANTLR. By "credit", we mean that if you use ANTLR or incorporate any source code into one of your programs (commercial product, research project, or otherwise) that you acknowledge this fact somewhere in the documentation, research report, etc... If you like ANTLR and have developed a nice tool with the output, please mention that you developed it using ANTLR. In addition, we ask that the headers remain intact in our source code. As long as these guidelines are kept, we expect to continue enhancing this system and expect to make other tools available as they are completed. apache-directory-ldap-api-cfb3cee/all/src/main/appended-resources/META-INF/NOTICE000066400000000000000000000000651525525160600274050ustar00rootroot00000000000000 This software includes code generated by ANTLR 2. apache-directory-ldap-api-cfb3cee/asn1/000077500000000000000000000000001525525160600201275ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/.gitignore000066400000000000000000000002501525525160600221140ustar00rootroot00000000000000target maven-eclipse.xml lib .externalToolBuilders felix-cache .project .classpath .settings eclipse-classes *.log *.iml *.ipr bin dependency-reduced-pom.xml META-INF apache-directory-ldap-api-cfb3cee/asn1/api/000077500000000000000000000000001525525160600207005ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/.gitignore000066400000000000000000000002501525525160600226650ustar00rootroot00000000000000target maven-eclipse.xml lib .externalToolBuilders felix-cache .project .classpath .settings eclipse-classes *.log *.iml *.ipr bin dependency-reduced-pom.xml META-INF apache-directory-ldap-api-cfb3cee/asn1/api/pom.xml000066400000000000000000000057011525525160600222200ustar00rootroot00000000000000 4.0.0 org.apache.directory.api api-asn1-parent 2.1.9 api-asn1-api Apache Directory API ASN.1 API bundle ASN.1 API org.junit.jupiter junit-jupiter-engine test ${project.groupId} api-i18n org.apache.maven.plugins maven-jar-plugin META-INF/MANIFEST.MF false org.apache.felix maven-bundle-plugin true true META-INF ${project.groupId}.asn1.api org.apache.directory.api.asn1;version=${project.version};-noimport:=true, org.apache.directory.api.asn1.util;version=${project.version};-noimport:=true org.apache.directory.api.i18n;version=${project.version} apache.directory.ldap.api.asn1.api apache-directory-ldap-api-cfb3cee/asn1/api/src/000077500000000000000000000000001525525160600214675ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/000077500000000000000000000000001525525160600224135ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/000077500000000000000000000000001525525160600233345ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/000077500000000000000000000000001525525160600241235ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/000077500000000000000000000000001525525160600253445ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/000077500000000000000000000000001525525160600273505ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/000077500000000000000000000000001525525160600301215ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/000077500000000000000000000000001525525160600307635ustar00rootroot00000000000000Asn1Object.java000066400000000000000000000027701525525160600335060ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1; import java.nio.ByteBuffer; /** * An abstract class which implements basic TLV operations. * * @author Apache Directory Project */ public interface Asn1Object { /** * Compute the object length, which is the sum of all inner length. * * @return The object's computed length */ int computeLength(); /** * Encode the object to a PDU. * * @param buffer The buffer where to put the PDU * @return The encoded PDU. * @throws EncoderException if the buffer can't be encoded */ ByteBuffer encode( ByteBuffer buffer ) throws EncoderException; } apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/Decoder.java000077500000000000000000000041321525525160600331760ustar00rootroot00000000000000/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1; /** *

* Provides the highest level of abstraction for Decoders. This is the sister * interface of {@link Encoder}. All Decoders implement this common generic * interface. *

*

* Allows a user to pass a generic Object to any Decoder implementation in the * codec package. *

*

* One of the two interfaces at the center of the codec package. *

* * @author Apache Directory Project */ public interface Decoder { /** * Decodes an "encoded" Object and returns a "decoded" Object. Note that the * implementation of this interface will try to cast the Object parameter to * the specific type expected by a particular Decoder implementation. If a * {@link java.lang.ClassCastException} occurs this decode method will throw * a DecoderException. * * @param object an object to "decode" * @return a 'decoded" object * @throws DecoderException a decoder exception can be thrown for any number of reasons. * Some good candidates are that the parameter passed to this method is null, a param * cannot be cast to the appropriate type for a specific encoder. */ Object decode( Object object ) throws DecoderException; } DecoderException.java000077500000000000000000000032141525525160600347760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1; /** * Thrown when a Decoder has encountered a failure condition during a decode. * * @author Apache Directory Project */ public class DecoderException extends Exception { /** Declares the Serial Version Uid */ private static final long serialVersionUID = 1L; /** * Creates a DecoderException * * @param message A message with meaning to a human */ public DecoderException( String message ) { super( message ); } /** * Creates a DecoderException * * @param message A message with meaning to a human * @param cause The Exception which caused the error */ public DecoderException( String message, Throwable cause ) { super( message, cause ); } } apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/Encoder.java000066400000000000000000000034101525525160600332030ustar00rootroot00000000000000/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1; /** *

* Provides the highest level of abstraction for Encoders. This is the sister * interface of {@link Decoder}. Every * implementation of Encoder provides this common generic interface whic allows * a user to pass a generic Object to any Encoder implementation in the codec * package. *

* * @author Apache Directory Project */ public interface Encoder { /** * Encodes an "Object" and returns the encoded content as an Object. The * Objects here may just be byte[] or Strings * depending on the implementation used. * * @param object An object to encode * @return An "encoded" Object * @throws EncoderException an encoder exception is thrown if the encoder experiences a * failure condition during the encoding process. */ Object encode( Object object ) throws EncoderException; } EncoderException.java000077500000000000000000000036531525525160600350170ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1; /** * Thrown when there is a failure condition during the encoding process. This * exception is thrown when an Encoder encounters a encoding specific exception * such as invalid data, inability to calculate a checksum, characters outside * of the expected range. * * @author Apache Directory Project */ public class EncoderException extends Exception { /** Declares the Serial Version Uid */ private static final long serialVersionUID = 1L; /** * Creates a new instance of this exception with an useful message. * * @param message a useful message relating to the encoder specific error. */ public EncoderException( String message ) { super( message ); } /** * Creates a new instance of this exception with an useful message. * * @param message a useful message relating to the encoder specific error. * @param cause The parent exception */ public EncoderException( String message, Exception cause ) { super( message, cause ); } } apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/package.html000066400000000000000000000026611525525160600332510ustar00rootroot00000000000000 ASN.1 package Provides the fundamental stateful codec interfaces.

Package Specification

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see: apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/util/000077500000000000000000000000001525525160600317405ustar00rootroot00000000000000Asn1Buffer.java000066400000000000000000000103171525525160600344620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/util/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.util; import java.nio.ByteBuffer; /** * A buffer used to store an encoding PDU. It's auto-extended, and * filled by the end. * * @author Apache Directory Project */ public class Asn1Buffer { /** The buffer default size */ private static final int DEFAULT_SIZE = 1024; /** The current position in the buffer */ private int pos = 0; /** A buffer to store the encoded PDU */ private byte[] buffer; /** * Creates a new Asn1Buffer instance */ public Asn1Buffer() { buffer = new byte[DEFAULT_SIZE]; } /** * Get the current position in the buffer * * @return The current position in the buffer */ public int getPos() { return pos; } /** * Set the current position in the buffer * * @param pos The position to move the buffer to */ public void setPos( int pos ) { this.pos = pos; } /** * Store a byte at the current position in the buffer * * @param b The byte to store */ public void put( byte b ) { if ( pos == buffer.length ) { // The buffer needs to be reallocated, its too small extend( 1 ); } pos++; buffer[buffer.length - pos] = b; } /** * Store some bytes at the current position in the buffer * * @param bytes The bytes to store */ public void put( byte[] bytes ) { if ( pos + bytes.length > buffer.length ) { // The buffer needs to be reallocated, its too small extend( bytes.length ); } pos += bytes.length; System.arraycopy( bytes, 0, buffer, buffer.length - pos, bytes.length ); } /** * Extend the buffer * * @param size The new buffer size */ private void extend( int size ) { // The buffer needs to be reallocated, it's too small int newSize = ( ( size + buffer.length ) / DEFAULT_SIZE ) * DEFAULT_SIZE; if ( size % DEFAULT_SIZE != 0 ) { newSize += DEFAULT_SIZE; } byte[] newBuffer = new byte[newSize]; System.arraycopy( buffer, 0, newBuffer, newSize - buffer.length, buffer.length ); buffer = newBuffer; } /** * Get the interned bytes * * @return The stored encoded PDU. */ public ByteBuffer getBytes() { ByteBuffer result = ByteBuffer.allocate( pos ); result.put( buffer, buffer.length - pos, pos ); result.flip(); return result; } /** * Get the buffer size * * @return The buffer size (ie the maximum number of bytes that can be * added to this bffder before it gets extended). */ public int getSize() { return buffer.length; } /** * Clear the position, emptying the buffer. If it has grown, reallocate it * to its initial size. */ public void clear() { if ( buffer.length > DEFAULT_SIZE ) { buffer = new byte[DEFAULT_SIZE]; } pos = 0; } /** * {@inheritDoc} */ @Override public String toString() { return "[" + buffer.length + ", " + pos + "] '" + Asn1StringUtils.dumpBytes( buffer, buffer.length - pos, pos ) + '\''; } } Asn1Buffer2.java000066400000000000000000000127301525525160600345450ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/util/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.util; /** * A buffer used to store an encoding PDU. It's auto-extended, and * filled by the end. * * @author Apache Directory Project */ public class Asn1Buffer2 { /** The buffer default size */ private static final int DEFAULT_SIZE = 1024; /** The current position in the buffer */ private int pos = 0; /** The current size */ private int size = DEFAULT_SIZE; /** The internal buffer storage */ private final class InternalBuffer { /** * private constructor */ InternalBuffer() { // Nothing to do } /** A buffer to store the encoded PDU */ private byte[] buffer = new byte[DEFAULT_SIZE]; /** The next buffer, if any */ private InternalBuffer next; } /** The current internal buffer */ private InternalBuffer currentBuffer; /** * Create a new instance of Asn1Buffer2 */ public Asn1Buffer2() { currentBuffer = new InternalBuffer(); } /** * Get the current position in the buffer * * @return The current position in the buffer */ public int getPos() { return pos; } /** * Store a byte at the current position in the buffer * * @param b The byte to store */ public void put( byte b ) { if ( pos == size ) { // The buffer needs to be reallocated, its too small extend(); } currentBuffer.buffer[size - pos - 1] = b; pos++; } /** * Store some bytes at the current position in the buffer * * @param bytes The bytes to store */ public void put( byte[] bytes ) { int dataLength = bytes.length; while ( true ) { int room = size - pos; if ( dataLength > room ) { // First fulfill the current buffer System.arraycopy( bytes, dataLength - room, currentBuffer, 0, room ); dataLength -= room; pos += room; extend(); } else { // Last bytes are copied in the current buffer System.arraycopy( bytes, 0, currentBuffer, room - dataLength, dataLength ); pos += dataLength; break; } } } /** * Extend the buffer */ private void extend() { InternalBuffer newCurrentBuffer = new InternalBuffer(); newCurrentBuffer.next = currentBuffer; currentBuffer = newCurrentBuffer; size += DEFAULT_SIZE; } /** * Get the interned bytes * * @return The stored encoded PDU. */ public byte[] getBytes() { byte[] result = new byte[pos]; InternalBuffer bufferPtr = currentBuffer; int currentPos = 0; int dataPos = size - pos; int dataLength = DEFAULT_SIZE - dataPos; while ( bufferPtr.next != null ) { System.arraycopy( bufferPtr, dataPos, result, currentPos, dataLength ); currentPos += dataLength; dataPos = 0; dataLength = DEFAULT_SIZE; } return result; } /** * Get the buffer size * * @return The buffer size (ie the maximum number of bytes that can be * added to this buffer before it gets extended). */ public int getSize() { return size; } /** * Clear the position, emptying the buffer. If it has grown, reallocate it * to its initial size. */ public void clear() { pos = 0; size = DEFAULT_SIZE; // Un-reference the extended buffer. They will be garbage collected. while ( currentBuffer.next != null ) { currentBuffer = currentBuffer.next; } } /** * {@inheritDoc} */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( "[" ).append( size ).append( ", " ).append( pos ).append( "] )" ); InternalBuffer bufferPtr = currentBuffer; while ( bufferPtr.next != null ) { sb.append( "\n " ).append( Asn1StringUtils.dumpBytes( bufferPtr.buffer ) ); } return sb.toString(); } } Asn1StringUtils.java000066400000000000000000000103141525525160600355350ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/util/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.util; import java.nio.charset.StandardCharsets; /** * Little helper class for the asn1 package. * * @author Apache Directory Project */ public final class Asn1StringUtils { /** Hex chars */ private static final byte[] HEX_CHAR = new byte[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; /** * The empty byte[] */ public static final byte[] EMPTY_BYTES = new byte[] {}; /** * Private constructor */ private Asn1StringUtils() { // Nothing to do } /** * Helper function that dump a byte in hex form * * @param octet The byte to dump * @return A string representation of the byte */ public static String dumpByte( byte octet ) { return new String( new byte[] { '0', 'x', HEX_CHAR[( octet & 0x00F0 ) >> 4], HEX_CHAR[octet & 0x000F] }, StandardCharsets.UTF_8 ); } /** * Helper function that dump an array of bytes in hex form * * @param buffer The bytes array to dump * @return A string representation of the array of bytes */ public static String dumpBytes( byte[] buffer ) { if ( buffer == null ) { return ""; } StringBuilder sb = new StringBuilder(); for ( byte b : buffer ) { sb.append( "0x" ).append( ( char ) ( HEX_CHAR[( b & 0x00F0 ) >> 4] ) ).append( ( char ) ( HEX_CHAR[b & 0x000F] ) ).append( " " ); } return sb.toString(); } /** * Helper function that dump an array of bytes in hex form * * @param buffer The bytes array to dump * @param start The starting point in the buffer * @param length The number of bytes to print * @return A string representation of the array of bytes */ public static String dumpBytes( byte[] buffer, int start, int length ) { if ( buffer == null ) { return ""; } StringBuilder sb = new StringBuilder(); for ( int i = start; i < start + length; i++ ) { byte b = buffer[i]; sb.append( "0x" ).append( ( char ) ( HEX_CHAR[( b & 0x00F0 ) >> 4] ) ).append( ( char ) ( HEX_CHAR[b & 0x000F] ) ).append( " " ); } return sb.toString(); } /** * Return UTF-8 encoded byte[] representation of a String * * @param string The string to be transformed to a byte array * @return The transformed byte array */ public static byte[] getBytesUtf8( String string ) { if ( string == null ) { return EMPTY_BYTES; } return string.getBytes( StandardCharsets.UTF_8 ); } /** * Transform a string to an array of ASCII bytes, where the byte array will contain * only values in [0, 127]. * * @param string The byte array to transform * @return The resulting string */ public static byte[] asciiStringToByte( String string ) { if ( ( string == null ) || ( string.length() == 0 ) ) { return EMPTY_BYTES; } byte[] result = new byte[string.length()]; for ( int i = 0; i < result.length; i++ ) { result[i] = ( byte ) string.charAt( i ); } return result; } } BitString.java000066400000000000000000000157421525525160600344420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/util/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.util; import org.apache.directory.api.i18n.I18n; /** * Implement the Bit String primitive type. A BitString is internally stored as * an array of byte. * * @author Apache Directory Project */ public class BitString { /** A null MutableString */ public static final BitString EMPTY_STRING = new BitString( 1 ); /** The number of unused bits in the last byte */ private int nbUnusedBits; /** The string is stored in a byte array */ private byte[] bytes; /** Actual length of the byte array */ private int nbBytes; /** Actual length of the bit string */ private int nbBits; /** * Creates a BitString with a specific length (length is the number of * bits). * * @param length The BitString length (it's a number of bits) */ public BitString( int length ) { if ( length <= 0 ) { // This is not allowed throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_00000_NULL_OR_NEG_LENGTH_NOT_ALLOWED ) ); } nbBits = length; // As we store values in bytes, we must divide the length by 8 nbBytes = length / 8; if ( ( length % 8 ) != 0 ) { nbBytes += 1; } nbUnusedBits = ( 8 - ( length % 8 ) ) & 0x07; bytes = new byte[nbBytes]; } /** * Creates a BitString from a byte[]. As the first byte is the number of unused bits * in the last byte, we have to ignore it. * * @param bytes The value to store. The first byte contains the number of * unused bits */ public BitString( byte[] bytes ) { if ( ( bytes == null ) || ( bytes.length == 0 ) ) { nbBits = -1; return; } setData( bytes ); } /** * Set a new BitString in the BitString. It will replace the old BitString, * and reset the current length with the new one. * * @param data The string to store */ public void setData( byte[] data ) { if ( ( data == null ) || ( data.length == 0 ) ) { nbBits = -1; return; } // The first byte contains the number of unused bits nbUnusedBits = data[0] & 0x07; nbBytes = data.length - 1; nbBits = ( nbBytes * 8 ) - nbUnusedBits; this.bytes = new byte[nbBytes]; // We have to transfer the data for ( int i = 0; i < nbBytes; i++ ) { this.bytes[i] = data[i + 1]; } } /** * Get the representation of a BitString. A first byte containing the number * of unused bits is added * * @return A byte array which represent the BitString */ public byte[] getData() { byte[] copy = new byte[bytes.length + 1]; System.arraycopy( bytes, 0, copy, 1, bytes.length ); copy[0] = ( byte ) nbUnusedBits; return copy; } /** * Get the number of unused bits * * @return A byte which represent the number of unused bits */ public byte getUnusedBits() { return ( byte ) nbUnusedBits; } /** * Set a bit at a specified position. * The bits are stored from left to right. * For instance, if we have 10 bits, then they are coded as b0 b1 b2 b3 b4 b5 b6 b7 - b8 b9 x x x x x x * * @param pos The bit to set */ public void setBit( int pos ) { if ( ( pos < 0 ) || ( pos > nbBits ) ) { throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_00001_BIT_NUMBER_OUT_OF_BOUND ) ); } int posBytes = pos >>> 3; int bitNumber = 7 - pos % 8; byte mask = ( byte ) ( 1 << bitNumber ); bytes[posBytes] |= mask; } /** * Clear a bit at a specified position. * The bits are stored from left to right. * For instance, if we have 10 bits, then they are coded * as b0 b1 b2 b3 b4 b5 b6 b7 - b8 b9 x x x x x x * * @param pos The bit to clear */ public void clearBit( int pos ) { if ( ( pos < 0 ) || ( pos > nbBits ) ) { throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_00001_BIT_NUMBER_OUT_OF_BOUND ) ); } int posBytes = pos >>> 3; int bitNumber = 7 - pos % 8; byte mask = ( byte ) ( 1 << bitNumber ); bytes[posBytes] &= ~mask; } /** * Get the bit stored into the BitString at a specific position. * The bits are stored from left to right, the LSB on the left and the * MSB on the right.
* For instance, if we have 10 bits, then they are coded as * b0 b1 b2 b3 - b4 b5 b6 b7 - b8 b9 x x - x x x x *
     * With '1001 000x', where x is an unused bit,
     *       ^ ^    ^
     *       | |    |
     *       | |    |
     *       | |    +----- getBit(6) = 0
     *       | +---------- getBit(2) = 0
     *       +------------ getBit(0) = 1
     * 
* @param pos The position of the requested bit. * * @return true if the bit is set, false otherwise */ public boolean getBit( int pos ) { if ( pos > nbBits ) { throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_00002_CANNOT_FIND_BIT, pos, nbBits ) ); } int posBytes = pos >>> 3; int bitNumber = 7 - pos % 8; byte mask = ( byte ) ( 1 << bitNumber ); int res = bytes[posBytes] & mask; return res != 0; } /** * Get the number of stored bits * * @return The number of bits stored in this BitString */ public int size() { return nbBits; } /** * Return a native String representation of the BitString. * * @return A String representing the BitString */ @Override public String toString() { StringBuilder sb = new StringBuilder(); for ( int i = 0; i < nbBits; i++ ) { if ( getBit( i ) ) { sb.append( '1' ); } else { sb.append( '0' ); } } return sb.toString(); } } apache-directory-ldap-api-cfb3cee/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java000066400000000000000000001430721525525160600333250ustar00rootroot00000000000000/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.util; import java.io.IOException; import java.io.OutputStream; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.Arrays; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.i18n.I18n; /** * An immutable representation of an object identifier that provides conversion * between their String, and encoded byte[] * representations. * *

The encoding of OID values is performed according to * itu X.690 section 8.19. * Specifically:

* *

8.19.2 The contents octets shall be an (ordered) list of encodings * of subidentifiers (see 8.19.3 and 8.19.4) concatenated together. Each * subidentifier is represented as a series of (one or more) octets. Bit 8 of * each octet indicates whether it is the last in the series: bit 8 of the last * octet is zero; bit 8 of each preceding octet is one. Bits 7 to 1 of the * octets in the series collectively encode the subidentifier. Conceptually, * these groups of bits are concatenated to form an unsigned binary number whose * most significant bit is bit 7 of the first octet and whose least significant * bit is bit 1 of the last octet. The subidentifier shall be encoded in the * fewest possible octets, that is, the leading octet of the subidentifier shall * not have the value 0x80.

* *

8.19.3 The number of subidentifiers (N) shall be one less than the * number of object identifier components in the object identifier value being * encoded.

* *

8.19.4 The numerical value of the first subidentifier is derived * from the values of the first two object identifier components in the object * identifier value being encoded, using the formula: *
(X*40) + Y
* where X is the value of the first object identifier component and Y is the * value of the second object identifier component. NOTE – This packing of * the first two object identifier components recognizes that only three values * are allocated from the root node, and at most 39 subsequent values from nodes * reached by X = 0 and X = 1.

* *

For example, the OID "2.12.3456.7" would be turned into a list of 3 values: * [((2*40)+12), 3456, 7]. The first of which, * 92, would be encoded as the bytes 0x5C, the second * would be [0x9B, 0x00], and the third as 0x07 * giving the final encoding [0x5C, 0x9B, 0x00, 0x07].

* * @author Apache Directory Project */ public final class Oid { /** A byte[] representation of an OID */ private byte[] oidBytes; /** The OID as a String */ private String oidString; /** A OID contai er for a joint-iso-itu-t(2) arc */ private static final BigInteger JOINT_ISO_ITU_T = BigInteger.valueOf( 80 ); /** * The OID FSA states. We have the following Finite State Automaton : * *
     * (Start) --['0','1']--> (A)
     * (start) --['2']--> (F)
     * 
     * (A) --['.']--> (B)
     * 
     * (B) --['0']--> (D)
     * (B) --['1'..'3']--> (C)
     * (B) --['4'..'9']--> (E)
     * 
     * (C) --[]--> (End)
     * (C) --['.']--> (K)
     * (C) --['0'..'9']--> (E)
     * 
     * (D) --[]--> (End)
     * (D) --['.']--> (K)
     * 
     * (E) --[]--> (End)
     * (E) --['.']--> (K)
     * 
     * (F) --['.']--> (G)
     * 
     * (G) --['0']--> (I)
     * (G) --['1'..'9']--> (H)
     *
     * (H) --[]--> (End)
     * (H) --['.']--> (K)
     * (H) --['0'..'9']--> (J)
     * 
     * (I) --[]--> (End)
     * (I) --['.']--> (K)
     *
     * (J) --[]--> (End)
     * (J) --['.']--> (K)
     * (J) --['0'..'9']--> (J)
     * 
     * (K) --['0']--> (M) 
     * (K) --['1'..'9']--> (L)
     * 
     * (L) --[]--> (End)
     * (L) --['.']--> (K)
     * (L) --['0'..'9']--> (L)
     * 
     * (M) --[]--> (End)
     * (M) --['.']--> (K)
     * 
*/ private enum OidFSAState { /** * Starting state * *
 
         * (Start) --['0','1']--> (A)
         * (start) --['2']--> (F)
         * 
**/ START, /** * State * *
 
         * (A) --['.']--> (B)
         * 
**/ STATE_A, /** * State B * *
 
         * (B) --['0']--> (D)
         * (B) --['1'..'3']--> (C)
         * (B) --['4'..'9']--> (E)
         * 
**/ STATE_B, /** * State C * *
 
         * (C) --[]--> (End)
         * (C) --['.']--> (K)
         * (C) --['0'..'9']--> (E)
         * 
**/ STATE_C, /** * State D * *
 
         * (D) --[]--> (End)
         * (D) --['.']--> (K)
         * 
**/ STATE_D, /** * State E * *
 
         * (E) --[]--> (End)
         * (E) --['.']--> (K)
         * 
**/ STATE_E, /** * State F * *
 
         * (F) --['.']--> (G)
         * 
**/ STATE_F, /** * State G * *
 
         * (G) --['0']--> (I)
         * (G) --['1'..'9']--> (H)
         * 
**/ STATE_G, /** * State H * *
 
         * (H) --[]--> (End)
         * (H) --['.']--> (K)
         * (H) --['0'..'9']--> (J)
         * 
**/ STATE_H, /** * State I * *
 
         * (I) --[]--> (End)
         * (I) --['.']--> (K)
         * 
**/ STATE_I, /** * State J * *
 
         * (J) --[]--> (End)
         * (J) --['.']--> (K)
         * (J) --['0'..'9']--> (J)
         * 
**/ STATE_J, /** * State L * *
 
         * (K) --['0']--> (M) 
         * (K) --['1'..'9']--> (L)
         * 
**/ STATE_K, /** * State L * *
 
         * (L) --[]--> (End)
         * (L) --['.']--> (K)
         * (L) --['0'..'9']--> (L)
         * 
**/ STATE_L, /** * State M * *
 
         * (M) --[]--> (End)
         * (M) --['.']--> (K)
         * 
**/ STATE_M, } /** * Creates a new instance of Oid. * * @param oidString The OID as a String * @param oidBytes The OID as a byte[] */ private Oid( String oidString, byte[] oidBytes ) { this.oidString = oidString; this.oidBytes = new byte[oidBytes.length]; System.arraycopy( oidBytes, 0, this.oidBytes, 0, oidBytes.length ); } /** * {@inheritDoc} */ @Override public boolean equals( Object other ) { return ( other instanceof Oid ) && oidString.equals( ( ( Oid ) other ).oidString ); } /** * Decodes an OID from a byte[]. * * @param oidBytes The encodedbyte[] * @return A new Oid * @throws DecoderException When the OID is not valid */ public static Oid fromBytes( byte[] oidBytes ) throws DecoderException { if ( ( oidBytes == null ) || ( oidBytes.length < 1 ) ) { throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, Arrays.toString( oidBytes ) ) ); } StringBuilder builder = new StringBuilder(); long value = 0; int valStart = 0; int valLength = 0; boolean firstArc = true; for ( int i = 0; i < oidBytes.length; i++ ) { value |= oidBytes[i] & 0x7F; if ( oidBytes[i] < 0 ) { // leading 1, so value continues value = value << 7; valLength++; } else { valLength++; if ( valLength > 8 ) { // Above 8 bytes, the arc value may not fit in a long : // accumulate it in a BigInteger, 7 bits per encoded byte. // (The previous bit-packing implementation under-allocated // its buffer for some arc lengths and misdecoded any arc // after the first one, as it indexed from position 0.) BigInteger bigInteger = BigInteger.ZERO; for ( int j = valStart; j <= i; j++ ) { bigInteger = bigInteger.shiftLeft( 7 ).or( BigInteger.valueOf( oidBytes[j] & 0x7F ) ); } if ( firstArc ) { // This is a joint-iso-itu-t(2) arc bigInteger = bigInteger.subtract( JOINT_ISO_ITU_T ); builder.append( '2' ); firstArc = false; } builder.append( '.' ).append( bigInteger.toString() ); } else { // value completed if ( firstArc ) { // first value special processing if ( value >= 80 ) { // starts with 2 builder.append( '2' ); value = value - 80; } else { // starts with 0 or 1 long one = value / 40; long two = value % 40; if ( ( one < 0 ) || ( one > 2 ) || ( two < 0 ) || ( ( one < 2 ) && ( two > 39 ) ) ) { throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, Arrays.toString( oidBytes ) ) ); } if ( one < 2 ) { builder.append( one ); value = two; } } firstArc = false; } // normal processing builder.append( '.' ).append( value ); } // The next arc, if any, starts at the following byte valStart = i + 1; valLength = 0; value = 0; } } if ( valLength != 0 ) { // The last arc is truncated : its final byte has the continuation // bit set. Reject the OID instead of silently dropping the arc. throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, Arrays.toString( oidBytes ) ) ); } return new Oid( builder.toString(), oidBytes ); } /** * Process state A *
     * (Start) --['0','1']--> (A)
     * (start) --['2']--> (F)
     * 
* * @param oid The OID to check * @param buffer The buffer gathering the binary OID * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateStart( String oid, byte[] buffer, int pos ) throws DecoderException { char c = oid.charAt( pos ); switch ( c ) { case '0' : case '1' : buffer[0] = ( byte ) ( ( c - '0' ) * 40 ); return OidFSAState.STATE_A; case '2' : return OidFSAState.STATE_F; default : // This is an error throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "Should start with 0, 1 or 2" ) ); } } /** * Process state B *
     * (A) --['.']--> (B)
     * 
* * @param oid The OID to check * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateA( String oid, int pos ) throws DecoderException { if ( oid.charAt( pos ) != '.' ) { // Expecting a Dot here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a '.' is expected" ) ); } return OidFSAState.STATE_B; } /** * Process state B *
     * (B) --['0']--> (D)
     * (B) --['1'..'3']--> (C)
     * (B) --['4'..'9']--> (E)
     * 
* * @param oid The OID to check * @param buffer The buffer gathering the binary OID * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateB( String oid, byte[] buffer, int pos ) throws DecoderException { char c = oid.charAt( pos ); switch ( c ) { case '0' : return OidFSAState.STATE_D; case '1' : case '2' : case '3' : // We may have a second digit. Atm, store the current one in the second psotion buffer[1] = ( byte ) ( c - '0' ); return OidFSAState.STATE_C; case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : buffer[0] += ( byte ) ( c - '0' ); return OidFSAState.STATE_E; default : // Expecting a digit here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a digit is expected" ) ); } } /** * Process state C *
     * (C) --['.']--> (K)
     * (C) --['0'..'9']--> (E)
     * 
* * @param oid The OID to check * @param buffer The buffer gathering the binary OID * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateC( String oid, byte[] buffer, int pos ) throws DecoderException { char c = oid.charAt( pos ); switch ( c ) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : buffer[0] += ( byte ) ( buffer[1] * 10 + ( c - '0' ) ); buffer[1] = 0; return OidFSAState.STATE_E; case '.' : buffer[0] += buffer[1]; buffer[1] = 0; return OidFSAState.STATE_K; default : // Expecting a digit here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a digit is expected" ) ); } } /** * Process state D and E *
     * (D) --['.']--> (K)
     * (E) --['.']--> (K)
     * 
* * @param oid The OID to check * @param buffer The buffer gathering the binary OID * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateDE( String oid, byte[] buffer, int pos ) throws DecoderException { char c = oid.charAt( pos ); if ( c != '.' ) { // Expecting a '.' here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a dot is expected" ) ); } // Store the first byte into it buffer[0] = ( byte ) ( buffer[0] | buffer[1] ); buffer[1] = 0; return OidFSAState.STATE_K; } /** * Process state F *
     * (F) --['.']--> (G)
     * 
* * @param oid The OID to check * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateF( String oid, int pos ) throws DecoderException { if ( oid.charAt( pos ) != '.' ) { // Expecting a Dot here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a '.' is expected" ) ); } return OidFSAState.STATE_G; } /** * Process state G *
     * (G) --['0']--> (I)
     * (G) --['1'..'9']--> (H)
     * 
* * @param oid The OID to check * @param buffer The buffer gathering the binary OID * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateG( String oid, byte[] buffer, int pos ) throws DecoderException { char c = oid.charAt( pos ); switch ( c ) { case '0' : buffer[0] = ( byte ) 80; return OidFSAState.STATE_I; case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : // Store the read digit in the second position in the buffer buffer[0] = ( byte ) ( c - '0' ); return OidFSAState.STATE_H; default : // Expecting a digit here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a digit is expected" ) ); } } /** * Process state H *
     * (H) --['.']--> (K)
     * (H) --['0'..'9']--> (J)
     * 
* * @param oid The OID to check * @param buffer The buffer gathering the binary OID * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateH( String oid, byte[] buffer, int pos ) throws DecoderException { char c = oid.charAt( pos ); switch ( c ) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : // Store the read digit in the first position in the buffer buffer[1] = ( byte ) ( c - '0' ); return OidFSAState.STATE_J; case '.' : // The first 2 arcs are single digit, we can collapse them in one byte. buffer[0] = ( byte ) ( 80 + buffer[0] ); return OidFSAState.STATE_K; default : // Expecting a digit here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a digit is expected" ) ); } } /** * Process state I *
     * (I) --['.']--> (K)
     * 
* * @param oid The OID to check * @param buffer The buffer gathering the binary OID * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateI( String oid, byte[] buffer, int pos ) throws DecoderException { char c = oid.charAt( pos ); if ( c == '.' ) { // The first 2 arcs are single digit, we can collapse them in one byte. buffer[0] = ( byte ) ( 80 + buffer[1] ); return OidFSAState.STATE_K; } else { // Expecting a digit here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a digit is expected" ) ); } } /** * Process state J *
     * (J) --['.']--> (K)
     * (J) --['0'..'9']--> (J)
     * 
* * @param oid The OID to check * @param buffer The buffer gathering the binary OID * @param bufferPos The current position in the buffer * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateJ( String oid, byte[] buffer, int bufferPos, int pos ) throws DecoderException { char c = oid.charAt( pos ); switch ( c ) { case '.' : return OidFSAState.STATE_K; case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : // Store the new digit at the right position in the buffer buffer[bufferPos] = ( byte ) ( c - '0' ); return OidFSAState.STATE_J; default : // Expecting a digit here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a digit is expected" ) ); } } /** * Process state J *
     * (K) --['0']--> (M)
     * (K) --['1'..'9']--> (L)
     * 
* * @param oid The OID to check * @param buffer The buffer gathering the binary OID * @param bufferPos The current position in the buffer * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateK( String oid, byte[] buffer, int bufferPos, int pos ) throws DecoderException { char c = oid.charAt( pos ); switch ( c ) { case '0' : buffer[bufferPos] = 0x00; return OidFSAState.STATE_M; case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : // Store the new digit at the right position in the buffer return OidFSAState.STATE_L; default : // Expecting a digit here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a digit is expected" ) ); } } /** * Process state J *
     * (L) --['.']--> (K)
     * (L) --['0'..'9']--> (L)
     * 
* * @param oid The OID to check * @param buffer The buffer gathering the binary OID * @param bufferPos The current position in the buffer * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateL( String oid, byte[] buffer, int bufferPos, int pos ) throws DecoderException { char c = oid.charAt( pos ); switch ( c ) { case '.' : return OidFSAState.STATE_K; case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : // Store the new digit at the right position in the buffer buffer[bufferPos] = ( byte ) ( c - '0' ); return OidFSAState.STATE_L; default : // Expecting a digit here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a digit or a dot is expected" ) ); } } /** * Process state J *
     * (M) --['.']--> (K)
     * 
* * @param oid The OID to check * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateM( String oid, int pos ) throws DecoderException { char c = oid.charAt( pos ); if ( c == '.' ) { return OidFSAState.STATE_K; } else { // Expecting a '.' here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a '.' is expected" ) ); } } /** * Convert a list of digits to a list of 7 bits bytes. We must start by the end, and we don't * know how many bytes we will need, except when we will be done with the conversion. * * @param oid The OID to convert * @param buffer The buffer gathering the binary OID * @param start The starting position in the OID string * @param nbDigits Teh number of digits the OID has * @param posBuffer The position in the buffer * @param isJointIsoItuT A flag set if we know the OID is a JointIsoItuT OID * @return The number of bytes required to store the OID in a PDU */ private static int convert( String oid, byte[] buffer, int start, int nbDigits, int posBuffer, boolean isJointIsoItuT ) { if ( nbDigits < 3 ) { // Speedup when we have a number in [0..99] : it's guaranteed to be hold // by a single byte. if ( isJointIsoItuT ) { // Another special case : this is an OID that starts with '2.' buffer[0] = ( byte ) ( 80 + ( oid.charAt( 2 ) - '0' ) * 10 + ( oid.charAt( 3 ) - '0' ) ); if ( buffer[0] < 0 ) { // Here, we need 2 bytes buffer[1] = ( byte ) ( buffer[0] & 0x007F ); buffer[0] = ( byte ) 0x81; return 2; } else { return 1; } } else { if ( nbDigits == 1 ) { buffer[posBuffer] = ( byte ) ( oid.charAt( start ) - '0' ); } else { buffer[posBuffer] = ( byte ) ( ( oid.charAt( start ) - '0' ) * 10 + ( oid.charAt( start + 1 ) - '0' ) ); } return 1; } } else if ( nbDigits < 19 ) { // The value can be hold in a Long if it's up to 999999999999999999 // Convert the String to a long : String number = oid.substring( start, start + nbDigits ); long value = Long.parseLong( number ); if ( isJointIsoItuT ) { value += 80L; } // Convert the long to a byte array if ( ( value & 0xFFFFFFFFFFFFFF80L ) == 0 ) { // The value will be hold in one byte buffer[posBuffer] = ( byte ) ( value ); return 1; } if ( ( value & 0xFFFFFFFFFFFFC000L ) == 0 ) { // The value is between 0x80 and 0x3FFF : it will be hold in 2 bytes buffer[posBuffer] = ( byte ) ( ( byte ) ( ( value & 0x0000000000003F80L ) >> 7 ) | 0x80 ); buffer[posBuffer + 1] = ( byte ) ( value & 0x000000000000007FL ); return 2; } if ( ( value & 0xFFFFFFFFFFE00000L ) == 0 ) { // The value is between 0x4000 and 0x1FFFFF : it will be hold in 3 bytes buffer[posBuffer] = ( byte ) ( ( byte ) ( ( value & 0x00000000001FC000L ) >> 14 ) | 0x80 ); buffer[posBuffer + 1] = ( byte ) ( ( byte ) ( ( value & 0x0000000000003F80L ) >> 7 ) | 0x80 ); buffer[posBuffer + 2] = ( byte ) ( value & 0x000000000000007FL ); return 3; } if ( ( value & 0xFFFFFFFFF0000000L ) == 0 ) { // The value is between 0x200000 and 0xFFFFFFF : it will be hold in 4 bytes buffer[posBuffer] = ( byte ) ( ( byte ) ( ( value & 0x000000000FE00000L ) >> 21 ) | 0x80 ); buffer[posBuffer + 1] = ( byte ) ( ( byte ) ( ( value & 0x00000000001FC000L ) >> 14 ) | 0x80 ); buffer[posBuffer + 2] = ( byte ) ( ( byte ) ( ( value & 0x0000000000003F80L ) >> 7 ) | 0x80 ); buffer[posBuffer + 3] = ( byte ) ( value & 0x000000000000007FL ); return 4; } if ( ( value & 0xFFFFFFF800000000L ) == 0 ) { // The value is between 0x10000000 and 0x7FFFFFFFF : it will be hold in 5 bytes buffer[posBuffer] = ( byte ) ( ( byte ) ( ( value & 0x00000007F0000000L ) >> 28 ) | 0x80 ); buffer[posBuffer + 1] = ( byte ) ( ( byte ) ( ( value & 0x000000000FE00000L ) >> 21 ) | 0x80 ); buffer[posBuffer + 2] = ( byte ) ( ( byte ) ( ( value & 0x00000000001FC000L ) >> 14 ) | 0x80 ); buffer[posBuffer + 3] = ( byte ) ( ( byte ) ( ( value & 0x0000000000003F80L ) >> 7 ) | 0x80 ); buffer[posBuffer + 4] = ( byte ) ( value & 0x000000000000007FL ); return 5; } if ( ( value & 0xFFFFFC0000000000L ) == 0 ) { // The value is between 0x800000000 and 0x3FFFFFFFFFF : it will be hold in 6 bytes buffer[posBuffer] = ( byte ) ( ( byte ) ( ( value & 0x000003F800000000L ) >> 35 ) | 0x80 ); buffer[posBuffer + 1] = ( byte ) ( ( byte ) ( ( value & 0x00000007F0000000L ) >> 28 ) | 0x80 ); buffer[posBuffer + 2] = ( byte ) ( ( byte ) ( ( value & 0x000000000FE00000L ) >> 21 ) | 0x80 ); buffer[posBuffer + 3] = ( byte ) ( ( byte ) ( ( value & 0x00000000001FC000L ) >> 14 ) | 0x80 ); buffer[posBuffer + 4] = ( byte ) ( ( byte ) ( ( value & 0x0000000000003F80L ) >> 7 ) | 0x80 ); buffer[posBuffer + 5] = ( byte ) ( value & 0x000000000000007FL ); return 6; } if ( ( value & 0xFFFE000000000000L ) == 0 ) { // The value is between 0x40000000000 and 0x1FFFFFFFFFFFF : it will be hold in 7 bytes buffer[posBuffer] = ( byte ) ( ( byte ) ( ( value & 0x0001FC0000000000L ) >> 42 ) | 0x80 ); buffer[posBuffer + 1] = ( byte ) ( ( byte ) ( ( value & 0x000003F800000000L ) >> 35 ) | 0x80 ); buffer[posBuffer + 2] = ( byte ) ( ( byte ) ( ( value & 0x00000007F0000000L ) >> 28 ) | 0x80 ); buffer[posBuffer + 3] = ( byte ) ( ( byte ) ( ( value & 0x000000000FE00000L ) >> 21 ) | 0x80 ); buffer[posBuffer + 4] = ( byte ) ( ( byte ) ( ( value & 0x00000000001FC000L ) >> 14 ) | 0x80 ); buffer[posBuffer + 5] = ( byte ) ( ( byte ) ( ( value & 0x0000000000003F80L ) >> 7 ) | 0x80 ); buffer[posBuffer + 6] = ( byte ) ( value & 0x000000000000007FL ); return 7; } if ( ( value & 0xFF00000000000000L ) == 0 ) { // The value is between 0x2000000000000 and 0xFF000000000000 : it will be hold in 8 bytes buffer[posBuffer] = ( byte ) ( ( byte ) ( ( value & 0x00FE000000000000L ) >> 49 ) | 0x80 ); buffer[posBuffer + 1] = ( byte ) ( ( byte ) ( ( value & 0x0001FC0000000000L ) >> 42 ) | 0x80 ); buffer[posBuffer + 2] = ( byte ) ( ( byte ) ( ( value & 0x000003F800000000L ) >> 35 ) | 0x80 ); buffer[posBuffer + 3] = ( byte ) ( ( byte ) ( ( value & 0x00000007F0000000L ) >> 28 ) | 0x80 ); buffer[posBuffer + 4] = ( byte ) ( ( byte ) ( ( value & 0x000000000FE00000L ) >> 21 ) | 0x80 ); buffer[posBuffer + 5] = ( byte ) ( ( byte ) ( ( value & 0x00000000001FC000L ) >> 14 ) | 0x80 ); buffer[posBuffer + 6] = ( byte ) ( ( byte ) ( ( value & 0x0000000000003F80L ) >> 7 ) | 0x80 ); buffer[posBuffer + 7] = ( byte ) ( value & 0x000000000000007FL ); return 8; } else { // The value is between 0x100000000000000 and 0x7F00000000000000 : it will be hold in 9 bytes buffer[posBuffer] = ( byte ) ( ( byte ) ( ( value & 0x7F00000000000000L ) >> 56 ) | 0x80 ); buffer[posBuffer + 1] = ( byte ) ( ( byte ) ( ( value & 0x00FE000000000000L ) >> 49 ) | 0x80 ); buffer[posBuffer + 2] = ( byte ) ( ( byte ) ( ( value & 0x0001FC0000000000L ) >> 42 ) | 0x80 ); buffer[posBuffer + 3] = ( byte ) ( ( byte ) ( ( value & 0x000003F800000000L ) >> 35 ) | 0x80 ); buffer[posBuffer + 4] = ( byte ) ( ( byte ) ( ( value & 0x00000007F0000000L ) >> 28 ) | 0x80 ); buffer[posBuffer + 5] = ( byte ) ( ( byte ) ( ( value & 0x000000000FE00000L ) >> 21 ) | 0x80 ); buffer[posBuffer + 6] = ( byte ) ( ( byte ) ( ( value & 0x00000000001FC000L ) >> 14 ) | 0x80 ); buffer[posBuffer + 7] = ( byte ) ( ( byte ) ( ( value & 0x0000000000003F80L ) >> 7 ) | 0x80 ); buffer[posBuffer + 8] = ( byte ) ( value & 0x000000000000007FL ); return 9; } } else { // The value is bigger than 9999999999999999999, we need to use a BigInteger // First, get the number of bytes we need to store the value in base 16 String number = oid.substring( start, start + nbDigits ); BigInteger bigInteger = new BigInteger( number ); if ( isJointIsoItuT ) { bigInteger = bigInteger.add( JOINT_ISO_ITU_T ); posBuffer = 0; } byte[] bytes = bigInteger.toByteArray(); // Now, convert this value to the ASN.1 OID format : we store the value // as 7 bits bytes int nbNeededBytes = ( bytes.length * 8 ) / 7; switch ( ( bytes.length - 1 ) % 7 ) { case 0 : if ( ( bytes[0] & 0x0080 ) != 0 ) { nbNeededBytes++; } break; case 1 : if ( ( bytes[0] & 0x00C0 ) != 0 ) { nbNeededBytes++; } break; case 2 : if ( ( bytes[0] & 0x00E0 ) != 0 ) { nbNeededBytes++; } break; case 3 : if ( ( bytes[0] & 0x00F0 ) != 0 ) { nbNeededBytes++; } break; case 4 : if ( ( bytes[0] & 0x00F8 ) != 0 ) { nbNeededBytes++; } break; case 5 : if ( ( bytes[0] & 0x00FC ) != 0 ) { nbNeededBytes++; } break; case 6 : if ( ( bytes[0] & 0x00FE ) != 0 ) { nbNeededBytes++; } break; default : // Exist to please checkstyle... break; } byte[] converted = new byte[nbNeededBytes]; int posConverted = nbNeededBytes - 1; int posBytes = bytes.length - 1; int counter = 0; byte reminder = 0; while ( posBytes >= 0 ) { byte newByte = ( byte ) ( ( bytes[posBytes] & 0x00FF ) << counter ); converted[posConverted] = ( byte ) ( reminder | newByte | 0x0080 ); reminder = ( byte ) ( ( bytes[posBytes] & 0x00FF ) >> ( 7 - counter ) ); counter = ( counter + 1 ) % 8; posConverted--; if ( counter != 0 ) { posBytes--; } else { reminder = 0; } } converted[nbNeededBytes - 1] &= 0x7F; // Copy the converted bytes in the buffer System.arraycopy( converted, 0, buffer, posBuffer, nbNeededBytes ); return nbNeededBytes; } } /** * Returns an OID object representing oidString. * * @param oidString The string representation of the OID * @return A new Oid * @throws DecoderException When the OID is not valid */ public static Oid fromString( String oidString ) throws DecoderException { if ( ( oidString == null ) || oidString.isEmpty() ) { throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "empty" ) ); } // Create a buffer that is wide enough to contain all the values byte[] buffer = new byte[oidString.length()]; OidFSAState state = OidFSAState.START; // A counter of chars used for an arc. In 1.2.45345, this counter will be 5 for the '45345' arc. int arcNbChars = 0; // The position in the buffer where we accumulate the result. int bufPos = 0; // The position in the OID string where we started to read an arc int startArc = 0; // The number of bytes in the resulting OID byte[] int nbBytes; for ( int i = 0; i < oidString.length(); i++ ) { switch ( state ) { case START : // (Start) --['0'..'1']--> (A) // (start) --['2']--> (F) state = processStateStart( oidString, buffer, i ); break; case STATE_A : // (A) --['.']--> (B) state = processStateA( oidString, i ); break; case STATE_B : // (B) --['0']--> (D) // (B) --['1'..'3']--> (C) // (B) --['4'..'9']--> (E) state = processStateB( oidString, buffer, i ); break; case STATE_C : // (C) --['.']--> (K) // (C) --['0'..'9']--> (E) state = processStateC( oidString, buffer, i ); // the next arc will be store at position 1 in the buffer bufPos = 1; break; case STATE_D : // (D) --['.']--> (K) // Fallthrough case STATE_E : // (E) --['.']--> (K) state = processStateDE( oidString, buffer, i ); // the next arc will be store at position 1 in teh buffer bufPos = 1; break; case STATE_F : // (F) --['.']--> (G) state = processStateF( oidString, i ); break; case STATE_G : // (G) --['0']--> (I) // (G) --['1'..'9']--> (H) state = processStateG( oidString, buffer, i ); arcNbChars = 1; startArc = i; break; case STATE_H : // (H) --['.']--> (K) // (H) --['0'..'9']--> (J) state = processStateH( oidString, buffer, i ); if ( state == OidFSAState.STATE_J ) { // We have already two digits arcNbChars = 2; bufPos = 0; } break; case STATE_I : // (I) --['.']--> (K) state = processStateI( oidString, buffer, i ); // Set the arc position to buffer[1], we haven't yet accumulated digits. bufPos = 1; break; case STATE_J : // (J) --['.']--> (K) // (J) --['0'..'9']--> (J) state = processStateJ( oidString, buffer, arcNbChars + bufPos, i ); if ( state == OidFSAState.STATE_J ) { // We can increment the number of digit for this arc arcNbChars++; } else { // We are done with the first arc : convert it bufPos += convert( oidString, buffer, startArc, arcNbChars, bufPos, true ); } break; case STATE_K : startArc = i; state = processStateK( oidString, buffer, bufPos, i ); if ( state == OidFSAState.STATE_M ) { bufPos++; } else { arcNbChars = 1; } break; case STATE_L : state = processStateL( oidString, buffer, arcNbChars + bufPos, i ); if ( state == OidFSAState.STATE_L ) { arcNbChars++; break; } else { // We are done with the arc : convert it bufPos += convert( oidString, buffer, startArc, arcNbChars, bufPos, false ); } break; case STATE_M : state = processStateM( oidString, i ); break; default : // Exist to please checkstyle... break; } } // End of the string : check that we are in a correct state for a completion // The only valid exit states are : // (C) --[]--> (End) // (D) --[]--> (End) // (E) --[]--> (End) // (H) --[]--> (End) // (I) --[]--> (End) // (J) --[]--> (End) // (L) --[]--> (End) // (M) --[]--> (End) switch ( state ) { case STATE_C : // (C) --[]--> (End) // fallthrough case STATE_D : // (D) --[]--> (End) // fallthrough case STATE_E : // (E) --[]--> (End) // fallthrough case STATE_H : // (H) --[]--> (End) // fallthrough case STATE_I : // (I) --[]--> (End) byte[] bytes = new byte[1]; bytes[0] = ( byte ) ( buffer[0] | buffer[1] ); return new Oid( oidString, bytes ); case STATE_J : // (J) --[]--> (End) nbBytes = convert( oidString, buffer, 2, arcNbChars, 0, true ); bytes = new byte[nbBytes]; System.arraycopy( buffer, 0, bytes, 0, nbBytes ); return new Oid( oidString, bytes ); case STATE_L : bufPos += convert( oidString, buffer, startArc, arcNbChars, bufPos, false ); bytes = new byte[bufPos]; System.arraycopy( buffer, 0, bytes, 0, bufPos ); return new Oid( oidString, bytes ); case STATE_M : bytes = new byte[bufPos]; System.arraycopy( buffer, 0, bytes, 0, bufPos ); return new Oid( oidString, bytes ); default : // This should never happen... throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "Wrong OID" ) ); } } /** * Returns the length of the encoded byte[] representation. * * @return The length of the byte[] */ public int getEncodedLength() { return oidBytes.length; } /** * {@inheritDoc} */ @Override public int hashCode() { return oidString.hashCode(); } /** * Returns true if oidString is a valid string representation * of an OID. This method simply calls {@link #fromString(String)} and * returns true if no exception was thrown. As such, it should not be used * in an attempt to check if a string is a valid OID before calling * {@link #fromString(String)}. * * @param oidString The string to test * @return True, if oidString is valid */ public static boolean isOid( String oidString ) { try { Oid.fromString( oidString ); return true; } catch ( DecoderException e ) { return false; } } /** * Returns the byte[] representation of the OID. The * byte[] that is returned is copied from the internal * value so as to preserve the immutability of an OID object. If the * output of a call to this method is intended to be written to a stream, * the {@link #writeBytesTo(OutputStream)} should be used instead as it will * avoid creating this copy. * * @return The encoded byte[] representation of the OID. */ public byte[] toBytes() { return Arrays.copyOf( oidBytes, oidBytes.length ); } /** * Returns the string representation of the OID. * * @return The string representation of the OID */ @Override public String toString() { return oidString; } /** * Writes the bytes respresenting this OID to the provided buffer. This * should be used in preference to the {@link #toBytes()} method in order * to prevent the creation of copies of the actual byte[]. * * @param buffer The buffer to write the bytes into */ public void writeBytesTo( ByteBuffer buffer ) { buffer.put( oidBytes ); } /** * Writes the bytes respresenting this OID to the provided stream. This * should be used in preference to the {@link #toBytes()} method in order * to prevent the creation of copies of the actual byte[]. * * @param outputStream The stream to write the bytes to * @throws IOException When we can't write the OID into a Stream */ public void writeBytesTo( OutputStream outputStream ) throws IOException { outputStream.write( oidBytes ); } } apache-directory-ldap-api-cfb3cee/asn1/api/src/site/000077500000000000000000000000001525525160600224335ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/site/site.xml000066400000000000000000000025151525525160600241240ustar00rootroot00000000000000 apache-directory-ldap-api-cfb3cee/asn1/api/src/test/000077500000000000000000000000001525525160600224465ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/000077500000000000000000000000001525525160600233675ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/org/000077500000000000000000000000001525525160600241565ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/org/apache/000077500000000000000000000000001525525160600253775ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/org/apache/directory/000077500000000000000000000000001525525160600274035ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/org/apache/directory/api/000077500000000000000000000000001525525160600301545ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/org/apache/directory/api/asn1/000077500000000000000000000000001525525160600310165ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/org/apache/directory/api/asn1/util/000077500000000000000000000000001525525160600317735ustar00rootroot00000000000000Asn1Buffer2Test.java000066400000000000000000000060401525525160600354350ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/org/apache/directory/api/asn1/util/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.util; import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.ByteBuffer; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** * Test for the Asn1Buffer class * * @author Apache Directory Project */ public class Asn1Buffer2Test { @Test @Disabled public void testPutSmallBytes() { Asn1Buffer buffer = new Asn1Buffer(); for ( int i = 0; i < 512; i++ ) { buffer.put( new byte[] { 0x01, ( byte ) i } ); } assertEquals( 1024, buffer.getPos() ); ByteBuffer result = buffer.getBytes(); for ( int i = 0; i < 512; i++ ) { assertEquals( 0x01, result.get( i + 1 ) ); assertEquals( ( byte ) ( 511 - i ), result.get( i + i + 1 ) ); } } @Test public void testPutByte() { Asn1Buffer buffer = new Asn1Buffer(); for ( int i = 0; i < 1024; i++ ) { buffer.put( ( byte ) i ); } assertEquals( 1024, buffer.getPos() ); ByteBuffer result = buffer.getBytes(); for ( int i = 0; i < 1024; i++ ) { assertEquals( ( byte ) ( 1023 - i ), result.get( i ) ); } } @Test public void testPutByteOOB() { Asn1Buffer buffer = new Asn1Buffer(); for ( int i = 0; i < 1025; i++ ) { buffer.put( ( byte ) i ); } assertEquals( 1025, buffer.getPos() ); assertEquals( 2048, buffer.getSize() ); ByteBuffer result = buffer.getBytes(); for ( int i = 0; i < 1025; i++ ) { assertEquals( ( byte ) ( 1024 - i ), result.get( i ) ); } } @Test @Disabled public void testBytesPerf() { long t0 = System.currentTimeMillis(); for ( int j = 0; j < 1000; j++ ) { Asn1Buffer buffer = new Asn1Buffer(); for ( int i = 0; i < 409600; i++ ) { buffer.put( new byte[] { 0x01, ( byte ) i } ); } } long t1 = System.currentTimeMillis(); System.out.println( "Delta: " + ( t1 - t0 ) ); } } Asn1BufferTest.java000066400000000000000000000060211525525160600353520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/org/apache/directory/api/asn1/util/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.util; import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.ByteBuffer; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** * Test for the Asn1Buffer class * * @author Apache Directory Project */ public class Asn1BufferTest { @Test public void testPutSmallBytes() { Asn1Buffer buffer = new Asn1Buffer(); for ( int i = 0; i < 512; i++ ) { buffer.put( new byte[] { 0x01, ( byte ) i } ); } assertEquals( 1024, buffer.getPos() ); ByteBuffer result = buffer.getBytes(); for ( int i = 0; i < 512; i++ ) { assertEquals( 0x01, result.get( i + i ) ); assertEquals( ( byte ) ( 511 - i ), result.get( i + i + 1 ) ); } } @Test public void testPutByte() { Asn1Buffer buffer = new Asn1Buffer(); for ( int i = 0; i < 1024; i++ ) { buffer.put( ( byte ) i ); } assertEquals( 1024, buffer.getPos() ); ByteBuffer result = buffer.getBytes(); for ( int i = 0; i < 1024; i++ ) { assertEquals( ( byte ) ( 1023 - i ), result.get( i ) ); } } @Test public void testPutByteOOB() { Asn1Buffer buffer = new Asn1Buffer(); for ( int i = 0; i < 1025; i++ ) { buffer.put( ( byte ) i ); } assertEquals( 1025, buffer.getPos() ); assertEquals( 2048, buffer.getSize() ); ByteBuffer result = buffer.getBytes(); for ( int i = 0; i < 1025; i++ ) { assertEquals( ( byte ) ( 1024 - i ), result.get( i ) ); } } @Test @Disabled public void testBytesPerf() { long t0 = System.currentTimeMillis(); for ( int j = 0; j < 1000; j++ ) { Asn1Buffer buffer = new Asn1Buffer(); for ( int i = 0; i < 409600; i++ ) { buffer.put( new byte[] { 0x01, ( byte ) i } ); } } long t1 = System.currentTimeMillis(); System.out.println( "Delta: " + ( t1 - t0 ) ); } } BitStringTest.java000066400000000000000000000163611525525160600353330ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/org/apache/directory/api/asn1/util/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.util; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import org.apache.directory.api.asn1.DecoderException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Test the Bit String primitive * * @author Apache Directory Project */ @Execution(ExecutionMode.CONCURRENT) public class BitStringTest { /** * Test a null BitString */ @Test public void testBitStringNull() { BitString bitString = new BitString( 1 ); bitString.setData( null ); try { bitString.getBit( 0 ); fail( "Should not reach this point ..." ); } catch ( IndexOutOfBoundsException ioobe ) { assertTrue( true ); } } /** * Test an empty BitString */ @Test public void testBitStringEmpty() { BitString bitString = new BitString( 1 ); bitString.setData( new byte[] {} ); try { bitString.getBit( 0 ); fail( "Should not reach this point ..." ); } catch ( IndexOutOfBoundsException ioobe ) { assertTrue( true ); } } /** * Test a single bit BitString * @throws DecoderException If the test failed */ @Test public void testSingleBitBitString() throws DecoderException { BitString bitString = new BitString( new byte[] { 0x07, ( byte ) 0x80 } ); assertEquals( true, bitString.getBit( 0 ) ); } /** * Test a 32 bits BitString * @throws DecoderException If the test failed */ @Test public void test32BitsBitString() throws DecoderException { BitString bitString = new BitString( 32 ); bitString.setData( new byte[] { 0x00, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } ); for ( int i = 0; i < 32; i++ ) { assertEquals( true, bitString.getBit( i ) ); } } /** * Test a 33 bits BitString * @throws DecoderException If the test failed */ @Test public void test33BitsBitString() throws DecoderException { BitString bitString = new BitString( 33 ); bitString.setData( new byte[] { 0x07, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0x80 } ); for ( int i = 0; i < 33; i++ ) { assertEquals( true, bitString.getBit( i ) ); } assertEquals( true, bitString.getBit( 32 ) ); } /** * Test all bits from 0 to 128 BitString * @throws DecoderException If the test failed */ @Test public void test0to128BitString() throws DecoderException { // bit number 14 BitString bitString14 = new BitString( 14 ); bitString14.setData( new byte[] { 0x02, ( byte ) 0xFF, ( byte ) 0xFC } ); for ( int i = 0; i < 14; i++ ) { assertEquals( true, bitString14.getBit( i ) ); } // bit number 31 BitString bitString31 = new BitString( 31 ); bitString31.setData( new byte[] { 0x01, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFE } ); for ( int i = 0; i < 31; i++ ) { assertEquals( true, bitString31.getBit( i ) ); } // bit number 128 BitString bitString128 = new BitString( 128 ); bitString128.setData( new byte[] { 0x00, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } ); for ( int i = 0; i < 128; i++ ) { assertEquals( true, bitString128.getBit( i ) ); } } @Test public void testBitStringSet() { BitString bitString = new BitString( 32 ); byte[] bytes = new byte[] { 0x00, ( byte ) 0xAA, 0x11, ( byte ) 0x88, ( byte ) 0xFE }; int[] bits = new int[] { 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 }; for ( int i = 0; i < bits.length; i++ ) { if ( bits[i] == 1 ) { bitString.setBit( i ); } } assertEquals( Asn1StringUtils.dumpBytes( bytes ), Asn1StringUtils.dumpBytes( bitString.getData() ) ); } @Test public void testBitStringSetBit() { BitString bitString = new BitString( 32 ); int[] bits = new int[] { 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, // After modification, will become 8A 1, 1, 1, 1, 1, 1, 1, 0 }; for ( int i = 0; i < bits.length; i++ ) { if ( bits[i] == 1 ) { bitString.setBit( i ); } } bitString.setBit( 9 ); byte[] bytesModified = new byte[] { 0x00, ( byte ) 0xAA, 0x51, ( byte ) 0x88, ( byte ) 0xFE }; assertEquals( Asn1StringUtils.dumpBytes( bytesModified ), Asn1StringUtils.dumpBytes( bitString.getData() ) ); } @Test public void testBitStringClearBit() { BitString bitString = new BitString( 32 ); int[] bits = new int[] { 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 }; for ( int i = 0; i < bits.length; i++ ) { if ( bits[i] == 1 ) { bitString.setBit( i ); } } bitString.clearBit( 11 ); byte[] bytesModified = new byte[] { 0x00, ( byte ) 0xAA, 0x01, ( byte ) 0x88, ( byte ) 0xFE }; assertEquals( Asn1StringUtils.dumpBytes( bytesModified ), Asn1StringUtils.dumpBytes( bitString.getData() ) ); } } OidTest.java000066400000000000000000001023471525525160600341410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/java/org/apache/directory/api/asn1/util/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.util; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.fail; import java.util.Arrays; import org.apache.directory.api.asn1.DecoderException; import org.junit.jupiter.api.Test; /** * A test class for the Oid class * * @author Apache Directory Project */ public class OidTest { @Test public void fromBytes() throws DecoderException { // first byte for ( int i = 0; i < 2; i++ ) { // [0..2] for ( int j = 0; j < 40; j++ ) { // [0..39] assertEquals( i + "." + j, Oid.fromBytes( new byte[] { ( byte ) ( i * 40 + j ) } ) .toString() ); } } assertEquals( "1.2.840.113554.1.2.2", Oid.fromBytes( new byte[] { 0x2A, ( byte ) 0x86, 0x48, ( byte ) 0x86, ( byte ) 0xF7, 0x12, 0x01, 0x02, 0x02 } ).toString() ); assertEquals( "2.123456", Oid.fromBytes( new byte[] { ( byte ) 0x87, ( byte ) 0xC5, 0x10 } ).toString() ); } @Test public void fromBytesLongValues() throws DecoderException { // 2.0 -> expected 0x02 assertEquals( "2.0", Oid.fromBytes( new byte[] { 0x50 } ).toString() ); // 2.40 -> expected 0x78 assertEquals( "2.40", Oid.fromBytes( new byte[] { 0x78 } ).toString() ); // 2.48 -> expected 0x81 0x00 assertEquals( "2.48", Oid.fromBytes( new byte[] { (byte)0x81, 0x00 } ).toString() ); // The second arc is below and equal to 16304 : 0x4000 - 0x50 assertEquals( "2.16303", Oid.fromBytes( new byte[] { (byte)0xFF, 0x7F } ).toString() ); assertEquals( "2.16304", Oid.fromBytes( new byte[] { (byte)0x81, (byte)0x80, 0x00 } ).toString() ); // The second arc is below and equal to 2097072 : 0x200000 - 0x50 assertEquals( "2.2097071", Oid.fromBytes( new byte[] { (byte)0xFF, (byte)0xFF, 0x7F } ).toString() ); assertEquals( "2.2097072", Oid.fromBytes( new byte[] { (byte)0x81, (byte)0x80, (byte)0x80, 0x00 } ).toString() ); // The second arc is below and equal to 268435376 : 0x10000000 - 0x50 assertEquals( "2.268435375", Oid.fromBytes( new byte[] { (byte)0xFF, (byte)0xFF, (byte)0xFF, 0x7F } ).toString() ); assertEquals( "2.268435376", Oid.fromBytes( new byte[] { (byte)0x81, (byte)0x80, (byte)0x80, (byte)0x80, 0x00 } ).toString() ); // The second arc is below and equal to 34359738288 : 0x800000000 - 0x50 Oid oid = Oid.fromBytes( new byte[] { (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, 0x7F } ); assertEquals( "2.34359738287", oid.toString() ); Oid oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); oid = Oid.fromBytes( new byte[] { (byte)0x81, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, 0x00 } ); assertEquals( "2.34359738288", oid.toString() ); oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); // The second arc is below and equal to 4398046511024 : 0x40000000000 - 0x50 oid = Oid.fromBytes( new byte[] { (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, 0x7F } ); assertEquals( "2.4398046511023", oid.toString() ); oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); oid = Oid.fromBytes( new byte[] { (byte)0x81, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, 0x00 } ); assertEquals( "2.4398046511024", oid.toString() ); oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); // The second arc is below and equal to 562949953421232 : 0x2000000000000 - 0x50 oid = Oid.fromBytes( new byte[] { (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, 0x7F } ); assertEquals( "2.562949953421231", oid.toString() ); oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); oid = Oid.fromBytes( new byte[] { (byte)0x81, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, 0x00 } ); assertEquals( "2.562949953421232", oid.toString() ); oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); // The second arc is below and equal to 72057594037927856 : 0x100000000000000 - 0x50 oid = Oid.fromBytes( new byte[] { (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, 0x7F } ); assertEquals( "2.72057594037927855", oid.toString() ); oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); oid = Oid.fromBytes( new byte[] { (byte)0x81, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, 0x00 } ); assertEquals( "2.72057594037927856", oid.toString() ); oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); // The second arc is below and equal to 9223372036854775728 : 0x8000000000000000 - 0x50 oid = Oid.fromBytes( new byte[] { (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, 0x7F } ); assertEquals( "2.9223372036854775727", oid.toString() ); oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); oid = Oid.fromBytes( new byte[] { (byte)0x81, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80, 0x00 } ); assertEquals( "2.9223372036854775728", oid.toString() ); oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); // Check for 9999999999999999999 which is higher than Long.MAX_VALUE oid = Oid.fromBytes( new byte[] { (byte)0x81, (byte)0x8A, (byte)0xE3, (byte)0xC8, (byte)0xE0, (byte)0xC8, (byte)0xCF, (byte)0xA0, (byte)0x80, 0x4F } ); assertEquals( "2.9999999999999999999", oid.toString() ) ; oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); // A bigger one oid = Oid.fromBytes( new byte[] { (byte)0xFA, (byte)0xBE, (byte)0xB7, (byte)0xA2, (byte)0x8E, (byte)0xF4, (byte)0xC0, (byte)0xC7, (byte)0xCB, (byte)0x9F, (byte)0xA0, (byte)0xC5, (byte)0xEA, (byte)0xDA, (byte)0x92, (byte)0x9D, (byte)0x9E, 0x0C } ); assertEquals( "2.81407072025111374527560065493494091452", oid.toString() ); oid1 = Oid.fromString( oid.toString() ); assertEquals( oid, oid1 ); } @Test public void test2dot123456() throws DecoderException { String expectedString = "2.123456"; byte[] expectedBytes = new byte[] { ( byte ) 0x87, ( byte ) 0xC5, 0x10 }; assertTrue( Arrays.equals( expectedBytes, Oid.fromBytes( expectedBytes ).toBytes() ) ); assertTrue( Arrays.equals( expectedBytes, Oid.fromString( expectedString ).toBytes() ) ); assertEquals( expectedString, Oid.fromBytes( expectedBytes ).toString() ); assertEquals( expectedString, Oid.fromString( expectedString ).toString() ); } /** Hex chars */ private static final byte[] HEX_CHAR = new byte[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; /** * Helper function that dump an array of bytes in hex form * * @param buffer The bytes array to dump * @return A string representation of the array of bytes */ public static String dumpBytes( byte[] buffer ) { if ( buffer == null ) { return ""; } StringBuffer sb = new StringBuffer(); for ( int i = 0; i < buffer.length; i++ ) { sb.append( "0x" ).append( ( char ) ( HEX_CHAR[( buffer[i] & 0x00F0 ) >> 4] ) ).append( ( char ) ( HEX_CHAR[buffer[i] & 0x000F] ) ).append( " " ); } return sb.toString(); } @Test public void fromString() throws DecoderException { // first byte for ( int i = 0; i < 2; i++ ) { // [0..2] for ( int j = 0; j < 40; j++ ) { // [0..39] String oidStr = i + "." + j; byte[] expected = new byte[]{ ( byte ) ( i * 40 + j ) }; byte[] oidBytes = Oid.fromString( oidStr ).toBytes(); assertTrue( Arrays.equals( expected, oidBytes ) ); } } assertTrue( Arrays.equals( new byte[] { 0x2A, ( byte ) 0x86, 0x48, ( byte ) 0x86, ( byte ) 0xF7, 0x12, 0x01, 0x02, 0x02 }, Oid.fromString( "1.2.840.113554.1.2.2" ).toBytes() ) ); } /** * Test a null NewOid */ @Test public void testNewOidNull() { try { Oid.fromBytes( ( byte[] ) null ); fail( "Should not reach this point ..." ); } catch ( DecoderException de ) { assertTrue( true ); } } /** * Test an empty NewOid */ @Test public void testNewOidEmpty() { try { Oid.fromBytes( new byte[] {} ); fail( "Should not reach this point ..." ); } catch ( DecoderException de ) { assertTrue( true ); } } /** * Test itu-t NewOid tree */ @Test public void testNewOidItuT() { try { Oid oid = null; // itu-t(0), recommendation(0), series a-z (0..26) for ( int i = 1; i < 27; i++ ) { oid = Oid.fromBytes( new byte[] { 0x00, ( byte ) i } ); assertEquals( "0.0." + i, oid.toString() ); } // itu-t(0), question(1) oid = Oid.fromBytes( new byte[] { 0x01 } ); assertEquals( "0.1", oid.toString() ); // itu-t(0), administration(2), country(202 .. 748) for ( int i = 202; i < 748; i++ ) { oid = Oid.fromBytes( new byte[] { 0x02, ( byte ) ( ( i / 128 ) | 0x0080 ), ( byte ) ( i % 128 ) } ); assertEquals( "0.2." + i, oid.toString() ); } // itu-t(0), network-operator(3), operator(2023 .. 41363) for ( int i = 2023; i < 41363; i++ ) { if ( i < ( 128 * 128 ) ) { oid = Oid.fromBytes( new byte[] { 0x03, ( byte ) ( ( i / 128 ) | 0x0080 ), ( byte ) ( i % 128 ) } ); assertEquals( "0.3." + i, oid.toString() ); } else { oid = Oid.fromBytes( new byte[] { 0x03, ( byte ) ( ( i / ( 128 * 128 ) ) | 0x0080 ), ( byte ) ( ( ( i / 128 ) % 128 ) | 0x0080 ), ( byte ) ( i % 128 ) } ); assertEquals( "0.3." + i, oid.toString() ); } } } catch ( DecoderException de ) { fail(); } } /** * Test iso NewOid tree */ @Test public void testNewOidIso() { Oid oid = null; try { // iso(1), standard(0) oid = Oid.fromBytes( new byte[] { 40 + 0 } ); assertEquals( "1.0", oid.toString() ); // iso(1), registration-authority(1) oid = Oid.fromBytes( new byte[] { 40 + 1 } ); assertEquals( "1.1", oid.toString() ); // iso(1), member-body(2) oid = Oid.fromBytes( new byte[] { 40 + 2 } ); assertEquals( "1.2", oid.toString() ); // iso(1), identified-organization(3) | org(3) | organization(3) oid = Oid.fromBytes( new byte[] { 40 + 3 } ); assertEquals( "1.3", oid.toString() ); } catch ( DecoderException de ) { fail(); } } /** * Test joint-iso-itu-t NewOid tree */ @Test public void testNewOidJointIsoItuT() { Oid oid = null; try { // joint-iso-itu-t(2), presentation(0) oid = Oid.fromBytes( new byte[] { 80 + 0 } ); assertEquals( "2.0", oid.toString() ); // joint-iso-itu-t(2), asn1(1) oid = Oid.fromBytes( new byte[] { 80 + 1 } ); assertEquals( "2.1", oid.toString() ); // joint-iso-itu-t(2), association-control(2) oid = Oid.fromBytes( new byte[] { 80 + 2 } ); assertEquals( "2.2", oid.toString() ); // joint-iso-itu-t(2), reliable-transfer(3) oid = Oid.fromBytes( new byte[] { 80 + 3 } ); assertEquals( "2.3", oid.toString() ); // ... // joint-iso-itu-t(2), upu(40) oid = Oid.fromBytes( new byte[] { 80 + 40 } ); assertEquals( "2.40", oid.toString() ); // ... // joint-iso-itu-t(2), xxx(100) oid = Oid.fromBytes( new byte[] { ( byte ) ( 0x81 ), 0x34 } ); assertEquals( "2.100", oid.toString() ); } catch ( DecoderException de ) { fail(); } } /** * Test valid String NewOids */ @Test public void testNewOidStringGood() { Oid oid = null; try { oid = Oid.fromString( "0.0" ); assertEquals( "0.0", oid.toString() ); oid = Oid.fromString( "0.0.0.0.0" ); assertEquals( "0.0.0.0.0", oid.toString() ); oid = Oid.fromString( "0.1.2.3.4" ); assertEquals( "0.1.2.3.4", oid.toString() ); oid = Oid.fromString( "2.123456" ); assertEquals( "2.123456", oid.toString() ); oid = Oid.fromString( "1.2.840.113554.1.2.2" ); assertEquals( "1.2.840.113554.1.2.2", oid.toString() ); } catch ( DecoderException de ) { fail(); } } /** * Test invalid String NewOids */ @Test public void testNewOidStringBad() { assertFalse( Oid.isOid( "0" ) ); assertFalse( Oid.isOid( "1" ) ); assertFalse( Oid.isOid( "0." ) ); assertFalse( Oid.isOid( "1." ) ); assertFalse( Oid.isOid( "2." ) ); assertFalse( Oid.isOid( "2." ) ); assertFalse( Oid.isOid( "." ) ); assertFalse( Oid.isOid( "0.1.2." ) ); assertFalse( Oid.isOid( "3.1" ) ); assertFalse( Oid.isOid( "0..1" ) ); assertFalse( Oid.isOid( "0..12" ) ); assertFalse( Oid.isOid( "0.a.2" ) ); assertFalse( Oid.isOid( "0.40" ) ); assertFalse( Oid.isOid( "0.51" ) ); assertFalse( Oid.isOid( "0.01" ) ); assertFalse( Oid.isOid( "0.123456" ) ); assertFalse( Oid.isOid( "1.123456" ) ); } /** * Test Spnego NewOid */ @Test public void testNewOidSpnego() { Oid oid = null; try { oid = Oid.fromBytes( new byte[] { 0x2b, 0x06, 0x01, 0x05, 0x05, 0x02 } ); assertEquals( "1.3.6.1.5.5.2", oid.toString() ); } catch ( DecoderException de ) { fail(); } } /** * Test an OID with a node which does not fit in a long * @throws DecoderException If the test failed */ @Test public void testOidLongValue() throws DecoderException { // 2.0 -> expected 0x02 Oid oid = Oid.fromString( "2.0" ); byte[] oidBytes = oid.toBytes(); assertEquals( 1, oidBytes.length ); assertEquals( 80, oidBytes[0] ); Oid oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // 2.40 -> expected 0x78 oid = Oid.fromString( "2.40" ); oidBytes = oid.toBytes(); assertEquals( 1, oidBytes.length ); assertEquals( 0x78, oidBytes[0] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // 2.48 -> expected 0x80 oid = Oid.fromString( "2.48" ); oidBytes = oid.toBytes(); assertEquals( 2, oidBytes.length ); assertEquals( (byte)0x81, oidBytes[0] ); assertEquals( 0x00, oidBytes[1] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // The second arc is below and equal to 16304 : 0x4000 - 0x50 oid = Oid.fromString( "2.16303" ); oidBytes = oid.toBytes(); assertEquals( 2, oidBytes.length ); assertEquals( (byte)0xFF, oidBytes[0] ); assertEquals( 0x7F, oidBytes[1] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); oid = Oid.fromString( "2.16304" ); oidBytes = oid.toBytes(); assertEquals( 3, oidBytes.length ); assertEquals( (byte)0x81, oidBytes[0] ); assertEquals( (byte)0x80, oidBytes[1] ); assertEquals( 0x00, oidBytes[2] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // The second arc is below and equal to 2097072 : 0x200000 - 0x50 oid = Oid.fromString( "2.2097071" ); oidBytes = oid.toBytes(); assertEquals( 3, oidBytes.length ); assertEquals( (byte)0xFF, oidBytes[0] ); assertEquals( (byte)0xFF, oidBytes[1] ); assertEquals( 0x7F, oidBytes[2] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); oid = Oid.fromString( "2.2097072" ); oidBytes = oid.toBytes(); assertEquals( 4, oidBytes.length ); assertEquals( (byte)0x81, oidBytes[0] ); assertEquals( (byte)0x80, oidBytes[1] ); assertEquals( (byte)0x80, oidBytes[2] ); assertEquals( 0x00, oidBytes[3] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // The second arc is below and equal to 268435376 : 0x10000000 - 0x50 oid = Oid.fromString( "2.268435375" ); oidBytes = oid.toBytes(); assertEquals( 4, oidBytes.length ); assertEquals( (byte)0xFF, oidBytes[0] ); assertEquals( (byte)0xFF, oidBytes[1] ); assertEquals( (byte)0xFF, oidBytes[2] ); assertEquals( 0x7F, oidBytes[3] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); oid = Oid.fromString( "2.268435376" ); oidBytes = oid.toBytes(); assertEquals( 5, oidBytes.length ); assertEquals( (byte)0x81, oidBytes[0] ); assertEquals( (byte)0x80, oidBytes[1] ); assertEquals( (byte)0x80, oidBytes[2] ); assertEquals( (byte)0x80, oidBytes[3] ); assertEquals( 0x00, oidBytes[4] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // The second arc is below and equal to 34359738288 : 0x800000000 - 0x50 oid = Oid.fromString( "2.34359738287" ); oidBytes = oid.toBytes(); assertEquals( 5, oidBytes.length ); assertEquals( (byte)0xFF, oidBytes[0] ); assertEquals( (byte)0xFF, oidBytes[1] ); assertEquals( (byte)0xFF, oidBytes[2] ); assertEquals( (byte)0xFF, oidBytes[3] ); assertEquals( 0x7F, oidBytes[4] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); oid = Oid.fromString( "2.34359738288" ); oidBytes = oid.toBytes(); assertEquals( 6, oidBytes.length ); assertEquals( (byte)0x81, oidBytes[0] ); assertEquals( (byte)0x80, oidBytes[1] ); assertEquals( (byte)0x80, oidBytes[2] ); assertEquals( (byte)0x80, oidBytes[3] ); assertEquals( (byte)0x80, oidBytes[4] ); assertEquals( 0x00, oidBytes[5] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // The second arc is below and equal to 4398046511024 : 0x40000000000 - 0x50 oid = Oid.fromString( "2.4398046511023" ); oidBytes = oid.toBytes(); assertEquals( 6, oidBytes.length ); assertEquals( (byte)0xFF, oidBytes[0] ); assertEquals( (byte)0xFF, oidBytes[1] ); assertEquals( (byte)0xFF, oidBytes[2] ); assertEquals( (byte)0xFF, oidBytes[3] ); assertEquals( (byte)0xFF, oidBytes[4] ); assertEquals( 0x7F, oidBytes[5] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); oid = Oid.fromString( "2.4398046511024" ); oidBytes = oid.toBytes(); assertEquals( 7, oidBytes.length ); assertEquals( (byte)0x81, oidBytes[0] ); assertEquals( (byte)0x80, oidBytes[1] ); assertEquals( (byte)0x80, oidBytes[2] ); assertEquals( (byte)0x80, oidBytes[3] ); assertEquals( (byte)0x80, oidBytes[4] ); assertEquals( (byte)0x80, oidBytes[5] ); assertEquals( 0x00, oidBytes[6] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // The second arc is below and equal to 562949953421232 : 0x2000000000000 - 0x50 oid = Oid.fromString( "2.562949953421231" ); oidBytes = oid.toBytes(); assertEquals( 7, oidBytes.length ); assertEquals( (byte)0xFF, oidBytes[0] ); assertEquals( (byte)0xFF, oidBytes[1] ); assertEquals( (byte)0xFF, oidBytes[2] ); assertEquals( (byte)0xFF, oidBytes[3] ); assertEquals( (byte)0xFF, oidBytes[4] ); assertEquals( (byte)0xFF, oidBytes[5] ); assertEquals( 0x7F, oidBytes[6] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); oid = Oid.fromString( "2.562949953421232" ); oidBytes = oid.toBytes(); assertEquals( 8, oidBytes.length ); assertEquals( (byte)0x81, oidBytes[0] ); assertEquals( (byte)0x80, oidBytes[1] ); assertEquals( (byte)0x80, oidBytes[2] ); assertEquals( (byte)0x80, oidBytes[3] ); assertEquals( (byte)0x80, oidBytes[4] ); assertEquals( (byte)0x80, oidBytes[5] ); assertEquals( (byte)0x80, oidBytes[6] ); assertEquals( 0x00, oidBytes[7] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // The second arc is below and equal to 72057594037927856 : 0x100000000000000 - 0x50 oid = Oid.fromString( "2.72057594037927855" ); oidBytes = oid.toBytes(); assertEquals( 8, oidBytes.length ); assertEquals( (byte)0xFF, oidBytes[0] ); assertEquals( (byte)0xFF, oidBytes[1] ); assertEquals( (byte)0xFF, oidBytes[2] ); assertEquals( (byte)0xFF, oidBytes[3] ); assertEquals( (byte)0xFF, oidBytes[4] ); assertEquals( (byte)0xFF, oidBytes[5] ); assertEquals( (byte)0xFF, oidBytes[6] ); assertEquals( 0x7F, oidBytes[7] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); oid = Oid.fromString( "2.72057594037927856" ); oidBytes = oid.toBytes(); assertEquals( 9, oidBytes.length ); assertEquals( (byte)0x81, oidBytes[0] ); assertEquals( (byte)0x80, oidBytes[1] ); assertEquals( (byte)0x80, oidBytes[2] ); assertEquals( (byte)0x80, oidBytes[3] ); assertEquals( (byte)0x80, oidBytes[4] ); assertEquals( (byte)0x80, oidBytes[5] ); assertEquals( (byte)0x80, oidBytes[6] ); assertEquals( (byte)0x80, oidBytes[7] ); assertEquals( 0x00, oidBytes[8] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // The second arc is below and equal to 9223372036854775728 : 0x8000000000000000 - 0x50 oid = Oid.fromString( "2.9223372036854775727" ); oidBytes = oid.toBytes(); assertEquals( 9, oidBytes.length ); assertEquals( (byte)0xFF, oidBytes[0] ); assertEquals( (byte)0xFF, oidBytes[1] ); assertEquals( (byte)0xFF, oidBytes[2] ); assertEquals( (byte)0xFF, oidBytes[3] ); assertEquals( (byte)0xFF, oidBytes[4] ); assertEquals( (byte)0xFF, oidBytes[5] ); assertEquals( (byte)0xFF, oidBytes[6] ); assertEquals( (byte)0xFF, oidBytes[6] ); assertEquals( (byte)0xFF, oidBytes[7] ); assertEquals( 0x7F, oidBytes[8] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); oid = Oid.fromString( "2.9223372036854775728" ); oidBytes = oid.toBytes(); assertEquals( 10, oidBytes.length ); assertEquals( (byte)0x81, oidBytes[0] ); assertEquals( (byte)0x80, oidBytes[1] ); assertEquals( (byte)0x80, oidBytes[2] ); assertEquals( (byte)0x80, oidBytes[3] ); assertEquals( (byte)0x80, oidBytes[4] ); assertEquals( (byte)0x80, oidBytes[5] ); assertEquals( (byte)0x80, oidBytes[6] ); assertEquals( (byte)0x80, oidBytes[7] ); assertEquals( (byte)0x80, oidBytes[8] ); assertEquals( 0x00, oidBytes[9] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // Check for 9999999999999999999 which is higher than Long.MAX_VALUE oid = Oid.fromString( "2.9999999999999999999" ); oidBytes = oid.toBytes(); assertEquals( 10, oidBytes.length ); assertEquals( (byte)0x81, oidBytes[0] ); assertEquals( (byte)0x8A, oidBytes[1] ); assertEquals( (byte)0xE3, oidBytes[2] ); assertEquals( (byte)0xC8, oidBytes[3] ); assertEquals( (byte)0xE0, oidBytes[4] ); assertEquals( (byte)0xC8, oidBytes[5] ); assertEquals( (byte)0xCF, oidBytes[6] ); assertEquals( (byte)0xA0, oidBytes[7] ); assertEquals( (byte)0x80, oidBytes[8] ); assertEquals( (byte)0x4F, oidBytes[9] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); // A bigger one oid = Oid.fromString( "2.81407072025111374527560065493494091452" ); oidBytes = oid.toBytes(); assertEquals( 18, oidBytes.length ); assertEquals( (byte)0xFA, oidBytes[0] ); assertEquals( (byte)0xBE, oidBytes[1] ); assertEquals( (byte)0xB7, oidBytes[2] ); assertEquals( (byte)0xA2, oidBytes[3] ); assertEquals( (byte)0x8E, oidBytes[4] ); assertEquals( (byte)0xF4, oidBytes[5] ); assertEquals( (byte)0xC0, oidBytes[6] ); assertEquals( (byte)0xC7, oidBytes[7] ); assertEquals( (byte)0xCB, oidBytes[8] ); assertEquals( (byte)0x9F, oidBytes[9] ); assertEquals( (byte)0xA0, oidBytes[10] ); assertEquals( (byte)0xC5, oidBytes[11] ); assertEquals( (byte)0xEA, oidBytes[12] ); assertEquals( (byte)0xDA, oidBytes[13] ); assertEquals( (byte)0x92, oidBytes[14] ); assertEquals( (byte)0x9D, oidBytes[15] ); assertEquals( (byte)0x9E, oidBytes[16] ); assertEquals( (byte)0x0C, oidBytes[17] ); oid1 = Oid.fromBytes( oidBytes ); assertEquals( oid, oid1 ); } /** * Test an OID with 2 at the first position and a second node > 39 * @throws DecoderException If the test failed */ @Test public void testOidNode2() throws DecoderException { Oid oid = Oid.fromString( "2.12345" ); Oid oid2 = Oid.fromBytes( oid.toBytes() ); assertEquals( oid, oid2 ); } /** * Test Kerberos V5 NewOid */ @Test public void testNewOidKerberosV5() { Oid oid = null; try { oid = Oid.fromBytes( new byte[] { 0x2a, ( byte ) 0x86, 0x48, ( byte ) 0x86, ( byte ) 0xf7, 0x12, 0x01, 0x02, 0x02 } ); assertEquals( "1.2.840.113554.1.2.2", oid.toString() ); } catch ( DecoderException de ) { fail(); } } /** * Test NewOids bytes */ @Test public void testNewOidBytes() { Oid oid = null; Oid oid2 = null; try { oid = Oid.fromString( "0.0" ); oid2 = Oid.fromBytes( oid.toBytes() ); assertEquals( oid.toString(), oid2.toString() ); oid = Oid.fromString( "1.2.3.4.5" ); oid2 = Oid.fromBytes( oid.toBytes() ); assertEquals( oid.toString(), oid2.toString() ); oid = Oid.fromString( "0.1.2.3.4" ); assertTrue( Arrays.equals( new byte[] { 0x01, 0x02, 0x03, 0x04 }, oid.toBytes() ) ); oid2 = Oid.fromBytes( oid.toBytes() ); assertEquals( oid.toString(), oid2.toString() ); oid = Oid.fromString( "2.123456" ); oid2 = Oid.fromBytes( oid.toBytes() ); assertEquals( oid.toString(), oid2.toString() ); oid = Oid.fromString( "1.2.840.113554.1.2.2" ); oid2 = Oid.fromBytes( oid.toBytes() ); assertEquals( oid.toString(), oid2.toString() ); } catch ( DecoderException de ) { fail(); } } /** * Test NewOid Equals * @throws DecoderException If the test failed */ @Test public void testNewOidEqualsPerf() throws DecoderException { String s1 = "1.2.840.113554.1.2.2.1.2.840.113554.1.2.2.1.2.840.113554.1.2.2"; String s2 = "1.2.840.113554.1.2.2.1.2.840.113554.1.2.2.1.2.840.113554.1.2.2"; String s3 = "1.3.6.1.5.5.2"; Oid oid1 = Oid.fromString( s1 ); Oid oid2 = Oid.fromString( s2 ); Oid oid3 = Oid.fromString( s3 ); assertTrue( oid1.equals( oid2 ) ); assertFalse( oid1.equals( oid3 ) ); assertFalse( oid2.equals( oid3 ) ); } /** * A 14 bytes arc used to throw an ArrayIndexOutOfBoundsException, as the * decoding buffer was allocated one byte short (DIRAPI : nbBytes rounding) */ @Test public void fromBytes14ByteArc() throws DecoderException { byte[] arc14 = new byte[14]; arc14[0] = ( byte ) 0x81; for ( int i = 1; i < 13; i++ ) { arc14[i] = ( byte ) 0x80; } arc14[13] = 0x00; // 2^91 - 80 assertEquals( "2.2475880078570760549798248368", Oid.fromBytes( arc14 ).toString() ); } /** * A 16 bytes arc used to silently decode to a wrong value (8 low-order * bytes dropped) */ @Test public void fromBytes16ByteArc() throws DecoderException { byte[] arc16 = new byte[16]; arc16[0] = ( byte ) 0x81; for ( int i = 1; i < 15; i++ ) { arc16[i] = ( byte ) 0x80; } arc16[15] = 0x00; // 2^105 - 80 assertEquals( "2.40564819207303340847894502571952", Oid.fromBytes( arc16 ).toString() ); } /** * A multi-byte arc in second position used to decode to a wrong value : * the unpacking indexed the buffer from position 0 (first arc) instead of * the arc's own start offset */ @Test public void fromBytesBigSecondArc() throws DecoderException { byte[] bytes = new byte[11]; bytes[0] = 0x2A; // 1.2 bytes[1] = ( byte ) 0x81; for ( int i = 2; i < 10; i++ ) { bytes[i] = ( byte ) 0x80; } bytes[10] = 0x00; // 2^63 assertEquals( "1.2.9223372036854775808", Oid.fromBytes( bytes ).toString() ); } /** * A trailing byte with the continuation bit set is a truncated arc and * must be rejected, not silently discarded */ @Test public void fromBytesTruncatedArcIsRejected() { try { Oid.fromBytes( new byte[] { 0x2A, ( byte ) 0x86 } ); fail( "Truncated arc must be rejected" ); } catch ( DecoderException expected ) { // expected } } } apache-directory-ldap-api-cfb3cee/asn1/api/src/test/resources/000077500000000000000000000000001525525160600244605ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/api/src/test/resources/log4j.properties000077500000000000000000000023441525525160600276230ustar00rootroot00000000000000############################################################################# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ############################################################################# log4j.rootCategory=OFF, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n log4j.logger.org.apache.directory.api.asn1.util=DEBUG apache-directory-ldap-api-cfb3cee/asn1/ber/000077500000000000000000000000001525525160600206775ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/.gitignore000066400000000000000000000002501525525160600226640ustar00rootroot00000000000000target maven-eclipse.xml lib .externalToolBuilders felix-cache .project .classpath .settings eclipse-classes *.log *.iml *.ipr bin dependency-reduced-pom.xml META-INF apache-directory-ldap-api-cfb3cee/asn1/ber/pom.xml000066400000000000000000000074621525525160600222250ustar00rootroot00000000000000 4.0.0 org.apache.directory.api api-asn1-parent 2.1.9 api-asn1-ber Apache Directory API ASN.1 BER bundle A BER Codec Implementation for ASN.1 org.junit.jupiter junit-jupiter-engine test ${project.groupId} api-i18n ${project.groupId} api-asn1-api ${project.groupId} api-util org.slf4j slf4j-api org.apache.maven.plugins maven-jar-plugin META-INF/MANIFEST.MF false org.apache.felix maven-bundle-plugin true true META-INF ${project.groupId}.asn1.ber org.apache.directory.api.asn1.actions;version=${project.version};-noimport:=true, org.apache.directory.api.asn1.ber;version=${project.version};-noimport:=true, org.apache.directory.api.asn1.ber.grammar;version=${project.version};-noimport:=true, org.apache.directory.api.asn1.ber.tlv;version=${project.version};-noimport:=true org.apache.directory.api.asn1;version=${project.version}, org.apache.directory.api.asn1.util;version=${project.version}, org.apache.directory.api.i18n;version=${project.version}, org.apache.directory.api.util;version=${project.version}, org.slf4j;version=${slf4j.api.bundleversion} apache.directory.ldap.api.asn1.ber apache-directory-ldap-api-cfb3cee/asn1/ber/src/000077500000000000000000000000001525525160600214665ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/000077500000000000000000000000001525525160600224125ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/000077500000000000000000000000001525525160600233335ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/000077500000000000000000000000001525525160600241225ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/000077500000000000000000000000001525525160600253435ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/000077500000000000000000000000001525525160600273475ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/000077500000000000000000000000001525525160600301205ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/000077500000000000000000000000001525525160600307625ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/000077500000000000000000000000001525525160600324225ustar00rootroot00000000000000AbstractReadBitString.java000066400000000000000000000056111525525160600373760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.actions; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.ber.Asn1Container; import org.apache.directory.api.asn1.ber.grammar.GrammarAction; import org.apache.directory.api.asn1.ber.tlv.TLV; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The action used read a BITSTRING from a TLV * * @param The container type * * @author Apache Directory Project */ public abstract class AbstractReadBitString extends GrammarAction { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( AbstractReadBitString.class ); /** * Instantiates a new AbstractReadByteArray action. * * @param name the action's name */ public AbstractReadBitString( String name ) { super( name ); } /** * Gives a byte array to be set to the appropriate field of the ASN.1 object * present in the container * * @param data the data of the read TLV present in byte array format * @param container the container holding the ASN.1 object */ protected abstract void setBitString( byte[] data, C container ); /** * {@inheritDoc} */ @Override public final void action( C container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); // The Length should not be null, and should be 5 if ( tlv.getLength() != 5 ) { String msg = I18n.err( I18n.ERR_01100_INCORRECT_LENGTH, 5, tlv.getLength() ); LOG.error( msg ); // This will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } byte[] data = tlv.getValue().getData(); setBitString( data, container ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01101_BITSTRING_VALUE, Strings.dumpBytes( data ) ) ); } } } AbstractReadInteger.java000066400000000000000000000101311525525160600370570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.actions; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.ber.Asn1Container; import org.apache.directory.api.asn1.ber.grammar.GrammarAction; import org.apache.directory.api.asn1.ber.tlv.BerValue; import org.apache.directory.api.asn1.ber.tlv.IntegerDecoder; import org.apache.directory.api.asn1.ber.tlv.IntegerDecoderException; import org.apache.directory.api.asn1.ber.tlv.TLV; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The action used to read an integer value * * @param The container type * * @author Apache Directory Project */ public abstract class AbstractReadInteger extends GrammarAction { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( AbstractReadInteger.class ); /** the acceptable minimum value for the expected value to be parsed */ private int minValue = 0; /** the acceptable maximum value for the expected value to be parsed */ private int maxValue = Integer.MAX_VALUE; /** * Instantiates a new AbstractReadInteger action. * * @param name the action's name */ public AbstractReadInteger( String name ) { super( name ); } /** * * Creates a new instance of AbstractReadInteger. * * @param name the action's name * @param minValue the acceptable minimum value for the expected value to be read * @param maxValue the acceptable maximum value for the value to be read */ public AbstractReadInteger( String name, int minValue, int maxValue ) { super( name ); this.minValue = minValue; this.maxValue = maxValue; } /** * * set the integer value to the appropriate field of ASN.1 object present in the container * * @param value the integer value * @param container the ASN.1 object's container */ protected abstract void setIntegerValue( int value, E container ); /** * {@inheritDoc} */ @Override public final void action( E container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); // The Length should not be null if ( tlv.getLength() == 0 ) { String msg = I18n.err( I18n.ERR_01101_NULL_LENGTH ); LOG.error( msg ); // This will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } BerValue value = tlv.getValue(); try { int number = IntegerDecoder.parse( value, minValue, maxValue ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01100_INTEGER_VALUE, number ) ); } setIntegerValue( number, container ); } catch ( IllegalArgumentException | IntegerDecoderException e ) { LOG.error( I18n.err( I18n.ERR_01102_INVALID_INTEGER, Strings.dumpBytes( value.getData() ), e .getLocalizedMessage() ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( e.getMessage(), e ); } } } AbstractReadOctetString.java000066400000000000000000000067111525525160600377400ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.actions; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.ber.Asn1Container; import org.apache.directory.api.asn1.ber.grammar.GrammarAction; import org.apache.directory.api.asn1.ber.tlv.BerValue; import org.apache.directory.api.asn1.ber.tlv.TLV; import org.apache.directory.api.i18n.I18n; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The action used to read an OCTET STRING value * * @param The container type * * @author Apache Directory Project */ public abstract class AbstractReadOctetString extends GrammarAction { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( AbstractReadOctetString.class ); /** the acceptable maximum value for the expected value to be parsed */ private boolean canBeNull = Boolean.FALSE; /** * Instantiates a new AbstractReadInteger action. * * @param name the action's name */ public AbstractReadOctetString( String name ) { super( name ); } /** * Instantiates a new AbstractReadInteger action. * * @param name the action's name * @param canBeNull Tells if the byte array can be null or not */ public AbstractReadOctetString( String name, boolean canBeNull ) { super( name ); this.canBeNull = canBeNull; } /** * Sets the OCTET STRING value to the appropriate field of ASN.1 object present in the container * * @param value the OCTET STRING value * @param container the ASN.1 object's container */ protected abstract void setOctetString( byte[] value, C container ); /** * {@inheritDoc} */ @Override public final void action( C container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); // The Length should not be null if ( ( tlv.getLength() == 0 ) && ( !canBeNull ) ) { String msg = I18n.err( I18n.ERR_01101_NULL_LENGTH ); LOG.error( msg ); // This will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } BerValue value = tlv.getValue(); // The data should not be null if ( ( value.getData() == null ) && ( !canBeNull ) ) { String msg = I18n.err( I18n.ERR_01101_NULL_LENGTH ); LOG.error( msg ); // This will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } setOctetString( value.getData(), container ); } } CheckNotNullLength.java000066400000000000000000000042341525525160600367040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.actions; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.ber.Asn1Container; import org.apache.directory.api.asn1.ber.grammar.GrammarAction; import org.apache.directory.api.asn1.ber.tlv.TLV; import org.apache.directory.api.i18n.I18n; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * An action that checks the length is not null * * @param The container type * * @author Apache Directory Project */ public class CheckNotNullLength extends GrammarAction { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( CheckNotNullLength.class ); /** * Instantiates the action. */ public CheckNotNullLength() { super( "Check that the length is not null" ); } /** * {@inheritDoc} */ @Override public void action( C container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); // The Length should not be null if ( tlv.getLength() == 0 ) { String msg = I18n.err( I18n.ERR_01101_NULL_LENGTH ); LOG.error( msg ); // This will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } } } apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/000077500000000000000000000000001525525160600315325ustar00rootroot00000000000000AbstractContainer.java000066400000000000000000000167351525525160600357400ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber; import java.nio.Buffer; import java.nio.ByteBuffer; import org.apache.directory.api.asn1.ber.grammar.Grammar; import org.apache.directory.api.asn1.ber.grammar.States; import org.apache.directory.api.asn1.ber.tlv.TLV; import org.apache.directory.api.asn1.ber.tlv.TLVStateEnum; /** * This class is the abstract container used to store the current state of a PDU * being decoded. It also stores the grammars used to decode the PDU, and all * the informations needed to decode a PDU. * * @author Apache Directory Project */ public abstract class AbstractContainer implements Asn1Container { /** All the possible grammars */ private Grammar grammar; /** The current state of the decoding */ private TLVStateEnum state; /** The current transition */ private Enum transition; /** The current TLV */ private TLV tlv; /** The parent TLV */ private TLV parentTLV; /** The grammar end transition flag */ private boolean grammarEndAllowed; /** A counter for the decoded bytes */ private int decodedBytes; /** * The default maximum allowed size for a PDU: 8 MB. *

* A BER TLV declares the size of its value up-front and the decoder * allocates that amount of memory before a single value byte has been * received, so an unlimited default lets a hostile peer commit * gigabytes of heap with a ~20 byte PDU. Embedders that legitimately * exchange bigger PDUs can raise the limit with * {@link #setMaxPDUSize(int)} (passing a value <= 0 removes the * limit entirely). */ public static final int DEFAULT_MAX_PDU_SIZE = 8 * 1024 * 1024; /** The maximum allowed size for a PDU. Defaults to {@link #DEFAULT_MAX_PDU_SIZE} */ private int maxPDUSize = DEFAULT_MAX_PDU_SIZE; /** The incremental id used to tag TLVs */ private int id = 0; /** The Stream being decoded */ private ByteBuffer stream; /** A flag telling if the Value should be accumulated before being decoded * for constructed types */ private boolean gathering = false; /** * Creates a new instance of AbstractContainer with a starting state. * */ protected AbstractContainer() { state = TLVStateEnum.TAG_STATE_START; } /** * Creates a new instance of AbstractContainer with a starting state. * * @param stream the buffer containing the data to decode */ protected AbstractContainer( ByteBuffer stream ) { state = TLVStateEnum.TAG_STATE_START; this.stream = stream; } /** * {@inheritDoc} */ @Override public Grammar getGrammar() { return grammar; } /** * {@inheritDoc} */ @Override public void setGrammar( Grammar grammar ) { this.grammar = grammar; } /** * {@inheritDoc} */ @Override public TLVStateEnum getState() { return state; } /** * {@inheritDoc} */ @Override public void setState( TLVStateEnum state ) { this.state = state; } /** * {@inheritDoc} */ @Override public boolean isGrammarEndAllowed() { return grammarEndAllowed; } /** * {@inheritDoc} */ @Override public void setGrammarEndAllowed( boolean grammarEndAllowed ) { this.grammarEndAllowed = grammarEndAllowed; } /** * {@inheritDoc} */ @Override public Enum getTransition() { return transition; } /** * {@inheritDoc} */ @Override public void setTransition( Enum transition ) { this.transition = transition; } /** * {@inheritDoc} */ @Override public void setCurrentTLV( TLV currentTLV ) { this.tlv = currentTLV; } /** * {@inheritDoc} */ @Override public TLV getCurrentTLV() { return this.tlv; } /** * {@inheritDoc} */ @Override public TLV getParentTLV() { return parentTLV; } /** * {@inheritDoc} */ @Override public void setParentTLV( TLV parentTLV ) { this.parentTLV = parentTLV; } /** * Clean the container for the next usage. */ public void clean() { tlv = null; parentTLV = null; transition = ( ( States ) transition ).getStartState(); state = TLVStateEnum.TAG_STATE_START; } /** * {@inheritDoc} */ @Override public int getNewTlvId() { return id++; } /** * {@inheritDoc} */ @Override public int getTlvId() { return tlv.getId(); } /** * {@inheritDoc} */ @Override public int getDecodedBytes() { return decodedBytes; } /** * {@inheritDoc} */ @Override public void setDecodedBytes( int decodedBytes ) { this.decodedBytes = decodedBytes; } /** * {@inheritDoc} */ @Override public void incrementDecodedBytes( int nb ) { decodedBytes += nb; } /** * {@inheritDoc} */ @Override public int getMaxPDUSize() { return maxPDUSize; } /** * {@inheritDoc} */ @Override public void setMaxPDUSize( int maxPDUSize ) { if ( maxPDUSize > 0 ) { this.maxPDUSize = maxPDUSize; } else { this.maxPDUSize = Integer.MAX_VALUE; } } /** * {@inheritDoc} */ @Override public ByteBuffer getStream() { return stream; } /** * {@inheritDoc} */ @Override public void setStream( ByteBuffer stream ) { this.stream = stream; } /** * {@inheritDoc} */ @Override public void rewind() { int start = stream.position() - 1 - tlv.getLengthNbBytes(); ( ( Buffer ) stream ).position( start ); } /** * {@inheritDoc} */ @Override public void updateParent() { TLV parentTlv = tlv.getParent(); while ( ( parentTlv != null ) && ( parentTlv.getExpectedLength() == 0 ) ) { parentTlv = parentTlv.getParent(); } this.parentTLV = parentTlv; } /** * {@inheritDoc} */ @Override public boolean isGathering() { return gathering; } /** * {@inheritDoc} */ @Override public void setGathering( boolean gathering ) { this.gathering = gathering; } } Asn1Container.java000066400000000000000000000126551525525160600347740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber; import java.nio.ByteBuffer; import org.apache.directory.api.asn1.ber.grammar.Grammar; import org.apache.directory.api.asn1.ber.tlv.TLV; import org.apache.directory.api.asn1.ber.tlv.TLVStateEnum; /** * Every ASN1 container must implement this interface. * * @author Apache Directory Project */ public interface Asn1Container { /** * Gets the current stream containing the bytes to decode * * @return The current stream */ ByteBuffer getStream(); /** * Stores the Stream being decoded * * @param stream The stream being decoded */ void setStream( ByteBuffer stream ); /** * Gets the current grammar state * * @return Returns the current grammar state */ TLVStateEnum getState(); /** * Sets the new current state * * @param state The new state */ void setState( TLVStateEnum state ); /** * Gets the currentTLV * * @return Returns the current TLV being decoded */ TLV getCurrentTLV(); /** * Sets the current TLV * * @param tlv The current TLV */ void setCurrentTLV( TLV tlv ); /** * Gets the grammar * * @return Returns the grammar used to decode a LdapMessage. */ @SuppressWarnings("rawtypes") Grammar getGrammar(); /** * Sets the grammar * * @param grammar The grammar to set */ void setGrammar( Grammar grammar ); /** * Gets the transition * * @return Returns the transition from the previous state to the new state */ Enum getTransition(); /** * Updates the transition from a state to another * * @param transition The transition to set */ void setTransition( Enum transition ); /** * Get the parent's TLV * @return The parent TLV. */ TLV getParentTLV(); /** * Sets the parent TLV * * @param parentTLV The new parent TLV */ void setParentTLV( TLV parentTLV ); /** * Checks that we can have a end state after this transition * * @return true if this can be the last transition */ boolean isGrammarEndAllowed(); /** * Sets the flag to allow a end transition * * @param grammarEndAllowed true or false, depending on the next transition * being an end or not. */ void setGrammarEndAllowed( boolean grammarEndAllowed ); /** * Gets a new TLV id * @return a unique value representing the current TLV id */ int getNewTlvId(); /** * Gets the current TLV id * @return a unique value representing the current TLV id */ int getTlvId(); /** * Get the size of the decoded message * * @return The number of decoded bytes for this message. This is used * to control the PDU size and avoid PDU exceeding the maximum allowed * size to break the server. */ int getDecodedBytes(); /** * Set the size of the decoded messagz * * @param decodedBytes The number of decoded bytes for this message. */ void setDecodedBytes( int decodedBytes ); /** * Increment the decodedBytes by the latest received buffer's size. * * @param nb The buffer size. */ void incrementDecodedBytes( int nb ); /** * Get the maximum PDU size allowed * * @return The maximum PDU size. */ int getMaxPDUSize(); /** * Set the maximum PDU size. * * @param maxPDUSize The maximum PDU size (if negative or null, will be * replaced by the max integer value) */ void setMaxPDUSize( int maxPDUSize ); /** * Move backward in the stream to the first byte for a given TLV. This is useful when we have * read some Tag and Length in order to define the next transition, and if this transition * do a grammar switch. */ void rewind(); /** * Update the parent's length */ void updateParent(); /** * Tells if the decoding should be done immediately or if the container should gather the data before * * @return true if the container should gather the value into itself, false * if the decoding of the Value part should be done immediately for * constructed types. */ boolean isGathering(); /** * Set the isGathering flag * @param isGathering true to ask the Asn1Decoder to gather the data * into the container. If not set, the default value is 'false' */ void setGathering( boolean isGathering ); } Asn1Decoder.java000066400000000000000000000706561525525160600344240ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber; import java.nio.ByteBuffer; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.ber.tlv.BerValue; import org.apache.directory.api.asn1.ber.tlv.TLV; import org.apache.directory.api.asn1.ber.tlv.TLVBerDecoderMBean; import org.apache.directory.api.asn1.ber.tlv.TLVStateEnum; import org.apache.directory.api.asn1.util.Asn1StringUtils; import org.apache.directory.api.i18n.I18n; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * A BER TLV Tag component decoder. This decoder instantiate a Tag. The tag * won't be implementations should not copy the handle to the Tag object * delivered but should copy the data if they need it over the long term. * * @author Apache Directory Project */ public final class Asn1Decoder implements TLVBerDecoderMBean { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( Asn1Decoder.class ); /** This flag is used to indicate that there are more bytes in the stream */ private static final boolean MORE = true; /** This flag is used to indicate that there are no more bytes in the stream */ private static final boolean END = false; /** Flag that is used to allow/disallow the indefinite form of Length */ private boolean indefiniteLengthAllowed; /** The maximum number of bytes that could be used to encode the Length */ private int maxLengthLength; /** The maximum number of bytes that could be used to encode the Tag */ private int maxTagLength; /** * A public constructor of an Asn1 Decoder. */ private Asn1Decoder() { indefiniteLengthAllowed = false; maxLengthLength = 1; maxTagLength = 1; } /** * Treat the start of a TLV. It reads the tag and get its value. * * @param stream The ByteBuffer containing the PDU to decode * @param container The container that stores the current state, * the result and other informations. * @return true if there are more bytes to read, false * otherwise */ private static boolean treatTagStartState( ByteBuffer stream, Asn1Container container ) { if ( stream.hasRemaining() ) { byte octet = stream.get(); TLV tlv = new TLV( container.getNewTlvId() ); tlv.setTag( octet ); // Store the current TLV in the container. container.setCurrentTLV( tlv ); // Create a link between the current TLV with its parent tlv.setParent( container.getParentTLV() ); // Switch to the next state, which is the Length decoding container.setState( TLVStateEnum.LENGTH_STATE_START ); if ( LOG.isDebugEnabled() ) { byte tag = container.getCurrentTLV().getTag(); LOG.debug( I18n.msg( I18n.MSG_01000_TAG_DECODED, Asn1StringUtils.dumpByte( tag ) ) ); } return MORE; } else { // The stream has been exhausted return END; } } /** * Dump the current TLV tree * * @param container The container */ private static void dumpTLVTree( Asn1Container container ) { StringBuilder sb = new StringBuilder(); TLV current = container.getCurrentTLV(); sb.append( "TLV" ).append( Asn1StringUtils.dumpByte( current.getTag() ) ).append( "(" ).append( current.getExpectedLength() ).append( ")" ); current = current.getParent(); while ( current != null ) { sb.append( "-TLV" ).append( Asn1StringUtils.dumpByte( current.getTag() ) ).append( "(" ).append( current.getExpectedLength() ).append( ")" ); current = current.getParent(); } if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01001_TLV_TREE, sb.toString() ) ); } } /** * Check if the TLV tree is fully decoded * * @param container The container * @return true if the TLV has been decoded */ private static boolean isTLVDecoded( Asn1Container container ) { TLV current = container.getCurrentTLV(); TLV parent = current.getParent(); while ( parent != null ) { if ( parent.getExpectedLength() != 0 ) { return false; } parent = parent.getParent(); } BerValue value = current.getValue(); if ( ( value != null ) && ( value.getData() != null ) ) { return current.getExpectedLength() == value.getData().length; } else { return current.getExpectedLength() == 0; } } /** * Treat the Length start. The tag has been decoded, so we have to deal with * the LENGTH, which can be multi-bytes. * * @param stream The ByteBuffer containing the PDU to decode * @param container The container that stores the current state, * the result and other informations. * @return true if there are more bytes to read, false * otherwise * @throws DecoderException Thrown if anything went wrong */ private static boolean treatLengthStartState( ByteBuffer stream, Asn1Container container ) throws DecoderException { if ( stream.hasRemaining() ) { byte octet = stream.get(); TLV tlv = container.getCurrentTLV(); if ( ( octet & TLV.LENGTH_LONG_FORM ) == 0 ) { // We don't have a long form. The Length of the Value part is // given by this byte. tlv.setLength( octet ); tlv.setLengthNbBytes( 1 ); container.setState( TLVStateEnum.LENGTH_STATE_END ); } else if ( ( octet & TLV.LENGTH_EXTENSION_RESERVED ) != TLV.LENGTH_EXTENSION_RESERVED ) { int expectedLength = octet & TLV.LENGTH_SHORT_MASK; if ( expectedLength == 0 ) { // Octet 0x80 : the indefinite length form. It is not // supported by this decoder (LDAP, RFC 4511, requires the // definite form) : reject it instead of silently decoding // it as a zero length, which would make this decoder see // different message contents than a conforming BER parser. String msg = I18n.err( I18n.ERR_01009_INDEFINITE_LENGTH_NOT_SUPPORTED ); LOG.error( msg ); throw new DecoderException( msg ); } if ( expectedLength > 4 ) { String msg = I18n.err( I18n.ERR_01000_LENGTH_OVERFLOW ); LOG.error( msg ); throw new DecoderException( msg ); } tlv.setLength( 0 ); tlv.setLengthNbBytes( 1 + expectedLength ); tlv.setLengthBytesRead( 1 ); container.setState( TLVStateEnum.LENGTH_STATE_PENDING ); } else { String msg = I18n.err( I18n.ERR_01001_LENGTH_EXTENSION_RESERVED ); LOG.error( msg ); throw new DecoderException( msg ); } return MORE; } else { return END; } } /** * This function is called when a Length is in the process of being decoded, * but the lack of bytes in the buffer stopped the process. * * @param stream The ByteBuffer containing the PDU to decode * @param container The container that stores the current state, * the result and other informations. * @return true if there are more bytes to read, false * otherwise * @throws DecoderException Thrown if anything went wrong */ private static boolean treatLengthPendingState( ByteBuffer stream, Asn1Container container ) throws DecoderException { if ( stream.hasRemaining() ) { TLV tlv = container.getCurrentTLV(); int length = tlv.getLength(); while ( tlv.getLengthBytesRead() < tlv.getLengthNbBytes() ) { byte octet = stream.get(); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01002_CURRENT_BYTE, Asn1StringUtils.dumpByte( octet ) ) ); } tlv.incLengthBytesRead(); length = ( length << 8 ) | ( octet & 0x00FF ); if ( length < 0 ) { String msg = I18n.err( I18n.ERR_01002_TLV_NULL ); LOG.error( msg ); throw new DecoderException( msg ); } if ( !stream.hasRemaining() ) { tlv.setLength( length ); if ( tlv.getLengthBytesRead() < tlv.getLengthNbBytes() ) { container.setState( TLVStateEnum.LENGTH_STATE_PENDING ); return END; } else { container.setState( TLVStateEnum.LENGTH_STATE_END ); return MORE; } } } tlv.setLength( length ); container.setState( TLVStateEnum.LENGTH_STATE_END ); return MORE; } else { return END; } } /** * A debug function used to dump the expected length stack. * * @param tlv The current TLV. * @return A string which represent the expected length stack. */ private static String getParentLength( TLV tlv ) { StringBuilder buffer = new StringBuilder(); buffer.append( "TLV expected length stack : " ); TLV currentTlv = tlv; while ( true ) { if ( currentTlv == null ) { buffer.append( " - null" ); break; } else { buffer.append( " - " ).append( currentTlv.getExpectedLength() ); } currentTlv = currentTlv.getParent(); } return buffer.toString(); } /** * The Length is fully decoded. We have to call an action to check the size. * * @param container The container that stores the current state, * the result and other informations. * @throws DecoderException Thrown if anything went wrong */ private static void treatLengthEndState( Asn1Container container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); if ( tlv == null ) { String msg = I18n.err( I18n.ERR_01002_TLV_NULL ); LOG.error( msg ); throw new DecoderException( msg ); } int length = tlv.getLength(); // Check we arent above the MAX PDU if ( length > container.getMaxPDUSize() ) { throw new DecoderException( I18n.err( I18n.ERR_01007_PDU_SIZE_TOO_LONG, length, container.getMaxPDUSize() ) ); } // We will check the length here. What we must control is // that the enclosing constructed TLV expected length is not // exceeded by the current TLV. TLV parentTLV = container.getParentTLV(); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01003_PARENT_LENGTH, getParentLength( parentTLV ) ) ); } if ( parentTLV == null ) { // This is the first TLV, so we can't check anything. We will // just store this TLV as the root of the PDU tlv.setExpectedLength( length ); container.setParentTLV( tlv ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01004_ROOT_TLV, Integer.valueOf( length ) ) ); } } else { // We have a parent, so we will check that its expected length is // not exceeded. int expectedLength = parentTLV.getExpectedLength(); // The TLV size (1 tag byte + length bytes + value length) is // computed in long arithmetic : for a hostile length close to // Integer.MAX_VALUE, TLV.getSize()'s int sum wraps negative, // which would bypass the containment check below and corrupt the // parent's expectedLength. long currentLength = 1L + tlv.getLengthNbBytes() + tlv.getLength(); if ( expectedLength < currentLength ) { // The expected length is lower than the Value length of the // current TLV. This is an error... if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01005_TLV, Integer.valueOf( expectedLength ), Long.valueOf( currentLength ) ) ); } throw new DecoderException( I18n.err( I18n.ERR_01003_VALUE_LENGTH_ABOVE_EXPECTED_LENGTH, Long .valueOf( currentLength ), Integer.valueOf( expectedLength ) ) ); } // deal with the particular case where expected length equal // the current length, which means that the parentTLV has been // completed. if ( expectedLength == currentLength ) { parentTLV.setExpectedLength( 0 ); // We also have to check that the current TLV is a constructed // one. // In this case, we have to switch from this parent TLV // to the parent's parent TLV. if ( tlv.isConstructed() ) { // here, we also have another special case : a // zero length TLV. We must then unstack all // the parents which length is null. if ( length == 0 ) { // We will set the parent to the first parentTLV which // expectedLength // is not null, and it will become the new parent TLV while ( parentTLV != null ) { if ( parentTLV.getExpectedLength() != 0 ) { // ok, we have an incomplete parent. we will // stop the recursion right here break; } else { parentTLV = parentTLV.getParent(); } } container.setParentTLV( parentTLV ); } else { // The new Parent TLV is this Constructed TLV container.setParentTLV( tlv ); } tlv.setParent( parentTLV ); tlv.setExpectedLength( length ); } else { tlv.setExpectedLength( length ); // It's over, the parent TLV has been completed. // Go back to the parent's parent TLV until we find // a tlv which is not complete. while ( parentTLV != null ) { if ( parentTLV.getExpectedLength() != 0 ) { // ok, we have an incomplete parent. we will // stop the recursion right here break; } else { parentTLV = parentTLV.getParent(); } } container.setParentTLV( parentTLV ); } } else { // Renew the expected Length. The cast is safe : currentLength // is > 0 and < expectedLength here, so the difference fits an int. parentTLV.setExpectedLength( ( int ) ( expectedLength - currentLength ) ); tlv.setExpectedLength( length ); if ( tlv.isConstructed() ) { // We have a constructed tag, so we must switch the // parentTLV tlv.setParent( parentTLV ); container.setParentTLV( tlv ); } } } if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01006_LENGTH_DECODED, Integer.valueOf( length ) ) ); } if ( length == 0 ) { // The length is 0, so we can't expect a value. container.setState( TLVStateEnum.TLV_STATE_DONE ); } else { // Go ahead and decode the value part container.setState( TLVStateEnum.VALUE_STATE_START ); } } /** * Treat the Value part. We will distinguish two cases : - if the Tag is a * Primitive one, we will get the value. - if the Tag is a Constructed one, * nothing will be done. * * @param stream The ByteBuffer containing the PDU to decode * @param container The container that stores the current state, * the result and other informations. * @return true if there are more bytes to read, false * otherwise */ private static boolean treatValueStartState( ByteBuffer stream, Asn1Container container ) { TLV currentTlv = container.getCurrentTLV(); if ( TLV.isConstructed( currentTlv.getTag() ) && !container.isGathering() ) { container.setState( TLVStateEnum.TLV_STATE_DONE ); return MORE; } else { int length = currentTlv.getLength(); int nbBytes = stream.remaining(); if ( nbBytes < length ) { currentTlv.getValue().init( length ); currentTlv.getValue().setData( stream ); container.setState( TLVStateEnum.VALUE_STATE_PENDING ); return END; } else { currentTlv.getValue().init( length ); stream.get( currentTlv.getValue().getData(), 0, length ); container.setState( TLVStateEnum.TLV_STATE_DONE ); return MORE; } } } /** * Treat a pending Value when we get more bytes in the buffer. * * @param stream The ByteBuffer containing the PDU to decode * @param container The container that stores the current state, * the result and other informations. * @return MORE if some bytes remain in the buffer when the * value has been decoded, END if whe still need to get some * more bytes. */ private static boolean treatValuePendingState( ByteBuffer stream, Asn1Container container ) { TLV currentTlv = container.getCurrentTLV(); int length = currentTlv.getLength(); int currentLength = currentTlv.getValue().getCurrentLength(); int nbBytes = stream.remaining(); if ( ( currentLength + nbBytes ) < length ) { currentTlv.getValue().addData( stream ); container.setState( TLVStateEnum.VALUE_STATE_PENDING ); return END; } else { int remaining = length - currentLength; byte[] data = new byte[remaining]; stream.get( data, 0, remaining ); currentTlv.getValue().addData( data ); container.setState( TLVStateEnum.TLV_STATE_DONE ); return MORE; } } /** * When the TLV has been fully decoded, we have to execute the associated * action and switch to the next TLV, which will start with a Tag. * * @param stream The ByteBuffer containing the PDU to decode * @param container The container that stores the current state, * the result and other informations. * @return true if there are more bytes to read, false * otherwise * @throws DecoderException Thrown if anything went wrong */ @SuppressWarnings("unchecked") private static boolean treatTLVDoneState( ByteBuffer stream, Asn1Container container ) throws DecoderException { if ( LOG.isDebugEnabled() ) { dumpTLVTree( container ); } // First, we have to execute the associated action container.getGrammar().executeAction( container ); // Check if the PDU has been fully decoded. if ( isTLVDecoded( container ) ) { if ( container.getState() == TLVStateEnum.GRAMMAR_END ) { // Change the state to DECODED container.setState( TLVStateEnum.PDU_DECODED ); } else { if ( container.isGrammarEndAllowed() ) { // Change the state to DECODED container.setState( TLVStateEnum.PDU_DECODED ); } else { LOG.error( I18n.err( I18n.ERR_01004_MORE_TLV_EXPECTED ) ); throw new DecoderException( I18n.err( I18n.ERR_01005_TRUNCATED_PDU ) ); } } } else { // Then we switch to the Start tag state and free the current TLV container.setState( TLVStateEnum.TAG_STATE_START ); } return stream.hasRemaining(); } /** * The decoder main function. This is where we read bytes from the stream * and go through the automaton. It's an inifnite loop which stop when no * more bytes are to be read. It can occurs if the ByteBuffer is exhausted * or if the PDU has been fully decoded. * * @param stream The ByteBuffer containing the PDU to decode * @param container The container that store the state, the result * and other elements. * @throws DecoderException Thrown if anything went wrong! */ public static void decode( ByteBuffer stream, Asn1Container container ) throws DecoderException { /* * We have to deal with the current state. This is an infinite loop, * which will stop for any of these reasons : * - STATE_END has been reached (hopefully, the most frequent case) * - buffer is empty (it could happen) * - STATE_OVERFLOW : bad situation ! The PDU may be a * malevolous hand crafted ones, that try to "kill" our decoder. We * must log it with all information to track back this case, and punish * the guilty ! */ boolean hasRemaining = stream.hasRemaining(); // Increment the PDU size counter. container.incrementDecodedBytes( stream.remaining() ); if ( container.getDecodedBytes() > container.getMaxPDUSize() ) { String message = I18n.err( I18n.ERR_01007_PDU_SIZE_TOO_LONG, container.getDecodedBytes(), container .getMaxPDUSize() ); LOG.error( message ); throw new DecoderException( message ); } if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01007_LINE_SEPARATOR1 ) ); LOG.debug( I18n.msg( I18n.MSG_01011_DECODING_PDU ) ); LOG.debug( I18n.msg( I18n.MSG_01008_LINE_SEPARATOR2 ) ); } while ( hasRemaining ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01012_STATE, container.getState() ) ); if ( stream.hasRemaining() ) { byte octet = stream.get( stream.position() ); LOG.debug( I18n.msg( I18n.MSG_01013_CURRENT_BYTE, Asn1StringUtils.dumpByte( octet ) ) ); } else { LOG.debug( I18n.msg( I18n.MSG_01014_NO_MORE_BYTE ) ); } } switch ( container.getState() ) { case TAG_STATE_START: // Reset the GrammarEnd flag first container.setGrammarEndAllowed( false ); hasRemaining = treatTagStartState( stream, container ); break; case LENGTH_STATE_START: hasRemaining = treatLengthStartState( stream, container ); break; case LENGTH_STATE_PENDING: hasRemaining = treatLengthPendingState( stream, container ); break; case LENGTH_STATE_END: treatLengthEndState( container ); break; case VALUE_STATE_START: hasRemaining = treatValueStartState( stream, container ); break; case VALUE_STATE_PENDING: hasRemaining = treatValuePendingState( stream, container ); break; case VALUE_STATE_END: hasRemaining = stream.hasRemaining(); // Nothing to do. We will never reach this state break; case TLV_STATE_DONE: hasRemaining = treatTLVDoneState( stream, container ); break; case PDU_DECODED: // We have to deal with the case where there are // more bytes in the buffer, but the PDU has been decoded. if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.err( I18n.ERR_01008_REMAINING_BYTES_FOR_DECODED_PDU ) ); } hasRemaining = false; break; default: break; } } if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_01009_LINE_SEPARATOR3 ) ); if ( container.getState() == TLVStateEnum.PDU_DECODED ) { if ( container.getCurrentTLV() != null ) { LOG.debug( I18n.msg( I18n.MSG_01015_STOP_DECODING, container.getCurrentTLV().toString() ) ); } else { LOG.debug( I18n.msg( I18n.MSG_01016_STOP_DECODING_NULL_TLV ) ); } } else { if ( container.getCurrentTLV() != null ) { LOG.debug( I18n.msg( I18n.MSG_01017_END_DECODING, container.getCurrentTLV().toString() ) ); } else { LOG.debug( I18n.msg( I18n.MSG_01018_END_DECODING_NULL_TLV ) ); } } LOG.debug( I18n.msg( I18n.MSG_01010_LINE_SEPARATOR4 ) ); } } /** * {@inheritDoc} */ @Override public int getMaxLengthLength() { return maxLengthLength; } /** * {@inheritDoc} */ @Override public int getMaxTagLength() { return maxTagLength; } /** * {@inheritDoc} */ @Override public boolean isIndefiniteLengthAllowed() { return indefiniteLengthAllowed; } } apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/000077500000000000000000000000001525525160600331605ustar00rootroot00000000000000AbstractGrammar.java000066400000000000000000000116241525525160600370220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.grammar; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.ber.Asn1Container; import org.apache.directory.api.asn1.ber.tlv.TLV; import org.apache.directory.api.asn1.util.Asn1StringUtils; import org.apache.directory.api.i18n.I18n; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The abstract Grammar which is the Mother of all the grammars. It contains * the transitions table. * * @param The container type * * @author Apache Directory Project */ public abstract class AbstractGrammar implements Grammar { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( AbstractGrammar.class ); /** * Table of transitions. It's a two dimension array, the first dimension * indices the states, the second dimension indices the Tag value, so it is * 256 wide. */ protected GrammarTransition[][] transitions; /** The grammar name */ private String name; /** Default constructor */ public AbstractGrammar() { // Nothing to do } /** * {@inheritDoc} */ @Override public String getName() { return name; } /** * {@inheritDoc} */ @Override public void setName( String name ) { this.name = name; } /** * Get the transition associated with the state and tag * * @param state The current state * @param tag The current tag * @return A valid transition if any, or null. */ public GrammarTransition getTransition( Enum state, int tag ) { return transitions[state.ordinal()][tag & 0x00FF]; } /** * {@inheritDoc} */ @Override public void executeAction( C container ) throws DecoderException { Enum currentState = container.getTransition(); // We have to deal with the special case of a GRAMMAR_END state if ( ( ( States ) currentState ).isEndState() ) { return; } byte tagByte = container.getCurrentTLV().getTag(); // We will loop until no more actions are to be executed @SuppressWarnings("unchecked") GrammarTransition transition = ( ( AbstractGrammar ) container.getGrammar() ).getTransition( currentState, tagByte ); if ( LOG.isDebugEnabled() ) { LOG.debug( "-------------------------------------" ); LOG.debug( transition.toString() ); LOG.debug( "C: " ); LOG.debug( container.getCurrentTLV().toString() ); TLV parent = container.getCurrentTLV().getParent(); while ( parent != null ) { LOG.debug( "P: " ); LOG.debug( parent.toString() ); parent = parent.getParent(); } } TLV parent = container.getCurrentTLV().getParent(); if ( transition == null ) { String errorMessage = I18n.err( I18n.ERR_01200_BAD_TRANSITION_FROM_STATE, currentState, Asn1StringUtils.dumpByte( tagByte ) ); LOG.error( errorMessage ); // If we have no more grammar on the stack, then this is an // error throw new DecoderException( errorMessage ); } if ( LOG.isDebugEnabled() ) { LOG.debug( transition.toString() ); } if ( transition.hasAction() ) { Action action = transition.getAction(); action.action( container ); } if ( ( parent != null ) && ( parent.getExpectedLength() == 0 ) && transition.hasFollowUp() ) { String errorMessage = I18n.err( I18n.ERR_01201_MANDATORY_TRANSITION_EXPECTED, transition ); LOG.error( errorMessage ); throw new DecoderException( errorMessage ); } container.setTransition( transition.getCurrentState() ); } } Action.java000066400000000000000000000030051525525160600351570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.grammar; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.ber.Asn1Container; /** * Action interface just contains the method 'action' which must be implemented * in all the implementing classes. * * @param The container type * * @author Apache Directory Project */ public interface Action { /** * The action to be executed. * * @param container The container which stores the current data * @throws DecoderException Thrown if something went wrong. */ void action( C container ) throws DecoderException; } Grammar.java000066400000000000000000000040551525525160600353360ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.grammar; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.ber.Asn1Container; /** * The interface which expose common behavior of a Grammar implementer. * * @param The container type * * @author Apache Directory Project */ public interface Grammar { /** The flag used to tell if a given state must have a follow up in the same PDU or not */ enum FollowUp { /** When a following state is mandatory */ MANDATORY, /** When a following state is optional */ OPTIONAL; } /** * This method, when called, execute an action on the current data stored in * the container. * * @param asn1Container Store the data being processed. * @throws DecoderException Thrown when an unrecoverable error occurs. */ void executeAction( C asn1Container ) throws DecoderException; /** * Get the grammar name * * @return Return the grammar's name */ String getName(); /** * Set the grammar's name * * @param name The grammar name */ void setName( String name ); } GrammarAction.java000066400000000000000000000034171525525160600364750ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.grammar; import org.apache.directory.api.asn1.ber.Asn1Container; /** * A top level grammar class that store meta informations about the actions. * Those informations are not mandatory, but they can be useful for debugging. * * @param The container type * * @author Apache Directory Project */ public abstract class GrammarAction implements Action { /** The action's name */ protected String name; /** A default constructor */ public GrammarAction() { } /** * Creates a new GrammarAction object. * * @param name The name of the grammar action */ public GrammarAction( String name ) { this.name = name; } /** * Prints the action's name * * @return The action's name */ @Override public String toString() { return name; } } GrammarTransition.java000066400000000000000000000142501525525160600374070ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.grammar; import org.apache.directory.api.asn1.ber.Asn1Container; import org.apache.directory.api.asn1.ber.grammar.Grammar.FollowUp; import org.apache.directory.api.asn1.ber.tlv.UniversalTag; import org.apache.directory.api.asn1.util.Asn1StringUtils; /** * Define a transition between two states of a grammar. It stores the next * state, and the action to execute while executing the transition. * * @param The container type * * @author Apache Directory Project */ public class GrammarTransition { /** The action associated to the transition */ private Action action; /** The previous state */ private Enum previousState; /** The current state */ private Enum currentState; /** The current tag */ private int currentTag; /** Tells if the current TLV has a follow up or not for a given PDU */ private FollowUp followUp; /** * Creates a new GrammarTransition object. * * @param previousState the previous state * @param currentState The current state * @param currentTag the current TLV's tag * @param action The action to execute. It could be null. * @param followUp if the current TLV has a follow up in the current PDU */ public GrammarTransition( Enum previousState, Enum currentState, int currentTag, Action action, FollowUp followUp ) { this.previousState = previousState; this.currentState = currentState; this.action = action; this.currentTag = currentTag; this.followUp = followUp; } /** * Creates a new GrammarTransition object. * * @param previousState the previous state * @param currentState The current state * @param currentTag the current TLV's tag * @param followUp if the current TLV has a follow up in the current PDU */ public GrammarTransition( Enum previousState, Enum currentState, int currentTag, FollowUp followUp ) { this.previousState = previousState; this.currentState = currentState; this.currentTag = currentTag; this.followUp = followUp; } /** * Creates a new GrammarTransition object. * * @param previousState the previous state * @param currentState The current state * @param currentTag the current TLV's tag * @param action The action to execute. It could be null. * @param followUp if the current TLV has a follow up in the current PDU */ public GrammarTransition( Enum previousState, Enum currentState, UniversalTag currentTag, Action action, FollowUp followUp ) { this.previousState = previousState; this.currentState = currentState; this.action = action; this.currentTag = currentTag.getValue(); this.followUp = followUp; } /** * Creates a new GrammarTransition object. * * @param previousState the previous state * @param currentState The current state * @param currentTag the current TLV's tag * @param followUp if the current TLV has a follow up in the current PDU */ public GrammarTransition( Enum previousState, Enum currentState, UniversalTag currentTag, FollowUp followUp ) { this.previousState = previousState; this.currentState = currentState; this.currentTag = currentTag.getValue(); this.followUp = followUp; } /** * Tells if the transition has an associated action. * * @return true if an action has been associated to the transition */ public boolean hasAction() { return action != null; } /** * Get the transition's action * * @return Returns the action associated with the transition */ public Action getAction() { return action; } /** * Get the current state * * @return The current state */ public Enum getCurrentState() { return currentState; } /** * Get the previous state * * @return The previous state */ public Enum getPreviousState() { return previousState; } /** * Get the followUp flag * * @return the followUp flag */ public boolean hasFollowUp() { return followUp == FollowUp.MANDATORY; } /** * Set the followUp flag * * @param followUp the followUp flag to set */ public void setFollowUp( FollowUp followUp ) { this.followUp = followUp; } /** * @return A representation of the transition as a string. */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( "Transition from state <" ).append( previousState ).append( "> " ); sb.append( "to state <" ).append( currentState ).append( ">, " ); sb.append( "tag <" ).append( Asn1StringUtils.dumpByte( ( byte ) currentTag ) ).append( ">, " ); sb.append( "action : " ); if ( action == null ) { sb.append( "no action" ); } else { sb.append( action ); } if ( FollowUp.MANDATORY == followUp ) { sb.append( ", mandatory follow up" ); } return sb.toString(); } } States.java000066400000000000000000000024601525525160600352110ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.grammar; /** * Interface to get custom function from enum when casting. * * @author Apache Directory Project */ public interface States { /** * Tells if this is an end state * * @return True if this is the END_STATE */ boolean isEndState(); /** * Get the starting state * * @return The START_STATE of the enum */ Enum getStartState(); } apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/000077500000000000000000000000001525525160600323375ustar00rootroot00000000000000BerValue.java000066400000000000000000001143141525525160600346340ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import org.apache.directory.api.asn1.EncoderException; import org.apache.directory.api.asn1.util.Asn1Buffer; import org.apache.directory.api.asn1.util.Asn1StringUtils; import org.apache.directory.api.asn1.util.BitString; import org.apache.directory.api.asn1.util.Oid; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.util.Strings; /** * This class stores the data decoded from a TLV. * * @author Apache Directory Project */ public class BerValue { /** The data buffer. */ private byte[] data; /** The current position of the last byte in the data buffer */ private int currentPos; /** The encoded byte for a TRUE value */ public static final byte TRUE_VALUE = ( byte ) 0xFF; /** The encoded byte for a FALSE value */ public static final byte FALSE_VALUE = ( byte ) 0x00; /** Pre-encoded PDUs for a TRUE TLV */ private static final byte[] ENCODED_TRUE = new byte[] { 0x01, 0x01, TRUE_VALUE }; /** Pre-encoded PDUs for a FALSE TLV */ private static final byte[] ENCODED_FALSE = new byte[] { 0x01, 0x01, FALSE_VALUE }; /** Integer limits for encoding : 0x7F */ private static final int ONE_BYTE_MAX = ( 1 << 7 ) - 1; /** Integer limits for encoding : -0x7F */ private static final int ONE_BYTE_MIN = -( 1 << 7 ); /** Integer limits for encoding : 0x7FFF */ private static final int TWO_BYTE_MAX = ( 1 << 15 ) - 1; /** Integer limits for encoding : -0x7FFF */ private static final int TWO_BYTE_MIN = -( 1 << 15 ); /** Integer limits for encoding : 0x7FFFFF */ private static final int THREE_BYTE_MAX = ( 1 << 23 ) - 1; /** Integer limits for encoding : -0x7FFFFF */ private static final int THREE_BYTE_MIN = -( 1 << 23 ); /** Integer limits for encoding : 0x7FFFFFFF */ private static final long FOUR_BYTE_MAX = ( 1L << 31 ) - 1L; /** Integer limits for encoding : -0x7FFFFFFF */ private static final long FOUR_BYTE_MIN = -( 1L << 31 ); /** Integer limits for encoding : 0x7FFFFFFFFF */ private static final long FIVE_BYTE_MAX = ( 1L << 39 ) - 1L; /** Integer limits for encoding : -0x7FFFFFFFFF */ private static final long FIVE_BYTE_MIN = -( 1L << 39 ); /** Integer limits for encoding : 0x7FFFFFFFFFFF */ private static final long SIX_BYTE_MAX = ( 1L << 47 ) - 1L; /** Integer limits for encoding : -0x7FFFFFFFFFFF */ private static final long SIX_BYTE_MIN = -( 1L << 47 ); /** Integer limits for encoding : 0x7FFFFFFFFFFF */ private static final long SEVEN_BYTE_MAX = ( 1L << 55 ) - 1L; /** Integer limits for encoding : -0x7FFFFFFFFFFF */ private static final long SEVEN_BYTE_MIN = -( 1L << 55 ); /** * Creates a new Value from a byte[] * * @param value the associated value */ public BerValue( byte[] value ) { // Do a copy of the byte array data = new byte[value.length]; System.arraycopy( value, 0, data, 0, value.length ); currentPos = 0; } /** * The default constructor. */ public BerValue() { data = null; currentPos = 0; } /** * Initialize the Value * * @param size The data size to allocate. */ public void init( int size ) { data = new byte[size]; currentPos = 0; } /** * Reset the Value so that it can be reused */ public void reset() { data = null; currentPos = 0; } /** * Get the Values'data * * @return Returns the data. */ public byte[] getData() { return data; } /** * Set a block of bytes in the Value * * @param data The data to set. */ public void setData( ByteBuffer data ) { int length = data.remaining(); data.get( this.data, 0, length ); currentPos = length; } /** * Append some bytes to the data buffer. * * @param buffer The data to append. */ public void addData( ByteBuffer buffer ) { int length = buffer.remaining(); buffer.get( data, currentPos, length ); currentPos += length; } /** * Set a block of bytes in the Value * * @param data The data to set. */ public void setData( byte[] data ) { System.arraycopy( data, 0, this.data, 0, data.length ); currentPos = data.length; } /** * Append some bytes to the data buffer. * * @param array The data to append. */ public void addData( byte[] array ) { System.arraycopy( array, 0, this.data, currentPos, array.length ); currentPos = array.length; } /** * Get the current length * * @return The number of bytes actually stored */ public int getCurrentLength() { return currentPos; } /** * Utility function that return the number of bytes necessary to store an * integer value. Note that this value must be in [Integer.MIN_VALUE, * Integer.MAX_VALUE]. * * @param value The value to store in a byte array * @return The number of bytes necessary to store the value. */ public static int getNbBytes( int value ) { if ( ( value >= ONE_BYTE_MIN ) && ( value <= ONE_BYTE_MAX ) ) { return 1; } else if ( ( value >= TWO_BYTE_MIN ) && ( value <= TWO_BYTE_MAX ) ) { return 2; } else if ( ( value >= THREE_BYTE_MIN ) && ( value <= THREE_BYTE_MAX ) ) { return 3; } else { return 4; } } /** * Utility function that return the number of bytes necessary to store a * long value. Note that this value must be in [Long.MIN_VALUE, * Long.MAX_VALUE]. * * @param value The value to store in a byte array * @return The number of bytes necessary to store the value. */ public static int getNbBytes( long value ) { if ( ( value >= ONE_BYTE_MIN ) && ( value <= ONE_BYTE_MAX ) ) { return 1; } else if ( ( value >= TWO_BYTE_MIN ) && ( value <= TWO_BYTE_MAX ) ) { return 2; } else if ( ( value >= THREE_BYTE_MIN ) && ( value <= THREE_BYTE_MAX ) ) { return 3; } else if ( ( value >= FOUR_BYTE_MIN ) && ( value <= FOUR_BYTE_MAX ) ) { return 4; } else if ( ( value >= FIVE_BYTE_MIN ) && ( value <= FIVE_BYTE_MAX ) ) { return 5; } else if ( ( value >= SIX_BYTE_MIN ) && ( value <= SIX_BYTE_MAX ) ) { return 6; } else if ( ( value >= SEVEN_BYTE_MIN ) && ( value <= SEVEN_BYTE_MAX ) ) { return 7; } else { return 8; } } /** * Utility function that return a byte array representing the Value We must * respect the ASN.1 BER encoding scheme : *

     * 1) positive integer
     * - [0 - 0x7F] : 0xVV
     * - [0x80 - 0xFF] : 0x00 0xVV
     * - [0x0100 - 0x7FFF] : 0xVV 0xVV
     * - [0x8000 - 0xFFFF] : 0x00 0xVV 0xVV
     * - [0x010000 - 0x7FFFFF] : 0xVV 0xVV 0xVV
     * - [0x800000 - 0xFFFFFF] : 0x00 0xVV 0xVV 0xVV
     * - [0x01000000 - 0x7FFFFFFF] : 0xVV 0xVV 0xVV 0xVV
     * 2) Negative number - (~value) + 1
     * 
* * @param value The value to store in a byte array * @return The byte array representing the value. */ public static byte[] getBytes( int value ) { byte[] bytes; if ( value >= 0 ) { if ( ( value >= 0 ) && ( value <= ONE_BYTE_MAX ) ) { bytes = new byte[1]; bytes[0] = ( byte ) value; } else if ( ( value > ONE_BYTE_MAX ) && ( value <= TWO_BYTE_MAX ) ) { bytes = new byte[2]; bytes[1] = ( byte ) value; bytes[0] = ( byte ) ( value >> 8 ); } else if ( ( value > TWO_BYTE_MAX ) && ( value <= THREE_BYTE_MAX ) ) { bytes = new byte[3]; bytes[2] = ( byte ) value; bytes[1] = ( byte ) ( value >> 8 ); bytes[0] = ( byte ) ( value >> 16 ); } else { bytes = new byte[4]; bytes[3] = ( byte ) value; bytes[2] = ( byte ) ( value >> 8 ); bytes[1] = ( byte ) ( value >> 16 ); bytes[0] = ( byte ) ( value >> 24 ); } } else { // On special case : 0x80000000 if ( value == 0x80000000 ) { bytes = new byte[4]; bytes[3] = ( byte ) value; bytes[2] = ( byte ) ( value >> 8 ); bytes[1] = ( byte ) ( value >> 16 ); bytes[0] = ( byte ) ( value >> 24 ); } else { // We have to compute the complement, and add 1 if ( value >= 0xFFFFFF80 ) { bytes = new byte[1]; bytes[0] = ( byte ) value; } else if ( value >= 0xFFFF8000 ) { bytes = new byte[2]; bytes[1] = ( byte ) ( value ); bytes[0] = ( byte ) ( value >> 8 ); } else if ( value >= 0xFF800000 ) { bytes = new byte[3]; bytes[2] = ( byte ) value; bytes[1] = ( byte ) ( value >> 8 ); bytes[0] = ( byte ) ( value >> 16 ); } else { bytes = new byte[4]; bytes[3] = ( byte ) value; bytes[2] = ( byte ) ( value >> 8 ); bytes[1] = ( byte ) ( value >> 16 ); bytes[0] = ( byte ) ( value >> 24 ); } } } return bytes; } /** * Utility function that return a byte array representing the Value. * We must respect the ASN.1 BER encoding scheme :
*
     * 1) positive integer
     * - [0 - 0x7F] : 0xVV
     * - [0x80 - 0xFF] : 0x00 0xVV
     * - [0x0100 - 0x7FFF] : 0xVV 0xVV
     * - [0x8000 - 0xFFFF] : 0x00 0xVV 0xVV
     * - [0x010000 - 0x7FFFFF] : 0xVV 0xVV 0xVV
     * - [0x800000 - 0xFFFFFF] : 0x00 0xVV 0xVV 0xVV
     * - [0x01000000 - 0x7FFFFFFF] : 0xVV 0xVV 0xVV 0xVV
     * 2) Negative number - (~value) + 1
     * 
* They are encoded following the table (the
* encode bytes are those enclosed by squared braquets) :
*
*
     *   -1                      -> FF FF FF FF FF FF FF [FF]
     *   -127                    -> FF FF FF FF FF FF FF [81]
     *   -128                    -> FF FF FF FF FF FF FF [80]
     *   -129                    -> FF FF FF FF FF FF [FF 7F]
     *   -255                    -> FF FF FF FF FF FF [FF 01]
     *   -256                    -> FF FF FF FF FF FF [FF 00]
     *   -257                    -> FF FF FF FF FF FF [FE FF]
     *   -32767                  -> FF FF FF FF FF FF [80 01]
     *   -32768                  -> FF FF FF FF FF FF [80 00]
     *   -32769                  -> FF FF FF FF FF [FF 7F FF]
     *   -65535                  -> FF FF FF FF FF [FF 00 01]
     *   -65536                  -> FF FF FF FF FF [FF 00 00]
     *   -65537                  -> FF FF FF FF FF [FE FF FF]
     *   -8388607                -> FF FF FF FF FF [80 00 01]
     *   -8388608                -> FF FF FF FF FF [80 00 00]
     *   -8388609                -> FF FF FF FF [FF 7F FF FF]
     *   -16777215               -> FF FF FF FF [FF 00 00 01]
     *   -16777216               -> FF FF FF FF [FF 00 00 00]
     *   -16777217               -> FF FF FF FF [FE FF FF FF]
     *   -2147483647             -> FF FF FF FF [80 00 00 01]
     *   -2147483648             -> FF FF FF FF [80 00 00 00]
     *   -2147483649             -> FF FF FF [FF 7F FF FF FF]
     *   -4294967295             -> FF FF FF [FF 00 00 00 01]
     *   -4294967296             -> FF FF FF [FF 00 00 00 00]
     *   -4294967297             -> FF FF FF [FE FF FF FF FF]
     *   -549755813887           -> FF FF FF [80 00 00 00 01]
     *   -549755813888           -> FF FF FF [80 00 00 00 00]
     *   -549755813889           -> FF FF [FF 7F FF FF FF FF]
     *   -1099511627775          -> FF FF [FF 00 00 00 00 01]
     *   -1099511627776          -> FF FF [FF 00 00 00 00 00]
     *   -1099511627777          -> FF FF [FE FF FF FF FF FF]
     *   -140737488355327        -> FF FF [80 00 00 00 00 01]
     *   -140737488355328        -> FF FF [80 00 00 00 00 00]
     *   -140737488355329        -> FF [FF 7F FF FF FF FF FF]
     *   -281474976710655        -> FF [FF 00 00 00 00 00 01]
     *   -281474976710656        -> FF [FF 00 00 00 00 00 00]
     *   -281474976710657        -> FF [FE FF FF FF FF FF FF]
     *   -36028797018963967      -> FF [80 00 00 00 00 00 01]
     *   -36028797018963968      -> FF [80 00 00 00 00 00 00]
     *   -36028797018963969      -> [FF 7F FF FF FF FF FF FF]
     *   -72057594037927936      -> [FF 00 00 00 00 00 00 00]
     *   -72057594037927937      -> [FE FF FF FF FF FF FF FF]
     *   -9223372036854775807    -> [80 00 00 00 00 00 00 01]
     *   -9223372036854775808    -> [80 00 00 00 00 00 00 00]
     * 
* @param value The value to store in a byte array * @return The byte array representing the value. */ public static byte[] getBytes( long value ) { byte[] bytes; if ( value >= 0 ) { if ( ( value >= 0 ) && ( value <= ONE_BYTE_MAX ) ) { bytes = new byte[1]; bytes[0] = ( byte ) value; } else if ( ( value > ONE_BYTE_MAX ) && ( value <= TWO_BYTE_MAX ) ) { bytes = new byte[2]; bytes[1] = ( byte ) value; bytes[0] = ( byte ) ( value >> 8 ); } else if ( ( value > TWO_BYTE_MAX ) && ( value <= THREE_BYTE_MAX ) ) { bytes = new byte[3]; bytes[2] = ( byte ) value; bytes[1] = ( byte ) ( value >> 8 ); bytes[0] = ( byte ) ( value >> 16 ); } else if ( ( value > THREE_BYTE_MAX ) && ( value <= FOUR_BYTE_MAX ) ) { bytes = new byte[4]; bytes[3] = ( byte ) value; bytes[2] = ( byte ) ( value >> 8 ); bytes[1] = ( byte ) ( value >> 16 ); bytes[0] = ( byte ) ( value >> 24 ); } else if ( ( value > FOUR_BYTE_MAX ) && ( value <= FIVE_BYTE_MAX ) ) { bytes = new byte[5]; bytes[4] = ( byte ) value; bytes[3] = ( byte ) ( value >> 8 ); bytes[2] = ( byte ) ( value >> 16 ); bytes[1] = ( byte ) ( value >> 24 ); bytes[0] = ( byte ) ( value >> 32 ); } else if ( ( value > FIVE_BYTE_MAX ) && ( value <= SIX_BYTE_MAX ) ) { bytes = new byte[6]; bytes[5] = ( byte ) value; bytes[4] = ( byte ) ( value >> 8 ); bytes[3] = ( byte ) ( value >> 16 ); bytes[2] = ( byte ) ( value >> 24 ); bytes[1] = ( byte ) ( value >> 32 ); bytes[0] = ( byte ) ( value >> 40 ); } else if ( ( value > SIX_BYTE_MAX ) && ( value <= SEVEN_BYTE_MAX ) ) { bytes = new byte[7]; bytes[6] = ( byte ) value; bytes[5] = ( byte ) ( value >> 8 ); bytes[4] = ( byte ) ( value >> 16 ); bytes[3] = ( byte ) ( value >> 24 ); bytes[2] = ( byte ) ( value >> 32 ); bytes[1] = ( byte ) ( value >> 40 ); bytes[0] = ( byte ) ( value >> 48 ); } else { bytes = new byte[8]; bytes[7] = ( byte ) value; bytes[6] = ( byte ) ( value >> 8 ); bytes[5] = ( byte ) ( value >> 16 ); bytes[4] = ( byte ) ( value >> 24 ); bytes[3] = ( byte ) ( value >> 32 ); bytes[2] = ( byte ) ( value >> 40 ); bytes[1] = ( byte ) ( value >> 48 ); bytes[0] = ( byte ) ( value >> 56 ); } } else { // On special case : 0x80000000 if ( value == 0x8000000000000000L ) { bytes = new byte[8]; bytes[7] = ( byte ) 0x00; bytes[6] = ( byte ) 0x00; bytes[5] = ( byte ) 0x00; bytes[4] = ( byte ) 0x00; bytes[3] = ( byte ) 0x00; bytes[2] = ( byte ) 0x00; bytes[1] = ( byte ) 0x00; bytes[0] = ( byte ) 0x80; } else { // We have to compute the complement, and add 1 if ( value >= 0xFFFFFFFFFFFFFF80L ) { bytes = new byte[1]; bytes[0] = ( byte ) value; } else if ( value >= 0xFFFFFFFFFFFF8000L ) { bytes = new byte[2]; bytes[1] = ( byte ) ( value ); bytes[0] = ( byte ) ( value >> 8 ); } else if ( value >= 0xFFFFFFFFFF800000L ) { bytes = new byte[3]; bytes[2] = ( byte ) value; bytes[1] = ( byte ) ( value >> 8 ); bytes[0] = ( byte ) ( value >> 16 ); } else if ( value >= 0xFFFFFFFF80000000L ) { bytes = new byte[4]; bytes[3] = ( byte ) value; bytes[2] = ( byte ) ( value >> 8 ); bytes[1] = ( byte ) ( value >> 16 ); bytes[0] = ( byte ) ( value >> 24 ); } else if ( value >= 0xFFFFFF8000000000L ) { bytes = new byte[5]; bytes[4] = ( byte ) value; bytes[3] = ( byte ) ( value >> 8 ); bytes[2] = ( byte ) ( value >> 16 ); bytes[1] = ( byte ) ( value >> 24 ); bytes[0] = ( byte ) ( value >> 32 ); } else if ( value >= 0xFFFF800000000000L ) { bytes = new byte[6]; bytes[5] = ( byte ) value; bytes[4] = ( byte ) ( value >> 8 ); bytes[3] = ( byte ) ( value >> 16 ); bytes[2] = ( byte ) ( value >> 24 ); bytes[1] = ( byte ) ( value >> 32 ); bytes[0] = ( byte ) ( value >> 40 ); } else if ( value >= 0xFF80000000000000L ) { bytes = new byte[7]; bytes[6] = ( byte ) value; bytes[5] = ( byte ) ( value >> 8 ); bytes[4] = ( byte ) ( value >> 16 ); bytes[3] = ( byte ) ( value >> 24 ); bytes[2] = ( byte ) ( value >> 32 ); bytes[1] = ( byte ) ( value >> 40 ); bytes[0] = ( byte ) ( value >> 48 ); } else { bytes = new byte[8]; bytes[7] = ( byte ) value; bytes[6] = ( byte ) ( value >> 8 ); bytes[5] = ( byte ) ( value >> 16 ); bytes[4] = ( byte ) ( value >> 24 ); bytes[3] = ( byte ) ( value >> 32 ); bytes[2] = ( byte ) ( value >> 40 ); bytes[1] = ( byte ) ( value >> 48 ); bytes[0] = ( byte ) ( value >> 56 ); } } } return bytes; } /** * Encode a boolean value * * @param buffer The PDU in which the value will be put * @param bool The boolean to be encoded */ public static void encodeBoolean( Asn1Buffer buffer, boolean bool ) { if ( bool ) { buffer.put( ENCODED_TRUE ); } else { buffer.put( ENCODED_FALSE ); } } /** * Encode a boolean value * * @param buffer The PDU in which the value will be put * @param tag the TAG to use * @param bool The boolean to be encoded */ public static void encodeBoolean( Asn1Buffer buffer, byte tag, boolean bool ) { if ( bool ) { buffer.put( TRUE_VALUE ); buffer.put( ( byte ) 0x01 ); buffer.put( tag ); } else { buffer.put( FALSE_VALUE ); buffer.put( ( byte ) 0x01 ); buffer.put( tag ); } } /** * Encode an integer value * * @param buffer The PDU in which the value will be put * @param value The integer to be encoded */ public static void encodeInteger( Asn1Buffer buffer, int value ) { buffer.put( getBytes( value ) ); buffer.put( ( byte ) getNbBytes( value ) ); buffer.put( UniversalTag.INTEGER.getValue() ); } /** * Encode an integer value, with a specific tag * * @param buffer The PDU in which the value will be put * @param tag The tag to use * @param value The integer to be encoded */ public static void encodeInteger( Asn1Buffer buffer, byte tag, int value ) { buffer.put( getBytes( value ) ); buffer.put( ( byte ) getNbBytes( value ) ); buffer.put( tag ); } /** * Encode an integer value * * @param buffer The PDU in which the value will be put * @param value The long to be encoded */ public static void encodeInteger( Asn1Buffer buffer, long value ) { buffer.put( getBytes( value ) ); buffer.put( ( byte ) getNbBytes( value ) ); buffer.put( UniversalTag.INTEGER.getValue() ); } /** * Encode an integer value, with a specific tag * * @param buffer The PDU in which the value will be put * @param tag The tag to use * @param value The long to be encoded */ public static void encodeInteger( Asn1Buffer buffer, byte tag, long value ) { buffer.put( getBytes( value ) ); buffer.put( ( byte ) getNbBytes( value ) ); buffer.put( tag ); } /** * Encode an OctetString * * @param buffer The PDU in which the value will be put * @param data The byte[] to be encoded */ public static void encodeOctetString( Asn1Buffer buffer, byte[] data ) { if ( Strings.isEmpty( data ) ) { buffer.put( ( byte ) 0 ); } else { buffer.put( data ); buffer.put( TLV.getBytes( data.length ) ); } buffer.put( UniversalTag.OCTET_STRING.getValue() ); } /** * Encode an OctetString * * @param buffer The PDU in which the value will be put * @param value The String to be encoded */ public static void encodeOctetString( Asn1Buffer buffer, String value ) { if ( Strings.isEmpty( value ) ) { buffer.put( ( byte ) 0 ); } else { byte[] bytes = Strings.getBytesUtf8Ascii( value ); buffer.put( bytes ); buffer.put( TLV.getBytes( bytes.length ) ); } buffer.put( UniversalTag.OCTET_STRING.getValue() ); } /** * Encode an OctetString * * @param buffer The PDU in which the value will be put * @param tag The tag to use * @param data The OctetString to be encoded */ public static void encodeOctetString( Asn1Buffer buffer, byte tag, byte[] data ) { if ( Strings.isEmpty( data ) ) { buffer.put( ( byte ) 0 ); } else { buffer.put( data ); buffer.put( TLV.getBytes( data.length ) ); } buffer.put( tag ); } /** * Encode an OctetString * * @param buffer The PDU in which the value will be put * @param tag The tag to use * @param value The OctetString to be encoded */ public static void encodeOctetString( Asn1Buffer buffer, byte tag, String value ) { if ( Strings.isEmpty( value ) ) { buffer.put( ( byte ) 0 ); } else { byte[] bytes = Strings.getBytesUtf8Ascii( value ); buffer.put( bytes ); buffer.put( TLV.getBytes( bytes.length ) ); } buffer.put( tag ); } /** * Encode a Sequence * * @param buffer The PDU in which the Sequence will be put */ public static void encodeSequence( Asn1Buffer buffer ) { buffer.put( TLV.getBytes( buffer.getPos() ) ); buffer.put( UniversalTag.SEQUENCE.getValue() ); } /** * Encode a Sequence, with a specific length * * @param buffer The PDU in which the Sequence will be put * @param start The Sequence length */ public static void encodeSequence( Asn1Buffer buffer, int start ) { buffer.put( TLV.getBytes( buffer.getPos() - start ) ); buffer.put( UniversalTag.SEQUENCE.getValue() ); } /** * Encode a Sequence, with a specific tag * * @param buffer The PDU in which the Sequence will be put * @param tag The tag to use */ public static void encodeSequence( Asn1Buffer buffer, byte tag ) { buffer.put( TLV.getBytes( buffer.getPos() ) ); buffer.put( tag ); } /** * Encode a Sequence, with a specific length and tag * * @param buffer The PDU in which the Sequence will be put * @param tag The tag to use * @param start The position in the buffer this Sequence starts */ public static void encodeSequence( Asn1Buffer buffer, byte tag, int start ) { buffer.put( TLV.getBytes( buffer.getPos() - start ) ); buffer.put( tag ); } /** * Encode a Set * * @param buffer The PDU in which the Set will be put */ public static void encodeSet( Asn1Buffer buffer ) { buffer.put( TLV.getBytes( buffer.getPos() ) ); buffer.put( UniversalTag.SET.getValue() ); } /** * Encode a Set, with a specific length * * @param buffer The PDU in which the Set will be put * @param start The Set length */ public static void encodeSet( Asn1Buffer buffer, int start ) { buffer.put( TLV.getBytes( buffer.getPos() - start ) ); buffer.put( UniversalTag.SET.getValue() ); } /** * Encode a Set, with a specific tag * * @param buffer The PDU in which the value will be put * @param tag The tag to use */ public static void encodeSet( Asn1Buffer buffer, byte tag ) { buffer.put( TLV.getBytes( buffer.getPos() ) ); buffer.put( tag ); } /** * Encode a Set, with a specific length and tag * * @param buffer The PDU in which the set will be put * @param tag The tag to use * @param start The position in the buffer this Set starts */ public static void encodeSet( Asn1Buffer buffer, byte tag, int start ) { buffer.put( TLV.getBytes( buffer.getPos() - start ) ); buffer.put( tag ); } /** * Encode a String value * * @param buffer The PDU in which the value will be put * @param string The String to be encoded. It is supposed to be UTF-8 * @throws EncoderException if the PDU in which the value should be encoded is * two small */ public static void encode( ByteBuffer buffer, String string ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER ) ); } try { buffer.put( UniversalTag.OCTET_STRING.getValue() ); byte[] value = Asn1StringUtils.getBytesUtf8( string ); buffer.put( TLV.getBytes( value.length ) ); if ( value.length != 0 ) { buffer.put( value ); } } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL ), boe ); } } /** * Encode a BIT STRING value * * @param buffer The PDU in which the value will be put * @param bitString The BitString to be encoded. * @throws EncoderException if the PDU in which the value should be encoded is * two small */ public static void encode( ByteBuffer buffer, BitString bitString ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER ) ); } try { buffer.put( UniversalTag.BIT_STRING.getValue() ); // The BitString length. We add one byte for the unused number // of bits byte[] bytes = bitString.getData(); int length = bytes.length; buffer.put( TLV.getBytes( length ) ); buffer.put( bytes ); } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL ), boe ); } } /** * Encode an OctetString value * * @param buffer The PDU in which the value will be put * @param bytes The bytes to be encoded * @throws EncoderException if the PDU in which the value should be encoded is * two small */ public static void encode( ByteBuffer buffer, byte[] bytes ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER ) ); } try { buffer.put( UniversalTag.OCTET_STRING.getValue() ); if ( ( bytes == null ) || ( bytes.length == 0 ) ) { buffer.put( ( byte ) 0 ); } else { buffer.put( TLV.getBytes( bytes.length ) ); buffer.put( bytes ); } } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL ), boe ); } } /** * Encode an OID value * * @param buffer The PDU in which the value will be put * @param oid The OID to be encoded * @throws EncoderException if the PDU in which the value should be encoded is * two small */ public static void encode( ByteBuffer buffer, Oid oid ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER ) ); } try { buffer.put( UniversalTag.OCTET_STRING.getValue() ); buffer.put( TLV.getBytes( oid.getEncodedLength() ) ); if ( oid.getEncodedLength() != 0 ) { oid.writeBytesTo( buffer ); } } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL ), boe ); } } /** * Encode an integer value * * @param buffer The PDU in which the value will be put * @param value The integer to be encoded * @throws EncoderException if the PDU in which the value should be encoded is * two small */ public static void encode( ByteBuffer buffer, int value ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER ) ); } try { buffer.put( UniversalTag.INTEGER.getValue() ); buffer.put( ( byte ) getNbBytes( value ) ); buffer.put( getBytes( value ) ); } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL ), boe ); } } /** * Encode a long value * * @param buffer The PDU in which the value will be put * @param value The long to be encoded * @throws EncoderException if the PDU in which the value should be encoded is * two small */ public static void encode( ByteBuffer buffer, long value ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER ) ); } try { buffer.put( UniversalTag.INTEGER.getValue() ); buffer.put( ( byte ) getNbBytes( value ) ); buffer.put( getBytes( value ) ); } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL ), boe ); } } /** * Encode an integer value * * @param buffer The PDU in which the value will be put * @param tag The tag if it's not an UNIVERSAL one * @param value The integer to be encoded * @throws EncoderException if the PDU in which the value should be encoded is * two small */ public static void encode( ByteBuffer buffer, byte tag, int value ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER ) ); } try { buffer.put( tag ); buffer.put( ( byte ) getNbBytes( value ) ); buffer.put( getBytes( value ) ); } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL ), boe ); } } /** * Encode an enumerated value * * @param buffer The PDU in which the value will be put * @param value The integer to be encoded */ public static void encodeEnumerated( Asn1Buffer buffer, int value ) { buffer.put( getBytes( value ) ); buffer.put( TLV.getBytes( getNbBytes( value ) ) ); buffer.put( UniversalTag.ENUMERATED.getValue() ); } /** * Encode an enumerated value * * @param buffer The PDU in which the value will be put * @param tag The tag to use * @param value The integer to be encoded */ public static void encodeEnumerated( Asn1Buffer buffer, byte tag, int value ) { buffer.put( getBytes( value ) ); buffer.put( TLV.getBytes( getNbBytes( value ) ) ); buffer.put( tag ); } /** * Encode an enumerated value * * @param buffer The PDU in which the value will be put * @param value The integer to be encoded * @throws EncoderException if the PDU in which the value should be encoded is * two small */ public static void encodeEnumerated( ByteBuffer buffer, int value ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER ) ); } try { buffer.put( UniversalTag.ENUMERATED.getValue() ); buffer.put( TLV.getBytes( getNbBytes( value ) ) ); buffer.put( getBytes( value ) ); } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL ), boe ); } } /** * Encode a boolean value * * @param buffer The PDU in which the value will be put * @param bool The boolean to be encoded * @throws EncoderException if the PDU in which the value should be encoded is * two small */ public static void encode( ByteBuffer buffer, boolean bool ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER ) ); } try { if ( bool ) { buffer.put( ENCODED_TRUE ); } else { buffer.put( ENCODED_FALSE ); } } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL ), boe ); } } /** * Return a string representing the Value * * @return A string representing the value */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( "DATA" ); if ( data != null ) { sb.append( '[' ); sb.append( Asn1StringUtils.dumpBytes( data ) ); sb.append( ']' ); } else { return "[]"; } return sb.toString(); } } BooleanDecoder.java000066400000000000000000000044341525525160600357750ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Parse and decode a Boolean value. * * @author Apache Directory Project */ public final class BooleanDecoder { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( BooleanDecoder.class ); /** * A private constructor */ private BooleanDecoder() { } /** * Parse a Value containing a byte[] and send back a boolean. * * @param value The Value to parse * @return A boolean. * @throws BooleanDecoderException Thrown if the Value does not contains a boolean */ public static boolean parse( BerValue value ) throws BooleanDecoderException { byte[] bytes = value.getData(); if ( Strings.isEmpty( bytes ) ) { throw new BooleanDecoderException( I18n.err( I18n.ERR_01302_0_BYTES_LONG_BOOLEAN ) ); } if ( bytes.length != 1 ) { throw new BooleanDecoderException( I18n.err( I18n.ERR_01303_N_BYTES_LONG_BOOLEAN ) ); } if ( ( bytes[0] != 0 ) && ( bytes[0] != ( byte ) 0xFF ) ) { if ( LOG.isWarnEnabled() ) { LOG.warn( I18n.msg( I18n.MSG_01300_BOOLEAN_0X00_0XFF ) ); } } return bytes[0] != 0; } } BooleanDecoderException.java000066400000000000000000000026271525525160600376560ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; /** * Thrown when a BooleanDecoder has encountered a failure condition * during a decode. * * @author Apache Directory Project */ public class BooleanDecoderException extends Exception { /** Declares the Serial Version Uid */ private static final long serialVersionUID = 1L; /** * Creates a BooleanDecoderException * * @param message A message with meaning to a human */ public BooleanDecoderException( String message ) { super( message ); } } IntegerDecoder.java000066400000000000000000000166061525525160600360170ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.util.Strings; /** * Parse and decode an Integer value. * * @author Apache Directory Project */ public final class IntegerDecoder { /** A mask used to get only the necessary bytes */ private static final int[] MASK = new int[] { 0x000000FF, 0x0000FFFF, 0x00FFFFFF, 0xFFFFFFFF }; /** * A private constructor */ private IntegerDecoder() { } /** * Parse a byte buffer and send back an integer, controlling that this number * is in a specified interval. * * @param value The Value containing the byte[] to parse * @param min Lowest value allowed, included * @param max Highest value allowed, included * @return An integer * @throws IntegerDecoderException Thrown if the byte[] does not contains an integer */ public static int parse( BerValue value, int min, int max ) throws IntegerDecoderException { int result = parseInt( value ); if ( ( result >= min ) && ( result <= max ) ) { return result; } else { throw new IntegerDecoderException( I18n.err( I18n.ERR_01306_VALUE_NOT_IN_RANGE, min, max ) ); } } /** * Parse a byte buffer and send back an integer * * @param value The byte buffer to parse * @return An integer * @throws IntegerDecoderException Thrown if the byte stream does not contains an integer */ public static int parse( BerValue value ) throws IntegerDecoderException { return parseInt( value ); } /** * Helper method used to parse the integer. We don't check any minimal or maximal * bound. * An BER encoded int can be either positive or negative. It uses the minimum * number of bytes necessary to encode the value. The high order bit gives the * sign of the integer : if it's 1, then it's a negative value, otherwise it's * a positive value. Integer with a high order bit set to 1 but prefixed by a 0x00 * are positive. If the integer is negative, then the 2 complement value is * stored
* Here are a few samples : *
    *
  • 0x02 0x01 0x00 : integer 0
  • *
  • 0x02 0x01 0x01 : integer 1
  • *
  • 0x02 0x01 0x7F : integer 127
  • *
  • 0x02 0x01 0x80 : integer -128
  • *
  • 0x02 0x01 0x81 : integer -127
  • *
  • 0x02 0x01 0xFF : integer -1
  • *
  • 0x02 0x02 0x00 0x80 : integer 128
  • *
  • 0x02 0x02 0x00 0x81 : integer 129
  • *
  • 0x02 0x02 0x00 0xFF : integer 255
  • *
* and so on... * * @param value the BER PDU to parse * @return The decoded value * @exception IntegerDecoderException If the BER contains an invalid integer value */ private static int parseInt( BerValue value ) throws IntegerDecoderException { int result = 0; byte[] bytes = value.getData(); if ( Strings.isEmpty( bytes ) ) { throw new IntegerDecoderException( I18n.err( I18n.ERR_01304_0_BYTES_LONG_INTEGER ) ); } boolean positive = true; switch ( bytes.length ) { case 5: if ( bytes[0] == 0x00 ) { if ( ( bytes[1] & ( byte ) 0x80 ) != ( byte ) 0x80 ) { throw new IntegerDecoderException( I18n.err( I18n.ERR_01304_0_BYTES_LONG_INTEGER ) ); } // A valid 5 bytes INTEGER (a 0x00 pad followed by a byte with // its high bit set) is a positive value in [2^31, 2^32 - 1] : // it never fits in a Java int. Reject it instead of silently // returning the wrapped (negative) 32 low bits, which callers // would misinterpret (eg a pagedResults size of 4294967295 // being absorbed as 'unlimited' instead of a protocol error). throw new IntegerDecoderException( I18n.err( I18n.ERR_01306_VALUE_NOT_IN_RANGE, Integer.MIN_VALUE, Integer.MAX_VALUE ) ); } else { throw new IntegerDecoderException( I18n.err( I18n.ERR_01304_0_BYTES_LONG_INTEGER ) ); } case 4: if ( bytes[0] == 0x00 ) { result = bytes[1] & 0x00FF; } else { result = bytes[0] & 0x00FF; if ( ( bytes[0] & ( byte ) 0x80 ) == ( byte ) 0x80 ) { positive = false; } result = ( result << 8 ) | ( bytes[1] & 0x00FF ); } result = ( result << 8 ) | ( bytes[2] & 0x00FF ); result = ( result << 8 ) | ( bytes[3] & 0x00FF ); break; case 3: if ( bytes[0] == 0x00 ) { result = bytes[1] & 0x00FF; } else { result = bytes[0] & 0x00FF; if ( ( bytes[0] & ( byte ) 0x80 ) == ( byte ) 0x80 ) { positive = false; } result = ( result << 8 ) | ( bytes[1] & 0x00FF ); } result = ( result << 8 ) | ( bytes[2] & 0x00FF ); break; case 2: if ( bytes[0] == 0x00 ) { result = bytes[1] & 0x00FF; } else { result = bytes[0] & 0x00FF; if ( ( bytes[0] & ( byte ) 0x80 ) == ( byte ) 0x80 ) { positive = false; } result = ( result << 8 ) | ( bytes[1] & 0x00FF ); } break; case 1: result = ( result << 8 ) | ( bytes[0] & 0x00FF ); if ( ( bytes[0] & ( byte ) 0x80 ) == ( byte ) 0x80 ) { positive = false; } break; default: throw new IntegerDecoderException( I18n.err( I18n.ERR_01305_ABOVE_4_BYTES_INTEGER ) ); } if ( !positive ) { result = -( ( ( ~result ) + 1 ) & MASK[bytes.length - 1] ); } return result; } } IntegerDecoderException.java000077500000000000000000000026321525525160600376730ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; /** * Thrown when a IntegerDecoder has encountered a failure condition during a * decode. * * @author Apache Directory Project */ public class IntegerDecoderException extends Exception { /** Declares the Serial Version Uid */ private static final long serialVersionUID = 1L; /** * Creates a IntegerDecoderException * * @param message A message with meaning to a human */ public IntegerDecoderException( String message ) { super( message ); } } LongDecoder.java000066400000000000000000000071371525525160600353200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; import org.apache.directory.api.i18n.I18n; /** * Parse and decode a Long value. * * @author Apache Directory Project */ public final class LongDecoder { /** A mask used to get only the necessary bytes */ private static final long[] MASK = new long[] { 0x00000000000000FFL, 0x000000000000FFFFL, 0x0000000000FFFFFFL, 0x00000000FFFFFFFFL, 0x000000FFFFFFFFFFL, 0x0000FFFFFFFFFFFFL, 0x00FFFFFFFFFFFFFFL, 0xFFFFFFFFFFFFFFFFL }; /** * A private constructor */ private LongDecoder() { } /** * Parse a byte buffer and send back an long, controlling that this number * is in a specified interval. * * @param value The byte buffer to parse * @param min Lowest value allowed, included * @param max Highest value allowed, included * @return An integer * @throws LongDecoderException Thrown if the byte stream does not contains an integer */ public static long parse( BerValue value, long min, long max ) throws LongDecoderException { long result = parseLong( value ); if ( ( result >= min ) && ( result <= max ) ) { return result; } else { throw new LongDecoderException( I18n.err( I18n.ERR_01306_VALUE_NOT_IN_RANGE, min, max ) ); } } /** * Parse a byte buffer and send back an integer * * @param value The byte buffer to parse * @return An integer * @throws LongDecoderException Thrown if the byte stream does not contains an integer */ public static long parse( BerValue value ) throws LongDecoderException { return parseLong( value ); } /** * Helper method used to parse the long. We don't check any minimal or maximal * bound. * * @param value The value to parse to a long * @return The decoded long * @throws LongDecoderException If we failed to decode a long */ public static long parseLong( BerValue value ) throws LongDecoderException { long result = 0; byte[] bytes = value.getData(); if ( ( bytes == null ) || ( bytes.length == 0 ) ) { throw new LongDecoderException( I18n.err( I18n.ERR_01307_0_BYTES_LONG_LONG ) ); } if ( bytes.length > 8 ) { throw new LongDecoderException( I18n.err( I18n.ERR_01307_0_BYTES_LONG_LONG ) ); } for ( int i = 0; ( i < bytes.length ) && ( i < 9 ); i++ ) { result = ( result << 8 ) | ( bytes[i] & 0x00FF ); } if ( ( bytes[0] & 0x80 ) == 0x80 ) { result = -( ( ( ~result ) + 1 ) & MASK[bytes.length - 1] ); } return result; } } LongDecoderException.java000066400000000000000000000026161525525160600371740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; /** * Thrown when a LongDecoder has encountered a failure condition during a * decode. * * @author Apache Directory Project */ public class LongDecoderException extends Exception { /** Declares the Serial Version Uid */ private static final long serialVersionUID = 1L; /** * Creates a LongDecoderException * * @param message A message with meaning to a human */ public LongDecoderException( String message ) { super( message ); } } TLV.java000066400000000000000000000260411525525160600335730ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; import org.apache.directory.api.asn1.util.Asn1StringUtils; /** * This class is used to store Tags, Lengths and Values decoded from a PDU. * * @author Apache Directory Project */ public class TLV { /** The current Tag being processed */ private byte tag; /** The current Length being processed */ private int length; /** The number of byte to store the Length being processed */ private int lengthNbBytes; /** The number of length's bytes currently read */ private int lengthBytesRead; /** The current Value being processed */ private BerValue value; /** An identity for the TLV. It store the TLV hashCode */ private int id; /** * Reference the TLV which contains the current TLV, if any. As the * enclosing TLV of a PDU does not have parent, it can be null in this case. * Otherwise, it must point to a constructed TLV */ private TLV parent; /** * The expected length of the TLV's elements, if the current TLV is a * constructed TLV. */ private int expectedLength; /** tag flag for the primitive/constructed bit - 0010 0000 - 0x20 */ public static final byte CONSTRUCTED_FLAG = 0x20; /** mask to get the type class value */ public static final byte TYPE_CLASS_MASK = ( byte ) 0xC0; /** value for the universal type class */ public static final byte TYPE_CLASS_UNIVERSAL = 0x00; /** tag mask for the short tag format - 0001 1111 - 0x1F */ public static final int SHORT_MASK = 0x1F; /** A mask to get the Length form */ public static final int LENGTH_LONG_FORM = 0x0080; /** Value of the reserved extension */ public static final int LENGTH_EXTENSION_RESERVED = 0x7F; /** A mask to get the long form value */ public static final int LENGTH_SHORT_MASK = 0x007F; /** A speedup for single bytes length */ private static final byte[][] ONE_BYTE = new byte[128][]; // Initialize an array of byte[] used for encoding lengths below 128 static { for ( int i = 0; i < 128; i++ ) { ONE_BYTE[i] = new byte[1]; ONE_BYTE[i][0] = ( byte ) i; } } /** * Creates a new TLV object. * * @param id the TLV's id */ public TLV( int id ) { tag = 0; length = 0; lengthNbBytes = 0; value = new BerValue(); this.id = id; expectedLength = 0; } /** * Checks to see if the tag is constructed. * * @param tag the TLV's tag * @return true if constructed, false if primitive */ public static boolean isConstructed( byte tag ) { return ( tag & CONSTRUCTED_FLAG ) != 0; } /** * Checks to see if the current tlv's tag is constructed. * * @return true if constructed, false if primitive */ public boolean isConstructed() { return ( tag & CONSTRUCTED_FLAG ) != 0; } /** * Checks to see if the tag represented by this Tag is primitive or * constructed. * * @param tag the tag to be checked * @return true if it is primitive, false if it is constructed */ public static boolean isPrimitive( byte tag ) { return ( tag & CONSTRUCTED_FLAG ) == 0; } /** * Tells if the tag is Universal or not * * @param tag the tag to be checked * @return true if it is primitive, false if it is constructed */ public static boolean isUniversal( byte tag ) { return ( tag & TYPE_CLASS_MASK ) == TYPE_CLASS_UNIVERSAL; } /** * Reset the TLV, so it can be reused for the next PDU decoding. */ public void reset() { tag = 0; length = 0; lengthNbBytes = 0; value.reset(); expectedLength = 0; } /** * Get the TLV's tag * * @return Returns the tag. */ public byte getTag() { return tag; } /** * Set a tag value for this TLV. * * @param tag the tag field for this TLV. */ public void setTag( byte tag ) { this.tag = tag; } /** * Get the TLV's value part * * @return Returns the value. */ public BerValue getValue() { return value; } /** * The TLV size is calculated by adding the Tag's size, the Length's size * and the Value's length, if any. * * @return Returns the size of the TLV. */ public int getSize() { return 1 + lengthNbBytes + length; } /** * Utility function that return the number of bytes necessary to store the * length * * @param length The length to store in a byte array * @return The number of bytes necessary to store the length. * @see X.690 */ public static int getNbBytes( int length ) { if ( length >= 0 ) { if ( length < 128 ) { return 1; } else if ( length < 256 ) { return 2; } else if ( length < 65536 ) { return 3; } else if ( length < 16777216 ) { return 4; } else { return 5; } } else { return 5; } } /** * Utility function that return a byte array representing the length * * @param length The length to store in a byte array * @return The byte array representing the length. */ public static byte[] getBytes( int length ) { if ( length >= 0 ) { if ( length < 128 ) { return ONE_BYTE[length]; } else { byte[] bytes = new byte[getNbBytes( length )]; if ( length < 256 ) { bytes[0] = ( byte ) 0x81; bytes[1] = ( byte ) length; } else if ( length < 65536 ) { bytes[0] = ( byte ) 0x82; bytes[1] = ( byte ) ( length >> 8 ); bytes[2] = ( byte ) ( length & 0x00FF ); } else if ( length < 16777216 ) { bytes[0] = ( byte ) 0x83; bytes[1] = ( byte ) ( length >> 16 ); bytes[2] = ( byte ) ( ( length >> 8 ) & 0x00FF ); bytes[3] = ( byte ) ( length & 0x00FF ); } else { bytes[0] = ( byte ) 0x84; bytes[1] = ( byte ) ( length >> 24 ); bytes[2] = ( byte ) ( ( length >> 16 ) & 0x00FF ); bytes[3] = ( byte ) ( ( length >> 8 ) & 0x00FF ); bytes[4] = ( byte ) ( length & 0x00FF ); } return bytes; } } else { byte[] bytes = new byte[getNbBytes( length )]; bytes[0] = ( byte ) 0x84; bytes[1] = ( byte ) ( length >> 24 ); bytes[2] = ( byte ) ( ( length >> 16 ) & 0x00FF ); bytes[3] = ( byte ) ( ( length >> 8 ) & 0x00FF ); bytes[4] = ( byte ) ( length & 0x00FF ); return bytes; } } /** * Get the TLV's parent * * @return The parent. */ public TLV getParent() { return parent; } /** * Set the TLV's parent * * @param parent The parent to set. */ public void setParent( TLV parent ) { this.parent = parent; } /** * Get the TLV expected length. * * @return The expectedLength. */ public int getExpectedLength() { return expectedLength; } /** * Set the new expected length of the current TLV. * * @param expectedLength The expectedLength to set. */ public void setExpectedLength( int expectedLength ) { this.expectedLength = expectedLength; } /** * Get the TLV's length * * @return The number of bytes necessary to store the TLV's length */ public int getLengthNbBytes() { return lengthNbBytes; } /** * Set the number of bytes we should use to store the TLV's length. * * @param lengthNbBytes The number of bytes necessary to store the TLV's length */ public void setLengthNbBytes( int lengthNbBytes ) { this.lengthNbBytes = lengthNbBytes; } /** * Get the TLV's length * * @return the TLV's length */ public int getLength() { return length; } /** * Set the TLV's length * * @param length the TLV's length */ public void setLength( int length ) { this.length = length; } /** * Get the already read bytes * * @return The currently read TLV's length bytes */ public int getLengthBytesRead() { return lengthBytesRead; } /** * Set the currently read TLV's length bytes. * * @param lengthBytesRead the currently read TLV's length bytes */ public void setLengthBytesRead( int lengthBytesRead ) { this.lengthBytesRead = lengthBytesRead; } /** * Increment the number of bytes read for this TLV */ public void incLengthBytesRead() { lengthBytesRead++; } /** * Get the TLV's ID * * @return The TLV's ID */ public int getId() { return id; } /** * Get a String representation of the TLV * * @return A String */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( "TLV[ " ); sb.append( Asn1StringUtils.dumpByte( tag ) ).append( ", " ); sb.append( "length:" ).append( length ).append( ", " ); sb.append( "expected:" ).append( expectedLength ).append( ", " ); sb.append( value.toString() ); sb.append( "]" ); return sb.toString(); } } TLVBerDecoderMBean.java000066400000000000000000000031461525525160600364160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; /** * A MBean used to get stats on the decoding process. * * @author Apache Directory Project */ public interface TLVBerDecoderMBean { /** * Get the actual maximum number of bytes that can be used to encode the * Length * * @return The maximum bytes of the Length */ int getMaxLengthLength(); /** * Get the actual maximum number of bytes that can be used to encode the Tag * * @return The maximum length of the Tag */ int getMaxTagLength(); /** * Tell if indefinite length form could be used for Length * * @return true if the Indefinite form is allowed */ boolean isIndefiniteLengthAllowed(); } TLVStateEnum.java000066400000000000000000000043621525525160600354230ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; /** * Stores the different states of a PDU parsing. * * @author Apache Directory Project */ public enum TLVStateEnum { /** Start means that the deconding hasn't read the first byte */ TAG_STATE_START, /** Pending means that the Type Tag is contained in more that one byte */ TAG_STATE_PENDING, /** End means that the Type is totally read */ TAG_STATE_END, /** * Overflow could have two meaning : either there are more than 5 bytes to * encode the value (5 bytes = 5bits + 4*7 bits = 33 bits) or the value that * is represented by those bytes is over MAX_INTEGER */ TAG_STATE_OVERFLOW, /** Start means that the decoding hasn't read the first byte */ LENGTH_STATE_START, /** Pending means that the Type length is contained in more that one byte */ LENGTH_STATE_PENDING, /** End means that the Length is totally read */ LENGTH_STATE_END, /** Start means that the decoding hasn't read the first byte */ VALUE_STATE_START, /** Pending means that the Type Value is contained in more that one byte */ VALUE_STATE_PENDING, /** End means that the Value is totally read */ VALUE_STATE_END, /** The decoding of a TLV is done */ TLV_STATE_DONE, /** The decoding of a PDU is done */ PDU_DECODED, /** The ending state */ GRAMMAR_END } UniversalTag.java000066400000000000000000000147551525525160600355430ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; /** * Enum for ASN.1 UNIVERSAL class tags. The tags values are constructed using * the SNACC representation for tags without the primitive/constructed bit. This * is done because several bit, octet and character string types can be encoded * as primitives or as constructed types to chunk the value out. *

* These tags can have one of the following values: *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
ASN.1 tags
IdUsage
[UNIVERSAL 0]reserved for BER
[UNIVERSAL 1]BOOLEAN
[UNIVERSAL 2]INTEGER
[UNIVERSAL 3]BIT STRING
[UNIVERSAL 4]OCTET STRING
[UNIVERSAL 5]NULL
[UNIVERSAL 6]OBJECT IDENTIFIER
[UNIVERSAL 7]ObjectDescriptor
[UNIVERSAL 8]EXTERNAL, INSTANCE OF
[UNIVERSAL 9]REAL
[UNIVERSAL 10]ENUMERATED
[UNIVERSAL 11]EMBEDDED PDV
[UNIVERSAL 12]UTF8String
[UNIVERSAL 13]RELATIVE-OID
[UNIVERSAL 14]reserved for future use
[UNIVERSAL 15]reserved for future use
[UNIVERSAL 16]SEQUENCE, SEQUENCE OF
[UNIVERSAL 17]SET, SET OF
[UNIVERSAL 18]NumericString
[UNIVERSAL 19]PrintableString
[UNIVERSAL 20]TeletexString, T61String
[UNIVERSAL 21]VideotexString
[UNIVERSAL 22]IA5String
[UNIVERSAL 23]UTCTime
[UNIVERSAL 24]GeneralizedTime
[UNIVERSAL 25]GraphicString
[UNIVERSAL 26]VisibleString, ISO646String
[UNIVERSAL 27]GeneralString
[UNIVERSAL 28]UniversalString
[UNIVERSAL 29]CHARACTER STRING
[UNIVERSAL 30]BMPString
[UNIVERSAL 31]reserved for future use
* * @author Apache Directory Project */ public enum UniversalTag { /** value for the tag */ RESERVED_0(( byte ) 0), /** value for the tag */ BOOLEAN(( byte ) 1), /** value for the tag */ INTEGER(( byte ) 2), /** value for the tag */ BIT_STRING(( byte ) 3), /** value for the tag */ OCTET_STRING(( byte ) 4), /** value for the tag */ NULL(( byte ) 5), /** value for the tag */ OBJECT_IDENTIFIER(( byte ) 6), /** value for the tag */ OBJECT_DESCRIPTOR(( byte ) 7), /** value for the tag */ EXTERNAL_INSTANCE_OF(( byte ) 8), /** value for the tag */ REAL(( byte ) 9), /** value for the tag */ ENUMERATED(( byte ) 0x0A), /** value for the tag */ EMBEDDED_PDV(( byte ) 0x0B), /** value for the tag */ UTF8_STRING(( byte ) 0x0C), /** value for the tag */ RELATIVE_OID(( byte ) 0x0D), /** value for the tag */ RESERVED_14(( byte ) 0x0E), /** value for the tag */ RESERVED_15(( byte ) 0x0F), /** value for the tag */ SEQUENCE_SEQUENCE_OF(( byte ) 0x10), /** value for the tag */ SET_SET_OF(( byte ) 0x11), /** value for the tag */ NUMERIC_STRING(( byte ) 0x12), /** value for the tag */ PRINTABLE_STRING(( byte ) 0x13), /** value for the tag */ TELETEX_STRING(( byte ) 0x14), /** value for the tag */ VIDEOTEX_STRING(( byte ) 0x15), /** value for the tag */ IA5_STRING(( byte ) 0x16), /** value for the tag */ UTC_TIME(( byte ) 0x17), /** value for the tag */ GENERALIZED_TIME(( byte ) 0x18), /** value for the tag */ GRAPHIC_STRING(( byte ) 0x19), /** value for the tag */ VISIBLE_STRING(( byte ) 0x1A), /** value for the tag */ GENERAL_STRING(( byte ) 0x1B), /** value for the tag */ UNIVERSAL_STRING(( byte ) 0x1C), /** value for the tag */ CHARACTER_STRING(( byte ) 0x1D), /** value for the tag */ BMP_STRING(( byte ) 0x1E), /** value for the tag */ RESERVED_31(( byte ) 0x1F), /** SEQUENCE TAG */ SEQUENCE(( byte ) 0x30), /** SET TAG */ SET(( byte ) 0x31); /** The internal value */ private byte value; /** * Creates a new instance of UniversalTag. * * @param value The tag value */ UniversalTag( byte value ) { this.value = value; } /** * Get the UniversalTag value * * @return The UniversalTag value */ public byte getValue() { return value; } } apache-directory-ldap-api-cfb3cee/asn1/ber/src/site/000077500000000000000000000000001525525160600224325ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/site/site.xml000066400000000000000000000025151525525160600241230ustar00rootroot00000000000000 apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/000077500000000000000000000000001525525160600224455ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/000077500000000000000000000000001525525160600233665ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/000077500000000000000000000000001525525160600241555ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/000077500000000000000000000000001525525160600253765ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/000077500000000000000000000000001525525160600274025ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/api/000077500000000000000000000000001525525160600301535ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/api/asn1/000077500000000000000000000000001525525160600310155ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/000077500000000000000000000000001525525160600315655ustar00rootroot00000000000000Asn1DecoderIndefiniteLengthTest.java000066400000000000000000000055471525525160600404550ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber; import static org.junit.jupiter.api.Assertions.fail; import java.nio.ByteBuffer; import org.apache.directory.api.asn1.DecoderException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * The BER indefinite length form (length octet 0x80) is not supported by this * decoder : it must be rejected with a DecoderException instead of being * silently decoded as a zero length, which would create a parser differential * with conforming BER decoders. * * @author Apache Directory Project */ @Execution(ExecutionMode.CONCURRENT) public class Asn1DecoderIndefiniteLengthTest { /** * A constructed TLV using the indefinite length form must be rejected */ @Test public void testIndefiniteLengthIsRejected() { Asn1Container container = new AbstractContainer() { }; // SEQUENCE with the indefinite length octet, then end-of-contents ByteBuffer stream = ByteBuffer.wrap( new byte[] { 0x30, ( byte ) 0x80, 0x00, 0x00 } ); try { Asn1Decoder.decode( stream, container ); fail( "The indefinite length form must be rejected" ); } catch ( DecoderException expected ) { // expected } } /** * A primitive TLV using the indefinite length form must be rejected too */ @Test public void testIndefiniteLengthOnPrimitiveIsRejected() { Asn1Container container = new AbstractContainer() { }; // OCTET STRING with the indefinite length octet ByteBuffer stream = ByteBuffer.wrap( new byte[] { 0x04, ( byte ) 0x80, 0x00, 0x00 } ); try { Asn1Decoder.decode( stream, container ); fail( "The indefinite length form must be rejected" ); } catch ( DecoderException expected ) { // expected } } } Asn1DecoderMaxPduSizeTest.java000066400000000000000000000061511525525160600372560ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import java.nio.ByteBuffer; import org.apache.directory.api.asn1.DecoderException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests that the decoder does not commit unbounded memory for an * attacker-declared TLV length: the default max PDU size must be finite, * and a PDU declaring more than that must be rejected before any * allocation is made. * * @author Apache Directory Project */ @Execution(ExecutionMode.CONCURRENT) public class Asn1DecoderMaxPduSizeTest { /** * A minimal concrete container : the decoder throws before any grammar * action is needed for the tested PDUs. */ private static final class TestContainer extends AbstractContainer { TestContainer() { super(); } } /** * The default must be bounded, not Integer.MAX_VALUE */ @Test public void testDefaultMaxPduSizeIsBounded() { assertEquals( AbstractContainer.DEFAULT_MAX_PDU_SIZE, new TestContainer().getMaxPDUSize() ); } /** * A 6 byte PDU declaring a ~2GB value must be rejected as soon as its * length has been decoded, long before 2GB of body bytes ever arrive. */ @Test public void testHugeDeclaredLengthIsRejectedByDefault() { // 30 84 7F FF FF EA : a SEQUENCE declaring a ~2GB value ByteBuffer stream = ByteBuffer.allocate( 6 ); stream.put( new byte[] { 0x30, ( byte ) 0x84, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xEA } ); stream.flip(); TestContainer container = new TestContainer(); assertThrows( DecoderException.class, () -> Asn1Decoder.decode( stream, container ) ); } /** * The explicit opt-out (a value <= 0) must still remove the limit. */ @Test public void testExplicitOptOutRemovesTheLimit() throws DecoderException { TestContainer container = new TestContainer(); container.setMaxPDUSize( -1 ); assertEquals( Integer.MAX_VALUE, container.getMaxPDUSize() ); } } Asn1DecoderTlvSizeOverflowTest.java000066400000000000000000000070301525525160600403460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber; import static org.junit.jupiter.api.Assertions.fail; import java.nio.ByteBuffer; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.ber.grammar.Grammar; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * A child TLV declaring a length close to Integer.MAX_VALUE used to overflow * the int TLV-size arithmetic and bypass the parent length-containment check. * It must be rejected with a DecoderException. * * @author Apache Directory Project */ @Execution(ExecutionMode.CONCURRENT) public class Asn1DecoderTlvSizeOverflowTest { /** * A grammar which does nothing : these tests only exercise the TLV * structure checks, not any grammar semantics. */ private static final class NoOpGrammar implements Grammar { private String name = "NO_OP"; @Override public void executeAction( Asn1Container container ) { container.setGrammarEndAllowed( true ); } @Override public String getName() { return name; } @Override public void setName( String name ) { this.name = name; } } /** * A child TLV whose size overflows an int inside a 16 bytes parent must * not pass the containment check */ @Test public void testChildTlvSizeOverflowIsRejected() { Asn1Container container = new AbstractContainer() { }; container.setGrammar( new NoOpGrammar() ); // A SEQUENCE with 16 bytes of room, containing an OCTET STRING // claiming 0x7FFFFFFF value bytes : 1 (tag) + 5 (length) + 0x7FFFFFFF // wraps negative in int arithmetic ByteBuffer stream = ByteBuffer.wrap( new byte[] { 0x30, 0x10, 0x04, ( byte ) 0x84, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } ); try { Asn1Decoder.decode( stream, container ); fail( "A child TLV bigger than its parent must be rejected" ); } catch ( DecoderException expected ) { // expected } } /** * A well-formed nested TLV still decodes */ @Test public void testNestedTlvStillDecodes() throws DecoderException { Asn1Container container = new AbstractContainer() { }; container.setGrammar( new NoOpGrammar() ); ByteBuffer stream = ByteBuffer.wrap( new byte[] { 0x30, 0x03, 0x04, 0x01, ( byte ) 0xAA } ); Asn1Decoder.decode( stream, container ); } } apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/000077500000000000000000000000001525525160600323725ustar00rootroot00000000000000LengthTest.java000066400000000000000000000070061525525160600352420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * This class is used to test the Length class * * @author Apache Directory Project */ @Execution(ExecutionMode.CONCURRENT) public class LengthTest { /** * Test the getNbBytes method */ @Test public void testLengthGetNbBytes() { assertEquals( 1, TLV.getNbBytes( 0 ), "1 expected" ); assertEquals( 1, TLV.getNbBytes( 1 ), "1 expected" ); assertEquals( 1, TLV.getNbBytes( 127 ), "1 expected" ); assertEquals( 2, TLV.getNbBytes( 128 ), "2 expected" ); assertEquals( 2, TLV.getNbBytes( 255 ), "2 expected" ); assertEquals( 3, TLV.getNbBytes( 256 ), "3 expected" ); assertEquals( 3, TLV.getNbBytes( 65535 ), "3 expected" ); assertEquals( 4, TLV.getNbBytes( 65536 ), "4 expected" ); assertEquals( 4, TLV.getNbBytes( 16777215 ), "4 expected" ); assertEquals( 5, TLV.getNbBytes( 16777216 ), "5 expected" ); assertEquals( 5, TLV.getNbBytes( 0xFFFFFFFF ), "5 expected" ); } /** * Test the getBytes method */ @Test public void testLengthGetBytes() { assertTrue( Arrays.equals( new byte[] { 0x01 }, TLV.getBytes( 1 ) ) ); assertTrue( Arrays.equals( new byte[] { 0x7F }, TLV.getBytes( 127 ) ) ); assertTrue( Arrays.equals( new byte[] { ( byte ) 0x81, ( byte ) 0x80 }, TLV.getBytes( 128 ) ) ); assertTrue( Arrays.equals( new byte[] { ( byte ) 0x81, ( byte ) 0xFF }, TLV.getBytes( 255 ) ) ); assertTrue( Arrays.equals( new byte[] { ( byte ) 0x82, 0x01, 0x00 }, TLV.getBytes( 256 ) ) ); assertTrue( Arrays.equals( new byte[] { ( byte ) 0x82, ( byte ) 0xFF, ( byte ) 0xFF }, TLV.getBytes( 65535 ) ) ); assertTrue( Arrays.equals( new byte[] { ( byte ) 0x83, 0x01, 0x00, 0x00 }, TLV.getBytes( 65536 ) ) ); assertTrue( Arrays.equals( new byte[] { ( byte ) 0x83, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, TLV.getBytes( 16777215 ) ) ); assertTrue( Arrays.equals( new byte[] { ( byte ) 0x84, 0x01, 0x00, 0x00, 0x00 }, TLV.getBytes( 16777216 ) ) ); assertTrue( Arrays .equals( new byte[] { ( byte ) 0x84, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, TLV .getBytes( 0xFFFFFFFF ) ) ); } } PrimitivesTest.java000066400000000000000000000163341525525160600361600ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Test the Primitives * * @author Apache Directory Project */ @Execution(ExecutionMode.CONCURRENT) public class PrimitivesTest { /** * Test the Integer Primitive * * @throws IntegerDecoderException If the test failed */ @Test public void testIntegerPrimitive() throws IntegerDecoderException { BerValue value = new BerValue(); value.init( 1 ); value.setData( new byte[] { 0x00 } ); // res = 0 assertEquals( 0, IntegerDecoder.parse( value ) ); value.reset(); value.init( 1 ); value.setData( new byte[] { 0x01 } ); // res = 1 assertEquals( 1, IntegerDecoder.parse( value ) ); value.reset(); value.init( 1 ); value.setData( new byte[] { ( byte ) 0xFF } ); // res = 255 assertEquals( -1, IntegerDecoder.parse( value ) ); value.reset(); value.init( 2 ); value.setData( new byte[] { ( byte ) 0x00, ( byte ) 0xFF } ); // res = 255 assertEquals( 255, IntegerDecoder.parse( value ) ); value.reset(); value.init( 2 ); value.setData( new byte[] { 0x00, 0x01 } ); // res = 1 assertEquals( 1, IntegerDecoder.parse( value ) ); value.reset(); value.init( 2 ); value.setData( new byte[] { 0x01, 0x00 } ); // res = 256 assertEquals( 256, IntegerDecoder.parse( value ) ); value.reset(); value.init( 2 ); value.setData( new byte[] { 0x01, 0x01 } ); // res = 257 assertEquals( 257, IntegerDecoder.parse( value ) ); value.reset(); value.init( 2 ); value.setData( new byte[] { 0x01, ( byte ) 0xFF } ); // res = 511 assertEquals( 511, IntegerDecoder.parse( value ) ); value.reset(); value.init( 2 ); value.setData( new byte[] { 0x02, 0x00 } ); // res = 512 assertEquals( 512, IntegerDecoder.parse( value ) ); value.reset(); value.init( 2 ); value.setData( new byte[] { 0x7F, ( byte ) 0xFF } ); // res = 32767 assertEquals( 32767, IntegerDecoder.parse( value ) ); value.reset(); value.init( 2 ); value.setData( new byte[] { ( byte ) 0x80, 0x00 } ); // res = -32768 assertEquals( -32768, IntegerDecoder.parse( value ) ); value.reset(); value.init( 2 ); value.setData( new byte[] { ( byte ) 0xFF, ( byte ) 0xFF } ); // res = -65535 assertEquals( -1, IntegerDecoder.parse( value ) ); value.reset(); value.init( 3 ); value.setData( new byte[] { 0x00, ( byte ) 0xFF, ( byte ) 0xFF } ); // res = 65535 assertEquals( 65535, IntegerDecoder.parse( value ) ); value.reset(); value.init( 3 ); // res = 65536 value.setData( new byte[] { 0x01, 0x00, 0x00 } ); assertEquals( 65536, IntegerDecoder.parse( value ) ); value.reset(); value.init( 3 ); // res = 8388607 value.setData( new byte[] { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF } ); assertEquals( 8388607, IntegerDecoder.parse( value ) ); value.reset(); value.init( 3 ); // res = -8388608 value.setData( new byte[] { ( byte ) 0x80, ( byte ) 0x00, ( byte ) 0x00 } ); assertEquals( -8388608, IntegerDecoder.parse( value ) ); value.reset(); value.init( 3 ); // res = -1 value.setData( new byte[] { ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } ); assertEquals( -1, IntegerDecoder.parse( value ) ); value.reset(); value.init( 4 ); // res = 16777215 value.setData( new byte[] { 0x00, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } ); assertEquals( 16777215, IntegerDecoder.parse( value ) ); value.reset(); value.init( 4 ); // res = 2^31 - 1 = MaxInt value.setData( new byte[] { ( byte ) 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } ); assertEquals( Integer.MAX_VALUE, IntegerDecoder.parse( value ) ); value.reset(); value.init( 4 ); // res = 2^31 = MinInt value.setData( new byte[] { ( byte ) 0x80, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00 } ); assertEquals( Integer.MIN_VALUE, IntegerDecoder.parse( value ) ); value.reset(); value.init( 4 ); // res = -1 value.setData( new byte[] { ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } ); assertEquals( -1, IntegerDecoder.parse( value ) ); value.reset(); try { value.init( 5 ); // 2^31 : does not fit in an int, must be rejected instead of // silently wrapping to Integer.MIN_VALUE value.setData( new byte[] { 0x00, ( byte ) 0x80, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00 } ); IntegerDecoder.parse( value ); fail(); } catch ( IntegerDecoderException ide ) { // Expected value.reset(); } try { value.init( 5 ); // 2^32 - 1 = 4294967295 : does not fit in an int, must be rejected // instead of silently wrapping to -1 value.setData( new byte[] { 0x00, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } ); IntegerDecoder.parse( value ); fail(); } catch ( IntegerDecoderException ide ) { // Expected value.reset(); } try { value.init( 5 ); // res = 2^31 = MinInt value.setData( new byte[] { 0x00, ( byte ) 0x7F, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00 } ); // res IntegerDecoder.parse( value ); fail(); } catch ( IntegerDecoderException ide ) { // Expected } } } // end class TLVTagDecoderTest ValueTest.java000066400000000000000000000637231525525160600351050ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.asn1.ber.tlv; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.Arrays; import org.apache.directory.api.asn1.EncoderException; import org.apache.directory.api.asn1.util.Asn1StringUtils; import org.apache.directory.api.asn1.util.BitString; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * This class is used to test the Value class * * @author Apache Directory Project */ @Execution(ExecutionMode.CONCURRENT) public class ValueTest { /** * Test the getNbBytes method for an int value */ @Test public void testValueIntGetNbBytes() { assertEquals( 1, BerValue.getNbBytes( 0x00000000 ) ); assertEquals( 1, BerValue.getNbBytes( 0x00000001 ) ); assertEquals( 2, BerValue.getNbBytes( 0x000000FF ) ); assertEquals( 2, BerValue.getNbBytes( 0x00000100 ) ); assertEquals( 3, BerValue.getNbBytes( 0x0000FFFF ) ); assertEquals( 3, BerValue.getNbBytes( 0x00010000 ) ); assertEquals( 4, BerValue.getNbBytes( 0x00FFFFFF ) ); assertEquals( 4, BerValue.getNbBytes( 0x01000000 ) ); assertEquals( 1, BerValue.getNbBytes( -1 ) ); assertEquals( 4, BerValue.getNbBytes( 0x7FFFFFFF ) ); assertEquals( 1, BerValue.getNbBytes( 0xFFFFFFFF ) ); } /** * Test the getNbBytes method for a long value */ @Test public void testValueLongGetNbBytes() { assertEquals( 1, BerValue.getNbBytes( 0x0000000000000000L ) ); assertEquals( 1, BerValue.getNbBytes( 0x0000000000000001L ) ); assertEquals( 2, BerValue.getNbBytes( 0x00000000000000FFL ) ); assertEquals( 2, BerValue.getNbBytes( 0x0000000000000100L ) ); assertEquals( 3, BerValue.getNbBytes( 0x000000000000FFFFL ) ); assertEquals( 3, BerValue.getNbBytes( 0x0000000000010000L ) ); assertEquals( 4, BerValue.getNbBytes( 0x0000000000FFFFFFL ) ); assertEquals( 4, BerValue.getNbBytes( 0x0000000001000000L ) ); assertEquals( 5, BerValue.getNbBytes( 0x00000000FFFFFFFFL ) ); assertEquals( 5, BerValue.getNbBytes( 0x0000000100000000L ) ); assertEquals( 6, BerValue.getNbBytes( 0x000000FFFFFFFFFFL ) ); assertEquals( 6, BerValue.getNbBytes( 0x0000010000000000L ) ); assertEquals( 7, BerValue.getNbBytes( 0x0000FFFFFFFFFFFFL ) ); assertEquals( 7, BerValue.getNbBytes( 0x0001000000000000L ) ); assertEquals( 8, BerValue.getNbBytes( 0x00FFFFFFFFFFFFFFL ) ); assertEquals( 8, BerValue.getNbBytes( 0x0100000000000000L ) ); assertEquals( 1, BerValue.getNbBytes( -1L ) ); assertEquals( 8, BerValue.getNbBytes( 0x7FFFFFFFFFFFFFFFL ) ); assertEquals( 1, BerValue.getNbBytes( 0xFFFFFFFFFFFFFFFFL ) ); } /** * Test the generation of an Integer Value * */ @Test public void testGetBytesInt() { int[] positiveValues = new int[] { 0x00, 0x01, 0x7F, 0x0080, 0x0081, 0x7FFF, 0x008000, 0x008001, 0x7FFFFF, 0x00800000, 0x00800001, 0x7FFFFFFF }; byte[][] expectedPositiveBytes = new byte[][] { // 1 byte { 0x00 }, { 0x01 }, { 0x7F }, // 2 bytes { 0x00, ( byte ) 0x80 }, { 0x00, ( byte ) 0x81 }, { 0x7F, ( byte ) 0xFF }, // 3 bytes { 0x00, ( byte ) 0x80, 0x00 }, { 0x00, ( byte ) 0x80, 0x01 }, { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF }, // 4 bytes { 0x00, ( byte ) 0x80, 0x00, 0x00 }, { 0x00, ( byte ) 0x80, 0x00, 0x01 }, { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } }; int[] negativeValues = new int[] { // 1 byte -1, -127, -128, // 2 bytes -129, -255, -256, -257, -32767, -32768, // 3 bytes -32769, -65535, -65536, -65537, -8388607, -8388608, // 4 bytes -8388609, -16777215, -16777216, -16777217, -2147483647, -2147483648, }; byte[][] expectedNegativeBytes = new byte[][] { // 1 byte { ( byte ) 0xFF }, { ( byte ) 0x81 }, { ( byte ) 0x80 }, // 2 bytes { ( byte ) 0xFF, 0x7F }, { ( byte ) 0xFF, 0x01 }, { ( byte ) 0xFF, 0x00 }, { ( byte ) 0xFE, ( byte ) 0xFF }, { ( byte ) 0x80, 0x01 }, { ( byte ) 0x80, 0x00 }, // 3 bytes { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF }, { ( byte ) 0xFF, 0x00, 0x01 }, { ( byte ) 0xFF, 0x00, 0x00 }, { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0x80, 0x00, 0x01 }, { ( byte ) 0x80, 0x00, 0x00 }, // 4 bytes { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0xFF, 0x00, 0x00, 0x01 }, { ( byte ) 0xFF, 0x00, 0x00, 0x00 }, { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0x80, 0x00, 0x00, 0x01 }, { ( byte ) 0x80, 0x00, 0x00, 0x00 } }; int i = 0; for ( int value:positiveValues ) { byte[] bb = BerValue.getBytes( value ); assertEquals( expectedPositiveBytes[i].length, bb.length ); assertTrue( Arrays.equals( expectedPositiveBytes[i], bb ) ); i++; } i = 0; for ( int value:negativeValues ) { byte[] bb = BerValue.getBytes( value ); assertEquals( expectedNegativeBytes[i].length, bb.length ); assertTrue( Arrays.equals( expectedNegativeBytes[i], bb ) ); i++; } byte[] bb = BerValue.getBytes( 0x00000000 ); assertEquals( 1, bb.length ); assertEquals( 0, bb[0] ); bb = BerValue.getBytes( 0x00000001 ); assertEquals( 1, bb.length ); assertEquals( 1, bb[0] ); bb = BerValue.getBytes( 0x0000007F ); assertEquals( 1, bb.length ); assertEquals( 0x7F, bb[0] ); bb = BerValue.getBytes( 0x00000080 ); assertEquals( 2, bb.length ); assertEquals( 0x00, bb[0] ); assertEquals( ( byte ) 0x80, bb[1] ); bb = BerValue.getBytes( 0x000000FF ); assertEquals( 2, bb.length ); assertEquals( 0x00, bb[0] ); assertEquals( ( byte ) 0xFF, bb[1] ); bb = BerValue.getBytes( 0x00007FFF ); assertEquals( 2, bb.length ); assertEquals( 0x7F, bb[0] ); assertEquals( ( byte ) 0xFF, bb[1] ); bb = BerValue.getBytes( 0x00008000 ); assertEquals( 3, bb.length ); assertEquals( 0x00, bb[0] ); assertEquals( ( byte ) 0x80, bb[1] ); assertEquals( 0x00, bb[2] ); bb = BerValue.getBytes( 0x0000FFFF ); assertEquals( 3, bb.length ); assertEquals( 0x00, bb[0] ); assertEquals( ( byte ) 0xFF, bb[1] ); assertEquals( ( byte ) 0xFF, bb[2] ); bb = BerValue.getBytes( 0x00010000 ); assertEquals( 3, bb.length ); assertEquals( 0x01, bb[0] ); assertEquals( 0x00, bb[1] ); assertEquals( 0x00, bb[2] ); bb = BerValue.getBytes( 0x007FFFFF ); assertEquals( 3, bb.length ); assertEquals( 0x7F, bb[0] ); assertEquals( ( byte ) 0xFF, bb[1] ); assertEquals( ( byte ) 0xFF, bb[2] ); bb = BerValue.getBytes( 0x00800000 ); assertEquals( 4, bb.length ); assertEquals( 0x00, bb[0] ); assertEquals( ( byte ) 0x80, bb[1] ); assertEquals( 0x00, bb[2] ); assertEquals( 0x00, bb[3] ); bb = BerValue.getBytes( 0x00FFFFFF ); assertEquals( 4, bb.length ); assertEquals( 0x00, bb[0] ); assertEquals( ( byte ) 0xFF, bb[1] ); assertEquals( ( byte ) 0xFF, bb[2] ); assertEquals( ( byte ) 0xFF, bb[3] ); bb = BerValue.getBytes( 0x01000000 ); assertEquals( 4, bb.length ); assertEquals( 0x01, bb[0] ); assertEquals( 0x00, bb[1] ); assertEquals( 0x00, bb[2] ); assertEquals( 0x00, bb[3] ); bb = BerValue.getBytes( 0x7FFFFFFF ); assertEquals( 4, bb.length ); assertEquals( 0x7F, bb[0] ); assertEquals( ( byte ) 0xFF, bb[1] ); assertEquals( ( byte ) 0xFF, bb[2] ); assertEquals( ( byte ) 0xFF, bb[3] ); bb = BerValue.getBytes( 0x80000000 ); assertEquals( 4, bb.length ); assertEquals( ( byte ) 0x80, bb[0] ); assertEquals( ( byte ) 0x00, bb[1] ); assertEquals( ( byte ) 0x00, bb[2] ); assertEquals( ( byte ) 0x00, bb[3] ); bb = BerValue.getBytes( 0xFFFFFFFF ); assertEquals( 1, bb.length ); assertEquals( ( byte ) 0xFF, bb[0] ); bb = BerValue.getBytes( 0xFFFFFF80 ); assertEquals( 1, bb.length ); assertEquals( ( byte ) 0x80, bb[0] ); bb = BerValue.getBytes( 0xFFFFFF7F ); assertEquals( 2, bb.length ); assertEquals( ( byte ) 0xFF, bb[0] ); assertEquals( 0x7F, bb[1] ); bb = BerValue.getBytes( 0xFFFFFF00 ); assertEquals( 2, bb.length ); assertEquals( ( byte ) 0xFF, bb[0] ); assertEquals( 0x00, bb[1] ); bb = BerValue.getBytes( 0xFFFF8000 ); assertEquals( 2, bb.length ); assertEquals( ( byte ) 0x80, bb[0] ); assertEquals( 0x00, bb[1] ); bb = BerValue.getBytes( 0xFFFF7FFF ); assertEquals( 3, bb.length ); assertEquals( ( byte ) 0xFF, bb[0] ); assertEquals( 0x7F, bb[1] ); assertEquals( ( byte ) 0xFF, bb[2] ); bb = BerValue.getBytes( 0xFFFF0000 ); assertEquals( 3, bb.length ); assertEquals( ( byte ) 0xFF, bb[0] ); assertEquals( 0x00, bb[1] ); assertEquals( 0x00, bb[2] ); bb = BerValue.getBytes( 0xFF800000 ); assertEquals( 3, bb.length ); assertEquals( ( byte ) 0x80, bb[0] ); assertEquals( 0x00, bb[1] ); assertEquals( 0x00, bb[2] ); bb = BerValue.getBytes( 0xFF7FFFFF ); assertEquals( 4, bb.length ); assertEquals( ( byte ) 0xFF, bb[0] ); assertEquals( 0x7F, bb[1] ); assertEquals( ( byte ) 0xFF, bb[2] ); assertEquals( ( byte ) 0xFF, bb[3] ); bb = BerValue.getBytes( 0xFF000000 ); assertEquals( 4, bb.length ); assertEquals( ( byte ) 0xFF, bb[0] ); assertEquals( 0x00, bb[1] ); assertEquals( 0x00, bb[2] ); assertEquals( 0x00, bb[3] ); bb = BerValue.getBytes( 0x80000000 ); assertEquals( 4, bb.length ); assertEquals( ( byte ) 0x80, bb[0] ); assertEquals( 0x00, bb[1] ); assertEquals( 0x00, bb[2] ); assertEquals( 0x00, bb[3] ); } /** * Test the generation of a Long Value * */ @Test public void testGetBytesLong() { long[] positiveValues = new long[] { 0x00L, 0x01L, 0x7FL, 0x0080L, 0x0081L, 0x7FFFL, 0x008000L, 0x008001L, 0x7FFFFFL, 0x00800000L, 0x00800001L, 0x7FFFFFFFL, 0x0080000000L, 0x0080000001L, 0x7FFFFFFFFFL, 0x008000000000L, 0x008000000001L, 0x7FFFFFFFFFFFL, 0x00800000000000L, 0x00800000000001L, 0x7FFFFFFFFFFFFFL, 0x0080000000000000L, 0x0080000000000001L, 0x7FFFFFFFFFFFFFFFL }; byte[][] expectedPositiveBytes = new byte[][] { // 1 byte { 0x00 }, { 0x01 }, { 0x7F }, // 2 bytes { 0x00, ( byte ) 0x80 }, { 0x00, ( byte ) 0x81 }, { 0x7F, ( byte ) 0xFF }, // 3 bytes { 0x00, ( byte ) 0x80, 0x00 }, { 0x00, ( byte ) 0x80, 0x01 }, { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF }, // 4 bytes { 0x00, ( byte ) 0x80, 0x00, 0x00 }, { 0x00, ( byte ) 0x80, 0x00, 0x01 }, { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, // 5 bytes { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00 }, { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x01 }, { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, // 6 bytes { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00 }, { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x01 }, { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, // 7 bytes { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x01 }, { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, // 8 bytes { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } }; long[] negativeValues = new long[] { // 1 byte -1L, -127L, -128L, // 2 bytes -129L, -255L, -256L, -257L, -32767L, -32768L, // 3 bytes -32769L, -65535L, -65536L, -65537L, -8388607L, -8388608L, // 4 bytes -8388609L, -16777215L, -16777216L, -16777217L, -2147483647L, -2147483648L, // 5 bytes -2147483649L, -4294967295L, -4294967296L, -4294967297L, -549755813887L, -549755813888L, // 6 bytes -549755813889L, -1099511627775L, -1099511627776L, -1099511627777L, -140737488355327L, -140737488355328L, // 7 bytes -140737488355329L, -281474976710655L, -281474976710656L, -281474976710657L, -36028797018963967L, -36028797018963968L, // 8 bytes -36028797018963969L, -72057594037927935L, -72057594037927936L, -72057594037927937L, -9223372036854775807L, -9223372036854775808L }; byte[][] expectedNegativeBytes = new byte[][] { // 1 byte { ( byte ) 0xFF }, { ( byte ) 0x81 }, { ( byte ) 0x80 }, // 2 bytes { ( byte ) 0xFF, 0x7F }, { ( byte ) 0xFF, 0x01 }, { ( byte ) 0xFF, 0x00 }, { ( byte ) 0xFE, ( byte ) 0xFF }, { ( byte ) 0x80, 0x01 }, { ( byte ) 0x80, 0x00 }, // 3 bytes { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF }, { ( byte ) 0xFF, 0x00, 0x01 }, { ( byte ) 0xFF, 0x00, 0x00 }, { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0x80, 0x00, 0x01 }, { ( byte ) 0x80, 0x00, 0x00 }, // 4 bytes { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0xFF, 0x00, 0x00, 0x01 }, { ( byte ) 0xFF, 0x00, 0x00, 0x00 }, { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0x80, 0x00, 0x00, 0x01 }, { ( byte ) 0x80, 0x00, 0x00, 0x00 }, // 5 bytes { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x01 }, { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00 }, { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x01 }, { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00 }, // 6 bytes { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x01 }, { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 }, { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x01 }, { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 7 bytes { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 8 bytes { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }, { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; int i = 0; for ( long value:positiveValues ) { byte[] bb = BerValue.getBytes( value ); assertEquals( expectedPositiveBytes[i].length, bb.length ); assertTrue( Arrays.equals( expectedPositiveBytes[i], bb ) ); i++; } i = 0; for ( long value:negativeValues ) { byte[] bb = BerValue.getBytes( value ); assertEquals( expectedNegativeBytes[i].length, bb.length ); assertTrue( Arrays.equals( expectedNegativeBytes[i], bb ) ); i++; } } @Test public void testEncodeInt2Bytes() { byte[] encoded = BerValue.getBytes( 128 ); assertEquals( 0x00, encoded[0] ); assertEquals( ( byte ) 0x80, encoded[1] ); encoded = BerValue.getBytes( -27066 ); assertEquals( ( byte ) 0x96, encoded[0] ); assertEquals( 0x46, encoded[1] ); } @Test public void testEncodeInt3Bytes() { byte[] encoded = BerValue.getBytes( 32787 ); assertEquals( 0x00, encoded[0] ); assertEquals( ( byte ) 0x80, encoded[1] ); assertEquals( ( byte ) 0x13, encoded[2] ); } @Test public void testEncodeInt() { byte[] encoded = null; int[] testedInt = new int[] { Integer.MIN_VALUE, -2147483647, -16777216, -16777215, -8388608, -8388607, -65536, -65535, -32768, -32767, -256, -255, -128, -127, -1, 0, 1, 127, 128, 255, 256, 32767, 32768, 65535, 65536, 8388607, 8388608, 16777215, 16777216, Integer.MAX_VALUE }; for ( int i:testedInt ) { encoded = BerValue.getBytes( i ); int value = new BigInteger( encoded ).intValue(); assertEquals( i, value ); } } /** * Test the decoding of integer values * * @throws Exception If the test failed */ @Test public void testDecodeInt() throws Exception { byte[] encoded = null; int[] testedInt = new int[] { Integer.MIN_VALUE, -2147483647, -16777216, -16777215, -8388608, -8388607, -65536, -65535, -32768, -32767, -256, -255, -128, -127, -1, 0, 1, 127, 128, 255, 256, 32767, 32768, 65535, 65536, 8388607, 8388608, 16777215, 16777216, Integer.MAX_VALUE }; for ( int i:testedInt ) { encoded = new BigInteger( Integer.toString( i ) ).toByteArray(); int value = IntegerDecoder.parse( new BerValue( encoded ) ); assertEquals( i, value ); } } /** * Test the decoding of long values * @throws Exception If the test failed */ @Test public void testDecodeLong() throws Exception { byte[] encoded = null; long[] testedLong = new long[] { Long.MIN_VALUE, -9223372036854775808L, -9223372036854775807L, -72057594037927937L, -72057594037927936L, -72057594037927935L, -36028797018963969L, -36028797018963968L, -36028797018963967L, -281474976710657L, -281474976710656L, -281474976710655L, -140737488355329L, -140737488355328L, -140737488355327L, -1099511627777L, -1099511627776L, -1099511627775L, -549755813889L, -549755813888L, -549755813887L, -4294967297L, -4294967296L, -4294967295L, -2147483649L, -2147483648L, -2147483647L, -16777216L, -16777215L, -8388608L, -8388607L, -65536L, -65535L, -32769L, -32768L, -32767L, -257L, -256L, -255L, -129L, -128L, -127L, -1L, 0L, 1L, 127L, 128L, 255L, 256L, 32767L, 32768L, 32769L, 65535L, 65536L, 8388607L, 8388608L, 8388609L, 2147483647L, 2147483648L, 2147483649L, 549755813887L, 549755813888L, 549755813889L, 140737488355327L, 140737488355328L, 140737488355329L, 36028797018963967L, 36028797018963967L, 36028797018963967L, Long.MAX_VALUE }; for ( long i:testedLong ) { encoded = new BigInteger( Long.toString( i ) ).toByteArray(); long value = LongDecoder.parse( new BerValue( encoded ) ); assertEquals( i, value ); } } @Test public void testNewByteArrayValue() { byte[] bb = new byte[] { 0x01, ( byte ) 0xFF }; BerValue v = new BerValue( bb ); byte[] vv = v.getData(); assertEquals( 0x01, vv[0] ); assertEquals( ( byte ) 0xFF, vv[1] ); bb[0] = 0x00; assertEquals( 0x01, vv[0] ); } @Test public void testEncodeBitString() { BitString bs = new BitString( 10 ); bs.setBit( 9 ); ByteBuffer buffer = ByteBuffer.allocate( 5 ); try { BerValue.encode( buffer, bs ); } catch ( EncoderException ee ) { fail(); } assertEquals( "0x03 0x03 0x06 0x00 0x40 ", Asn1StringUtils.dumpBytes( buffer.array() ) ); } } apache-directory-ldap-api-cfb3cee/asn1/pom.xml000066400000000000000000000027431525525160600214520ustar00rootroot00000000000000 4.0.0 org.apache.directory.api api-parent 2.1.9 api-asn1-parent Apache Directory API ASN.1 Parent 2003 pom api ber apache-directory-ldap-api-cfb3cee/asn1/src/000077500000000000000000000000001525525160600207165ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/src/site/000077500000000000000000000000001525525160600216625ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/asn1/src/site/site.xml000066400000000000000000000025501525525160600233520ustar00rootroot00000000000000 apache-directory-ldap-api-cfb3cee/distribution/000077500000000000000000000000001525525160600220045ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/distribution/.gitignore000066400000000000000000000002501525525160600237710ustar00rootroot00000000000000target maven-eclipse.xml lib .externalToolBuilders felix-cache .project .classpath .settings eclipse-classes *.log *.iml *.ipr bin dependency-reduced-pom.xml META-INF apache-directory-ldap-api-cfb3cee/distribution/pom.xml000066400000000000000000000137631525525160600233330ustar00rootroot00000000000000 4.0.0 org.apache.directory.api api-parent 2.1.9 apache-ldap-api Apache Directory LDAP API Distribution pom ${project.groupId} api-asn1-api ${project.groupId} api-i18n ${project.groupId} api-ldap-client-api ${project.groupId} api-ldap-extras-aci ${project.groupId} api-ldap-model ${project.groupId} api-ldap-schema-converter ${project.groupId} api-ldap-schema-data ${project.groupId} api-util ${project.groupId} api-all org.apache.commons commons-collections4 org.slf4j slf4j-api apache-release org.apache.maven.plugins maven-install-plugin true maven-dependency-plugin additional-jars package copy ${project.build.directory}/additional-jars org.slf4j slf4j-api org.apache.commons commons-collections4 maven-assembly-plugin package package gnu src/main/assembly/bin.xml src/main/assembly/src.xml single anon package gnu src/main/assembly/anon.xml org.apache.directory.ldap.client.api.LdifAnonymizer anon-${project.version}.jar single org.apache.maven.plugins maven-gpg-plugin sign-artifacts verify sign apache-directory-ldap-api-cfb3cee/distribution/src/000077500000000000000000000000001525525160600225735ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/distribution/src/main/000077500000000000000000000000001525525160600235175ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/distribution/src/main/assembly/000077500000000000000000000000001525525160600253365ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/distribution/src/main/assembly/anon.xml000066400000000000000000000046251525525160600270220ustar00rootroot00000000000000 anon jar anon-${project-version}.jar false / org.apache.directory.api:api-asn1-api:jar:${project.version} org.apache.directory.api:api-i18n:jar:${project.version} org.apache.directory.api:api-ldap-client-api:jar:${project.version} org.apache.directory.api:api-ldap-extras-aci:jar:${project.version} org.apache.directory.api:api-ldap-model:jar:${project.version} org.apache.directory.api:api-ldap-schema-converter:jar:${project.version} org.apache.directory.api:api-ldap-schema-data:jar:${project.version} org.apache.directory.api:api-util:jar:${project.version} org.apache.commons:commons-collections4:jar:${commons.collections.version} org.slf4j:slf4j-api:jar:${slf4j.api.version} true apache-directory-ldap-api-cfb3cee/distribution/src/main/assembly/bin.xml000066400000000000000000000035351525525160600266360ustar00rootroot00000000000000 bin zip tar.gz ${project.build.finalName}-bin src/main/release / ** target/additional-jars /lib /lib false runtime apache-directory-ldap-api-cfb3cee/distribution/src/main/assembly/src.xml000066400000000000000000000040021525525160600266430ustar00rootroot00000000000000 src zip tar.gz ${project.build.finalName}-src ${project.basedir}/.. / true / LICENSE NOTICE **/.*/** **/*.log **/${project.build.directory}/** src/main/release / ** apache-directory-ldap-api-cfb3cee/distribution/src/main/release/000077500000000000000000000000001525525160600251375ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/distribution/src/main/release/LICENSE000066400000000000000000000330271525525160600261510ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================================================================== -------------------------------------------------------------------------------------------------- # Indiana University Extreme! Lab Software License # # Version 1.1.1 # # Copyright (c) 2002 Extreme! Lab, Indiana University. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the distribution. # # 3. The end-user documentation included with the redistribution, if any, # must include the following acknowledgment: # # "This product includes software developed by the Indiana University # Extreme! Lab (http://www.extreme.indiana.edu/)." # # Alternately, this acknowledgment may appear in the software itself, # if and wherever such third-party acknowledgments normally appear. # # 4. The names "Indiana Univeristy" and "Indiana Univeristy Extreme! Lab" # must not be used to endorse or promote products derived from this # software without prior written permission. For written permission, # please contact http://www.extreme.indiana.edu/. # # 5. Products derived from this software may not use "Indiana Univeristy" # name nor may "Indiana Univeristy" appear in their name, without prior # written permission of the Indiana University. # # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS OR ITS CONTRIBUTORS # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # apache-directory-ldap-api-cfb3cee/distribution/src/main/release/NOTICE000066400000000000000000000023111525525160600260400ustar00rootroot00000000000000Apache Directory LDAP API Distribution Copyright 2003-2026 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (https://www.apache.org/). Additional copyright notices and license terms applicable are present in the 'licenses' directory. This product includes/uses Apache Commons (https://commons.apache.org/). This product includes/uses Apache Logging Services (https://logging.apache.org/). This product includes/uses Apache Felix (https://felix.apache.org/). This product uses Apache Maven (https://maven.apache.org/). This product includes/uses Apache Mina (https://mina.apache.org/). This product uses software, JUnit (http://junit.org), developed by JUnit (http://www.junit.org) This product includes/uses software, dom4j (http://dom4j.org), developed by MetaStuff Ltd. (http://sourceforge.net/projects/dom4j). This product includes/uses software, SLF4J API Module (http://www.slf4j.org), developed by QOS.ch (http://www.qos.ch) This product includes/uses software, jBCrypt 0.4.1 (http://www.mindrot.org/files/jBCrypt) This product includes/uses software, XMLPullParser 3 - xpp3:xpp3:jar:1.1.3.4.O (http://www.extreme.indiana.edu/xgws/xsoap/xpp/mxp1/) apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licenses/000077500000000000000000000000001525525160600267445ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licenses/dom4j-LICENSE.txt000066400000000000000000000036271525525160600316120ustar00rootroot00000000000000dom4j 1.6.1 (http://dom4j.sourceforge.net/dom4j-1.6.1/license.html) : Redistribution and use of this software and associated documentation ("Software"), with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain copyright statements and notices. Redistributions must also contain a copy of this document. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name "DOM4J" must not be used to endorse or promote products derived from this Software without prior written permission of MetaStuff, Ltd. For written permission, please contact dom4j-info@metastuff.com. 4. Products derived from this Software may not be called "DOM4J" nor may "DOM4J" appear in their names without prior written permission of MetaStuff, Ltd. DOM4J is a registered trademark of MetaStuff, Ltd. 5. Due credit should be given to the DOM4J Project - http://dom4j.sourceforge.net THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved. apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licenses/jbcrypt-LICENSE.txt000066400000000000000000000015041525525160600322420ustar00rootroot00000000000000jBCrypt is subject to the following license: /* * Copyright (c) 2006 Damien Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licenses/slf4j-LICENSE.txt000066400000000000000000000022541525525160600316120ustar00rootroot00000000000000SLF4J (http://www.slf4j.org/license.html) Copyright (c) 2004-2008 QOS.ch All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. xml-apis-LICENSE.dom-documentation.txt000066400000000000000000000077631525525160600357020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licensesxml-commons/java/external/LICENSE.dom-documentation.txt $Id: LICENSE.dom-documentation.txt,v 1.1 2002/01/31 23:13:42 curcuru Exp $ This license came from: http://www.w3.org/Consortium/Legal/copyright-documents-19990405 W3CŽ DOCUMENT NOTICE AND LICENSE Copyright Š 1994-2001 World Wide Web Consortium, World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/ Public documents on the W3C site are provided by the copyright holders under the following license. The software or Document Type Definitions (DTDs) associated with W3C specifications are governed by the Software Notice. By using and/or copying this document, or the W3C document from which this statement is linked, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions: Permission to use, copy, and distribute the contents of this document, or the W3C document from which this statement is linked, in any medium for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the document, or portions thereof, that you use: A link or URL to the original W3C document. The pre-existing copyright notice of the original author, or if it doesn't exist, a notice of the form: "Copyright Š [$date-of-document] World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/" (Hypertext is preferred, but a textual representation is permitted.) If it exists, the STATUS of the W3C document. When space permits, inclusion of the full text of this NOTICE should be provided. We request that authorship attribution be provided in any software, documents, or other items or products that you create pursuant to the implementation of the contents of this document, or any portion thereof. No right to create modifications or derivatives of W3C documents is granted pursuant to this license. However, if additional requirements (documented in the Copyright FAQ) are satisfied, the right to create modifications or derivatives is sometimes granted by the W3C to individuals complying with those requirements. THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF. The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to this document or its contents without specific, written prior permission. Title to copyright in this document will at all times remain with copyright holders. ---------------------------------------------------------------------------- This formulation of W3C's notice and license became active on April 05 1999 so as to account for the treatment of DTDs, schema's and bindings. See the older formulation for the policy prior to this date. Please see our Copyright FAQ for common questions about using materials from our site, including specific terms and conditions for packages like libwww, Amaya, and Jigsaw. Other questions about this notice can be directed to site-policy@w3.org. webmaster (last updated by reagle on 1999/04/99.)xml-apis-LICENSE.dom-software.txt000066400000000000000000000070131525525160600346470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licensesxml-commons/java/external/LICENSE.dom-software.txt $Id: LICENSE.dom-software.txt,v 1.1 2002/01/31 23:13:42 curcuru Exp $ This license came from: http://www.w3.org/Consortium/Legal/copyright-software-19980720 W3CŽ SOFTWARE NOTICE AND LICENSE Copyright Š 1994-2001 World Wide Web Consortium, World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/ This W3C work (including software, documents, or other related items) is being provided by the copyright holders under the following license. By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions: Permission to use, copy, modify, and distribute this software and its documentation, with or without modification,  for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications, that you make: The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, a short notice of the following form (hypertext is preferred, text is permitted) should be used within the body of any redistributed or derivative code: "Copyright Š [$date-of-software] World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/" Notice of any changes or modifications to the W3C files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.) THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION. The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders. ____________________________________ This formulation of W3C's notice and license became active on August 14 1998 so as to improve compatibility with GPL. This version ensures that W3C software licensing terms are no more restrictive than GPL and consequently W3C software may be distributed in GPL packages. See the older formulation for the policy prior to this date. Please see our Copyright FAQ for common questions about using materials from our site, including specific terms and conditions for packages like libwww, Amaya, and Jigsaw. Other questions about this notice can be directed to site-policy@w3.org. webmaster (last updated $Date: 2002/01/31 23:13:42 $)apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licenses/xml-apis-LICENSE.sax.txt000066400000000000000000000014441525525160600331140ustar00rootroot00000000000000xml-commons/java/external/LICENSE.sax.txt $Id: LICENSE.sax.txt,v 1.1 2002/01/31 23:26:48 curcuru Exp $ This license came from: http://www.megginson.com/SAX/copying.html However please note future versions of SAX may be covered under http://saxproject.org/?selected=pd This page is now out of date -- see the new SAX site at http://www.saxproject.org/ for more up-to-date releases and other information. Please change your bookmarks. SAX2 is Free! I hereby abandon any property rights to SAX 2.0 (the Simple API for XML), and release all of the SAX 2.0 source code, compiled code, and documentation contained in this distribution into the Public Domain. SAX comes with NO WARRANTY or guarantee of fitness for any purpose. David Megginson, david@megginson.com 2000-05-05apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licenses/xml-apis-README.dom.txt000066400000000000000000000024041525525160600327500ustar00rootroot00000000000000xml-commons/java/external/README.dom.txt $Id: README.dom.txt,v 1.1 2002/01/31 23:13:42 curcuru Exp $ HEAR YE, HEAR YE! All of the .java software and associated documentation about the DOM in this repository are distributed under the license from the W3C, which is provided herein. LICENSE.dom-software.txt covers all software from the W3C including the following items in the xml-commons project: xml-commons/java/external/src/org/w3c and all subdirectories LICENSE.dom-documentation.txt covers all documentation from the W3C including the following items in the xml-commons project: xml-commons/java/external/xdocs/dom and all subdirectories The actual DOM Java Language Binding classes in xml-commons came from: http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/java-binding.html The original versions are tagged 'DOM_LEVEL_2' The specification of DOM Level 2's various parts is at: http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113/ http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/ http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/ http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/ apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licenses/xml-apis-README.sax.txt000066400000000000000000000013121525525160600327610ustar00rootroot00000000000000xml-commons/java/external/README.sax.txt $Id: README.sax.txt,v 1.1 2002/01/31 23:26:48 curcuru Exp $ HEAR YE, HEAR YE! All of the .java software and associated documentation about SAX in this repository are distributed freely in the public domain. LICENSE.sax.txt covers all software and documentation from the megginson.com including the following in the xml-commons project: xml-commons/java/external/src/org/xml/sax and all subdirectories xml-commons/java/external/xdocs/sax and all subdirectories The actual SAX classes in xml-commons came from: http://www.megginson.com/Software/index.html The original versions are tagged 'SAX-2_0-r2-prerelease' apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licenses/xml-apis-README.txt000066400000000000000000000012401525525160600321670ustar00rootroot00000000000000xml-commons/README.txt $Id: README.txt,v 1.1 2002/01/31 23:42:49 curcuru Exp $ HEAR YE, HEAR YE! Software and documentation in this repository are covered under a number of different licenses. Most files under xml-commons/java/external/ are covered under their respective LICENSE.*.txt files; see the matching README.*.txt files for descriptions. Note that xml-commons/java/external/build.xml and xml-commons/java/external/src/manifest.commons are both covered under the Apache Software License. All files not otherwise noted are covered under the Apache Software License in LICENSE.txt including all files under xml-commons/java/src apache-directory-ldap-api-cfb3cee/distribution/src/main/release/licenses/xpp3-LICENSE.txt000066400000000000000000000043441525525160600314640ustar00rootroot00000000000000XPP3 (http://caldersphere.rubyforge.org/jrexml/files/lib/xpp3_LICENSE_txt.html) : Indiana University Extreme! Lab Software License Version 1.1.1 Copyright (c) 2002 Extreme! Lab, Indiana University. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Indiana University Extreme! Lab (http://www.extreme.indiana.edu/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 1. The names "Indiana Univeristy" and "Indiana Univeristy Extreme! Lab" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact www.extreme.indiana.edu/. 1. Products derived from this software may not use "Indiana Univeristy" name nor may "Indiana Univeristy" appear in their name, without prior written permission of the Indiana University. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. apache-directory-ldap-api-cfb3cee/doap_ldap-api.rdf000066400000000000000000000056121525525160600224600ustar00rootroot00000000000000 2007-04-17 Apache Directory LDAP API The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API). Java Lightweight Directory Access Protocol (LDAP): The Protocol IETF RFC 4511 The Kerberos Network Authentication Service (V5) IETF RFC 4120 apache-directory-ldap-api-cfb3cee/dsml/000077500000000000000000000000001525525160600202245ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/.gitignore000066400000000000000000000002501525525160600222110ustar00rootroot00000000000000target maven-eclipse.xml lib .externalToolBuilders felix-cache .project .classpath .settings eclipse-classes *.log *.iml *.ipr bin dependency-reduced-pom.xml META-INF apache-directory-ldap-api-cfb3cee/dsml/engine/000077500000000000000000000000001525525160600214715ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/.gitignore000066400000000000000000000002471525525160600234640ustar00rootroot00000000000000target maven-eclipse.xml lib .externalToolBuilders felix-cache .project .classpath .settings eclipse-classes *.log *.iml *.ipr bin dependency-reduced-pom.xml META-INF apache-directory-ldap-api-cfb3cee/dsml/engine/pom.xml000066400000000000000000000100551525525160600230070ustar00rootroot00000000000000 4.0.0 org.apache.directory.api api-dsml-parent 2.1.9 api-dsml-engine Apache Directory LDAP API DSML Engine bundle ${project.groupId} api-i18n ${project.groupId} api-dsml-parser ${project.groupId} api-ldap-client-api org.apache.servicemix.bundles org.apache.servicemix.bundles.xpp3 org.apache.servicemix.bundles org.apache.servicemix.bundles.dom4j org.apache.maven.plugins maven-jar-plugin META-INF/MANIFEST.MF false org.apache.felix maven-bundle-plugin true true META-INF ${project.groupId}.dsmlv2.engine org.apache.directory.api.dsmlv2.engine;version=${project.version};-noimport:=true org.apache.directory.api.dsmlv2;version=${project.version}, org.apache.directory.api.dsmlv2.request;version=${project.version}, org.apache.directory.api.dsmlv2.response;version=${project.version}, org.apache.directory.api.i18n;version=${project.version}, org.apache.directory.api.ldap.model.cursor;version=${project.version}, org.apache.directory.api.ldap.model.exception;version=${project.version}, org.apache.directory.api.ldap.model.message;version=${project.version}, org.apache.directory.api.util;version=${project.version}, org.apache.directory.ldap.client.api;version=${project.version}, org.dom4j;version=${dom4j.version}, org.slf4j;version=${slf4j.api.bundleversion}, org.xmlpull.v1;version=${xpp3.version} apache.directory.ldap.api.dsml.engine apache-directory-ldap-api-cfb3cee/dsml/engine/src/000077500000000000000000000000001525525160600222605ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/src/main/000077500000000000000000000000001525525160600232045ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/src/main/java/000077500000000000000000000000001525525160600241255ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/src/main/java/org/000077500000000000000000000000001525525160600247145ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/src/main/java/org/apache/000077500000000000000000000000001525525160600261355ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/src/main/java/org/apache/directory/000077500000000000000000000000001525525160600301415ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/src/main/java/org/apache/directory/api/000077500000000000000000000000001525525160600307125ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/src/main/java/org/apache/directory/api/dsmlv2/000077500000000000000000000000001525525160600321215ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/src/main/java/org/apache/directory/api/dsmlv2/engine/000077500000000000000000000000001525525160600333665ustar00rootroot00000000000000Dsmlv2Engine.java000066400000000000000000000734071525525160600364620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/src/main/java/org/apache/directory/api/dsmlv2/engine/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.engine; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; import org.apache.directory.api.dsmlv2.DsmlDecorator; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.OnError; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.Processing; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.ResponseOrder; import org.apache.directory.api.dsmlv2.request.Dsmlv2Grammar; import org.apache.directory.api.dsmlv2.response.AddResponseDsml; import org.apache.directory.api.dsmlv2.response.BatchResponseDsml; import org.apache.directory.api.dsmlv2.response.BindResponseDsml; import org.apache.directory.api.dsmlv2.response.CompareResponseDsml; import org.apache.directory.api.dsmlv2.response.DelResponseDsml; import org.apache.directory.api.dsmlv2.response.ErrorResponse; import org.apache.directory.api.dsmlv2.response.ErrorResponse.ErrorResponseType; import org.apache.directory.api.dsmlv2.response.ExtendedResponseDsml; import org.apache.directory.api.dsmlv2.response.ModDNResponseDsml; import org.apache.directory.api.dsmlv2.response.ModifyResponseDsml; import org.apache.directory.api.dsmlv2.response.SearchResponseDsml; import org.apache.directory.api.dsmlv2.response.SearchResultDoneDsml; import org.apache.directory.api.dsmlv2.response.SearchResultEntryDsml; import org.apache.directory.api.dsmlv2.response.SearchResultReferenceDsml; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.ldap.model.cursor.SearchCursor; import org.apache.directory.api.ldap.model.exception.LdapAuthenticationException; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.message.AbandonRequest; import org.apache.directory.api.ldap.model.message.AddRequest; import org.apache.directory.api.ldap.model.message.AddResponse; import org.apache.directory.api.ldap.model.message.BindRequest; import org.apache.directory.api.ldap.model.message.BindRequestImpl; import org.apache.directory.api.ldap.model.message.BindResponse; import org.apache.directory.api.ldap.model.message.CompareRequest; import org.apache.directory.api.ldap.model.message.CompareResponse; import org.apache.directory.api.ldap.model.message.DeleteRequest; import org.apache.directory.api.ldap.model.message.DeleteResponse; import org.apache.directory.api.ldap.model.message.ExtendedRequest; import org.apache.directory.api.ldap.model.message.ExtendedResponse; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.ModifyDnRequest; import org.apache.directory.api.ldap.model.message.ModifyDnResponse; import org.apache.directory.api.ldap.model.message.ModifyRequest; import org.apache.directory.api.ldap.model.message.ModifyResponse; import org.apache.directory.api.ldap.model.message.Request; import org.apache.directory.api.ldap.model.message.Response; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.message.SearchRequest; import org.apache.directory.api.ldap.model.message.SearchResultDone; import org.apache.directory.api.ldap.model.message.SearchResultEntry; import org.apache.directory.api.ldap.model.message.SearchResultReference; import org.apache.directory.api.util.Strings; import org.apache.directory.ldap.client.api.LdapConnection; import org.apache.directory.ldap.client.api.LdapNetworkConnection; import org.dom4j.Element; import org.dom4j.Namespace; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xmlpull.v1.XmlPullParserException; /** * This is the DSMLv2Engine. It can be use to execute operations on a LDAP Server and get the results of these operations. * The format used for request and responses is the DSMLv2 format. * * @author Apache Directory Project */ public class Dsmlv2Engine { /** The user. */ protected String user; /** The password. */ protected String password; /** The LDAP connection */ protected LdapConnection connection; /** The DSVMv2 parser. */ protected Dsmlv2Parser parser; /** The continue on error flag. */ protected boolean continueOnError; /** The exit flag. */ protected boolean exit = false; /** The batch request. */ protected BatchRequestDsml batchRequest; /** The batch response. */ protected BatchResponseDsml batchResponse = new BatchResponseDsml(); /** The DSML v2 grammar */ protected Dsmlv2Grammar grammar = new Dsmlv2Grammar(); /** flag to indicate to generate the response in a SOAP envelope */ protected boolean generateSoapResp = false; /** A logger for this class */ private static final Logger LOG = LoggerFactory.getLogger( Dsmlv2Engine.class ); /** The body envelope */ private static final String BODY_ENVELOPE = ""; /** * Creates a new instance of Dsmlv2Engine. * * @param host the server host * @param port the server port * @param user the server admin Dn * @param password the server admin's password */ public Dsmlv2Engine( String host, int port, String user, String password ) { this.user = user; this.password = password; connection = new LdapNetworkConnection( host, port ); } /** * Creates a new instance of Dsmlv2Engine. * * @param connection an unbound active connection * @param user the user name to be used to bind this connection to the server * @param password user's credentials */ public Dsmlv2Engine( LdapConnection connection, String user, String password ) { this.user = user; this.password = password; this.connection = connection; } /** * Processes the file given and return the result of the operations * * @param dsmlInput the DSMLv2 formatted request input * @return the XML response in DSMLv2 Format * @throws XmlPullParserException if an error occurs in the parser */ public String processDSML( String dsmlInput ) throws XmlPullParserException { parser = new Dsmlv2Parser( grammar ); parser.setInput( dsmlInput ); return processDSML(); } /** * Processes the file given and return the result of the operations * * @param fileName the path to the file * @return the XML response in DSMLv2 Format * @throws XmlPullParserException if an error occurs in the parser * @throws IOException if the file does not exist */ public String processDSMLFile( String fileName ) throws XmlPullParserException, IOException { parser = new Dsmlv2Parser( grammar ); parser.setInputFile( fileName ); return processDSML(); } /** * Process the given file and optionally writing the output to the * output stream(if not null) * * @param file the DSML file * @param respStream the output stream to which response will be written, skipped if null * @throws Exception If the processing fails */ public void processDSMLFile( File file, OutputStream respStream ) throws Exception { parser = new Dsmlv2Parser( grammar ); parser.setInputFile( file.getAbsolutePath() ); processDSML( respStream ); } /** * Uses the default UTF-8 encoding for processing the DSML * * @see #processDSML(InputStream, String, OutputStream) * @param inputStream The Stream containing the DSML to process * @param out The Stream where to put the result * @throws Exception If we had an error while processing the DSML */ public void processDSML( InputStream inputStream, OutputStream out ) throws Exception { processDSML( inputStream, "UTF-8", out ); } /** * Processes the DSML request(s) from the given input stream with the specified encoding * and writes the response to the output stream * * @param inputStream the input stream for DSML batch request * @param inputEncoding encoding to be used while reading the DSML request data * @param out the output stream to which DSML response will be written * @throws Exception If the processing fails */ public void processDSML( InputStream inputStream, String inputEncoding, OutputStream out ) throws Exception { parser = new Dsmlv2Parser( grammar ); parser.setInput( inputStream, inputEncoding ); processDSML( out ); } /** * Processes the Request document * * @return the XML response in DSMLv2 Format */ private String processDSML() { try { ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); processDSML( byteOut ); return new String( byteOut.toByteArray(), StandardCharsets.UTF_8 ); } catch ( IOException e ) { LOG.error( I18n.err( I18n.ERR_02000_FAILED_PROCESSING_DSML ), e ); } return null; } /** * Processes the DSML batch request and writes the response of each operation will be * written to the given response stream if it is not null * * @param outStream the stream to which the responses will be written, can be null * @throws IOException If we had an issue while reading or writing the data */ protected void processDSML( OutputStream outStream ) throws IOException { BufferedWriter respWriter = null; if ( outStream != null ) { respWriter = new BufferedWriter( new OutputStreamWriter( outStream, StandardCharsets.UTF_8 ) ); if ( generateSoapResp ) { respWriter.write( "" ); } } // Binding to LDAP Server try { bind( 1 ); } catch ( Exception e ) { if ( LOG.isWarnEnabled() ) { LOG.warn( I18n.msg( I18n.MSG_02002_FAILED_TO_BIND ), e ); } // Unable to connect to server // We create a new ErrorResponse and return the XML response. ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.COULD_NOT_CONNECT, e .getLocalizedMessage() ); batchResponse.addResponse( errorResponse ); if ( respWriter != null ) { respWriter.write( batchResponse.toDsml() ); if ( generateSoapResp ) { respWriter.write( BODY_ENVELOPE ); } respWriter.flush(); } return; } // Processing BatchRequest: // - Parsing and Getting BatchRequest // - Getting and registering options from BatchRequest try { processBatchRequest(); } catch ( XmlPullParserException e ) { // We create a new ErrorResponse and return the XML response. ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, I18n.err( I18n.ERR_02003_LINE_COLUMN, e.getLocalizedMessage(), e.getLineNumber(), e.getColumnNumber() ) ); batchResponse.addResponse( errorResponse ); if ( respWriter != null ) { respWriter.write( batchResponse.toDsml() ); if ( generateSoapResp ) { respWriter.write( BODY_ENVELOPE ); } respWriter.flush(); } return; } String batchResponseTag = null; if ( respWriter != null ) { StringBuilder sb = new StringBuilder(); sb.append( "" ); batchResponseTag = sb.toString(); } // Processing each request: // - Getting a new request // - Checking if the request is well formed // - Sending the request to the server // - Getting and converting reponse(s) as XML // - Looping until last request DsmlDecorator request = null; try { request = parser.getNextRequest(); } catch ( XmlPullParserException e ) { if ( LOG.isWarnEnabled() ) { LOG.warn( I18n.msg( I18n.MSG_02000_FAILED_GETTING_NEXT_REQUEST ), e ); } int reqId = 0; // We create a new ErrorResponse and return the XML response. ErrorResponse errorResponse = new ErrorResponse( reqId, ErrorResponseType.MALFORMED_REQUEST, I18n.err( I18n.ERR_02003_LINE_COLUMN, e.getLocalizedMessage(), e.getLineNumber(), e.getColumnNumber() ) ); batchResponse.addResponse( errorResponse ); if ( respWriter != null ) { respWriter.write( batchResponse.toDsml() ); if ( generateSoapResp ) { respWriter.write( BODY_ENVELOPE ); } respWriter.flush(); } return; } // We can now write the tag, as we don't have an error if ( respWriter != null ) { respWriter.write( batchResponseTag ); } // (Request == null when there's no more request to process) while ( request != null ) { // Checking the request has a requestID attribute if Processing = Parallel and ResponseOrder = Unordered if ( ( batchRequest.getProcessing().equals( Processing.PARALLEL ) ) && ( batchRequest.getResponseOrder().equals( ResponseOrder.UNORDERED ) ) && ( request.getDecorated().getMessageId() <= 0 ) ) { // Then we have to send an errorResponse ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, I18n .err( I18n.ERR_02004_MISSING_REQUEST_ID ) ); if ( respWriter != null ) { writeResponse( respWriter, errorResponse ); } else { batchResponse.addResponse( errorResponse ); } break; } try { processRequest( request, respWriter ); } catch ( Exception e ) { if ( LOG.isWarnEnabled() ) { LOG.warn( I18n.msg( I18n.MSG_02001_FAILED_PROCESSING_REQUEST ), e ); } // We create a new ErrorResponse and return the XML response. ErrorResponse errorResponse = new ErrorResponse( request.getDecorated().getMessageId(), ErrorResponseType.GATEWAY_INTERNAL_ERROR, I18n.err( I18n.ERR_02005_INTERNAL_ERROR, e.getMessage() ) ); if ( respWriter != null ) { writeResponse( respWriter, errorResponse ); } else { batchResponse.addResponse( errorResponse ); } break; } // Checking if we need to exit processing (if an error has occurred if onError == Exit) if ( exit ) { break; } // Getting next request try { request = parser.getNextRequest(); } catch ( XmlPullParserException e ) { // We create a new ErrorResponse and return the XML response. ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, I18n.err( I18n.ERR_02003_LINE_COLUMN, e.getLocalizedMessage(), e.getLineNumber(), e.getColumnNumber() ) ); if ( respWriter != null ) { writeResponse( respWriter, errorResponse ); } else { batchResponse.addResponse( errorResponse ); } break; } } if ( respWriter != null ) { respWriter.write( "" ); if ( generateSoapResp ) { respWriter.write( BODY_ENVELOPE ); } respWriter.flush(); } } /** * Writes the response to the writer of the underlying output stream * * @param respWriter The writer used to write the response * @param respDsml The decorator containing the response * @throws IOException If we had an error while writing the DSML response */ protected void writeResponse( BufferedWriter respWriter, DsmlDecorator respDsml ) throws IOException { if ( respWriter != null ) { Element xml = respDsml.toDsml( null ); xml.write( respWriter ); } } /** * Get the generate Soap Response * @return the generateSoapResp */ public boolean isGenerateSoapResp() { return generateSoapResp; } /** * Set the generate Soa pResponse * @param generateSoapResp the generateSoapResp to set */ public void setGenerateSoapResp( boolean generateSoapResp ) { this.generateSoapResp = generateSoapResp; } /** * Get the BatchResponse * * @return the batchResponse */ public BatchResponseDsml getBatchResponse() { return batchResponse; } /** * Get the LdapConnection * * @return the connection */ public LdapConnection getConnection() { return connection; } /** * Processes a single request * * @param request the request to process * @param respWriter The writer used to store the DSML response * @exception Exception If we had an error while processing the request */ protected void processRequest( DsmlDecorator request, BufferedWriter respWriter ) throws Exception { ResultCodeEnum resultCode = null; switch ( request.getDecorated().getType() ) { case ABANDON_REQUEST: connection.abandon( ( AbandonRequest ) request ); return; case ADD_REQUEST: AddResponse response = connection.add( ( AddRequest ) request ); resultCode = response.getLdapResult().getResultCode(); AddResponseDsml addResponseDsml = new AddResponseDsml( connection.getCodecService(), response ); writeResponse( respWriter, addResponseDsml ); break; case BIND_REQUEST: BindResponse bindResponse = connection.bind( ( BindRequest ) request ); resultCode = bindResponse.getLdapResult().getResultCode(); BindResponseDsml authResponseDsml = new BindResponseDsml( connection.getCodecService(), bindResponse ); writeResponse( respWriter, authResponseDsml ); break; case COMPARE_REQUEST: CompareResponse compareResponse = connection.compare( ( CompareRequest ) request ); resultCode = compareResponse.getLdapResult().getResultCode(); CompareResponseDsml compareResponseDsml = new CompareResponseDsml( connection.getCodecService(), compareResponse ); writeResponse( respWriter, compareResponseDsml ); break; case DEL_REQUEST: DeleteResponse delResponse = connection.delete( ( DeleteRequest ) request ); resultCode = delResponse.getLdapResult().getResultCode(); DelResponseDsml delResponseDsml = new DelResponseDsml( connection.getCodecService(), delResponse ); writeResponse( respWriter, delResponseDsml ); break; case EXTENDED_REQUEST: ExtendedResponse extendedResponse = connection.extended( ( ExtendedRequest ) request ); resultCode = extendedResponse.getLdapResult().getResultCode(); ExtendedResponseDsml extendedResponseDsml = new ExtendedResponseDsml( connection.getCodecService(), extendedResponse ); writeResponse( respWriter, extendedResponseDsml ); break; case MODIFY_REQUEST: ModifyResponse modifyResponse = connection.modify( ( ModifyRequest ) request ); resultCode = modifyResponse.getLdapResult().getResultCode(); ModifyResponseDsml modifyResponseDsml = new ModifyResponseDsml( connection.getCodecService(), modifyResponse ); writeResponse( respWriter, modifyResponseDsml ); break; case MODIFYDN_REQUEST: ModifyDnResponse modifyDnResponse = connection.modifyDn( ( ModifyDnRequest ) request ); resultCode = modifyDnResponse.getLdapResult().getResultCode(); ModDNResponseDsml modDNResponseDsml = new ModDNResponseDsml( connection.getCodecService(), modifyDnResponse ); writeResponse( respWriter, modDNResponseDsml ); break; case SEARCH_REQUEST: SearchCursor searchResponses = connection.search( ( SearchRequest ) request ); SearchResponseDsml searchResponseDsml = new SearchResponseDsml( connection.getCodecService() ); if ( respWriter != null ) { StringBuilder sb = new StringBuilder(); sb.append( " 0 ) { sb.append( " requestID=\"" ); sb.append( request.getDecorated().getMessageId() ); sb.append( '"' ); } sb.append( '>' ); respWriter.write( sb.toString() ); } while ( searchResponses.next() ) { Response searchResponse = searchResponses.get(); if ( searchResponse.getType() == MessageTypeEnum.SEARCH_RESULT_ENTRY ) { SearchResultEntry searchResultEntry = ( SearchResultEntry ) searchResponse; SearchResultEntryDsml searchResultEntryDsml = new SearchResultEntryDsml( connection.getCodecService(), searchResultEntry ); searchResponseDsml = new SearchResponseDsml( connection.getCodecService(), searchResultEntryDsml ); if ( respWriter != null ) { writeResponse( respWriter, searchResultEntryDsml ); } else { searchResponseDsml.addResponse( searchResultEntryDsml ); } } else if ( searchResponse.getType() == MessageTypeEnum.SEARCH_RESULT_REFERENCE ) { SearchResultReference searchResultReference = ( SearchResultReference ) searchResponse; SearchResultReferenceDsml searchResultReferenceDsml = new SearchResultReferenceDsml( connection.getCodecService(), searchResultReference ); searchResponseDsml = new SearchResponseDsml( connection.getCodecService(), searchResultReferenceDsml ); if ( respWriter != null ) { writeResponse( respWriter, searchResultReferenceDsml ); } else { searchResponseDsml.addResponse( searchResultReferenceDsml ); } } } SearchResultDone srDone = searchResponses.getSearchResultDone(); if ( srDone != null ) { resultCode = srDone.getLdapResult().getResultCode(); SearchResultDoneDsml srdDsml = new SearchResultDoneDsml( connection.getCodecService(), srDone ); if ( respWriter != null ) { writeResponse( respWriter, srdDsml ); respWriter.write( "" ); } else { searchResponseDsml.addResponse( srdDsml ); batchResponse.addResponse( searchResponseDsml ); } } break; case UNBIND_REQUEST: connection.unBind(); break; default: throw new IllegalStateException( I18n.err( I18n.ERR_02001_UNEXPECTED_REQUEST_TYPE, request.getDecorated().getType() ) ); } if ( ( !continueOnError ) && ( resultCode != null ) && ( resultCode != ResultCodeEnum.SUCCESS ) && ( resultCode != ResultCodeEnum.COMPARE_TRUE ) && ( resultCode != ResultCodeEnum.COMPARE_FALSE ) && ( resultCode != ResultCodeEnum.REFERRAL ) ) { // Turning on Exit flag exit = true; } } /** * Processes the BatchRequest *
    *
  • Parsing and Getting BatchRequest
  • *
  • Getting and registering options from BatchRequest
  • *
* * @throws XmlPullParserException if an error occurs in the parser */ protected void processBatchRequest() throws XmlPullParserException { // Parsing BatchRequest parser.parseBatchRequest(); // Getting BatchRequest batchRequest = parser.getBatchRequest(); if ( OnError.RESUME.equals( batchRequest.getOnError() ) ) { continueOnError = true; } else if ( OnError.EXIT.equals( batchRequest.getOnError() ) ) { continueOnError = false; } if ( ( batchRequest.getRequestID() != 0 ) && ( batchResponse != null ) ) { batchResponse.setRequestID( batchRequest.getRequestID() ); } } /** * Binds to the ldap server * * @param messageId the message Id * @throws LdapException If we had an issue while binding * @throws IOException If we had an issue while transmitting the request or re ceiving the response */ protected void bind( int messageId ) throws LdapException, IOException { if ( ( connection != null ) && connection.isAuthenticated() ) { return; } if ( connection == null ) { throw new IOException( I18n.err( I18n.ERR_02002_MISSING_CONNECTION_TO_BIND ) ); } BindRequest bindRequest = new BindRequestImpl(); bindRequest.setSimple( true ); bindRequest.setCredentials( Strings.getBytesUtf8( password ) ); bindRequest.setName( user ); bindRequest.setVersion3( true ); bindRequest.setMessageId( messageId ); BindResponse bindResponse = connection.bind( bindRequest ); if ( bindResponse.getLdapResult().getResultCode() != ResultCodeEnum.SUCCESS ) { if ( LOG.isWarnEnabled() ) { LOG.warn( I18n.msg( I18n.MSG_02003_ERROR, bindResponse.getLdapResult().getDiagnosticMessage() ) ); } // Fail closed : when the bind failed, none of the batch requests may be // processed, otherwise they would all be executed over what is now an // anonymous connection. The caller (processDSML) turns this exception // into an ErrorResponse and stops, instead of silently continuing // without the configured identity. throw new LdapAuthenticationException( bindResponse.getLdapResult().getDiagnosticMessage() ); } } } apache-directory-ldap-api-cfb3cee/dsml/engine/src/site/000077500000000000000000000000001525525160600232245ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/engine/src/site/site.xml000066400000000000000000000025151525525160600247150ustar00rootroot00000000000000 apache-directory-ldap-api-cfb3cee/dsml/parser/000077500000000000000000000000001525525160600215205ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/.gitignore000066400000000000000000000002501525525160600235050ustar00rootroot00000000000000target maven-eclipse.xml lib .externalToolBuilders felix-cache .project .classpath .settings eclipse-classes *.log *.iml *.ipr bin dependency-reduced-pom.xml META-INF apache-directory-ldap-api-cfb3cee/dsml/parser/pom.xml000066400000000000000000000142131525525160600230360ustar00rootroot00000000000000 4.0.0 org.apache.directory.api api-dsml-parent 2.1.9 api-dsml-parser Apache Directory LDAP API DSML Parser bundle org.junit.jupiter junit-jupiter-engine test ${project.groupId} api-ldap-codec-standalone test ${project.groupId} api-util ${project.groupId} api-ldap-codec-core ${project.groupId} api-ldap-model org.apache.servicemix.bundles org.apache.servicemix.bundles.dom4j org.apache.servicemix.bundles org.apache.servicemix.bundles.xpp3 org.apache.commons commons-text maven-surefire-plugin org.apache.maven.plugins ${basedir}/target ${project.build.directory} false osgi-cache all 10 junit.jupiter.execution.parallel.enabled=true org.apache.maven.plugins maven-jar-plugin META-INF/MANIFEST.MF false org.apache.felix maven-bundle-plugin true true META-INF ${project.groupId}.dsmlv2.parser org.apache.directory.api.dsmlv2;version=${project.version};-noimport:=true, org.apache.directory.api.dsmlv2.response;version=${project.version};-noimport:=true, org.apache.directory.api.dsmlv2.request;version=${project.version};-noimport:=true javax.xml.transform, javax.xml.transform.stream, org.apache.commons.text;version=${commons.text.version}, org.apache.directory.api.asn1;version=${project.version}, org.apache.directory.api.asn1.util;version=${project.version}, org.apache.directory.api.i18n;version=${project.version}, org.apache.directory.api.ldap.codec.api;version=${project.version}, org.apache.directory.api.ldap.model.entry;version=${project.version}, org.apache.directory.api.ldap.model.exception;version=${project.version}, org.apache.directory.api.ldap.model.filter;version=${project.version}, org.apache.directory.api.ldap.model.ldif;version=${project.version}, org.apache.directory.api.ldap.model.message;version=${project.version}, org.apache.directory.api.ldap.model.message.controls;version=${project.version}, org.apache.directory.api.ldap.model.name;version=${project.version}, org.apache.directory.api.ldap.model.url;version=${project.version}, org.apache.directory.api.util;version=${project.version}, org.dom4j;version=${dom4j.version}, org.dom4j.io;version=${dom4j.version}, org.dom4j.tree;version=${dom4j.version}, org.slf4j;version=${slf4j.api.bundleversion}, org.xmlpull.v1;version=${xpp3.version} apache.directory.ldap.api.dsml.parser apache-directory-ldap-api-cfb3cee/dsml/parser/src/000077500000000000000000000000001525525160600223075ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/checkstyle/000077500000000000000000000000001525525160600244455ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/checkstyle/suppressions.xml000066400000000000000000000024271525525160600277510ustar00rootroot00000000000000 apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/000077500000000000000000000000001525525160600232335ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/000077500000000000000000000000001525525160600241545ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/000077500000000000000000000000001525525160600247435ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/000077500000000000000000000000001525525160600261645ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/000077500000000000000000000000001525525160600301705ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/000077500000000000000000000000001525525160600307415ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/000077500000000000000000000000001525525160600321505ustar00rootroot00000000000000AbstractDsmlMessageDecorator.java000066400000000000000000000120731525525160600404720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import java.util.HashMap; import java.util.Map; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.Message; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * An abstract DSML Message decorator base class. * * @param The message to decorate * * @author Apache Directory Project */ public abstract class AbstractDsmlMessageDecorator implements DsmlDecorator, Message { /** The LDAP message codec */ private final LdapApiService codec; /** The LDAP message */ private final M message; /** Map of message controls using OID Strings for keys and Control values */ private final Map controls; /** The current control */ private DsmlControl currentControl; /** A logger for this class */ protected static final Logger LOG_DSML = LoggerFactory.getLogger( "DSML" ); /** * Create a new instance of AbstractDsmlMessageDecorator * * @param codec The codec to use * @param message The message to decorate */ public AbstractDsmlMessageDecorator( LdapApiService codec, M message ) { this.codec = codec; this.message = message; controls = new HashMap<>(); } /** * Get the current Control Object * * @return The current Control Object */ public DsmlControl getCurrentControl() { return currentControl; } /** * Get the codec service * * @return The codec to use to encode or decode this message */ public LdapApiService getCodecService() { return codec; } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return message.getType(); } /** * {@inheritDoc} */ @Override public Map getControls() { return controls; } /** * {@inheritDoc} */ @Override public Control getControl( String oid ) { return controls.get( oid ); } /** * {@inheritDoc} */ @Override public boolean hasControl( String oid ) { return controls.containsKey( oid ); } /** * {@inheritDoc} */ @Override public Message addControl( Control control ) { Control decorated; DsmlControl decorator; if ( control instanceof DsmlControl ) { decorator = ( DsmlControl ) control; decorated = decorator.getDecorated(); } else { decorator = new DsmlControl( codec, control ); decorated = control; } message.addControl( decorated ); controls.put( control.getOid(), decorator ); currentControl = decorator; return this; } /** * {@inheritDoc} */ @Override public Message addAllControls( Control[] controlsToAdd ) { for ( Control control : controlsToAdd ) { addControl( control ); } return this; } /** * {@inheritDoc} */ @Override public Message removeControl( Control control ) { controls.remove( control.getOid() ); message.removeControl( control ); return this; } /** * {@inheritDoc} */ @Override public int getMessageId() { return message.getMessageId(); } /** * {@inheritDoc} */ @Override public Object get( Object key ) { return message.get( key ); } /** * {@inheritDoc} */ @Override public Object put( Object key, Object value ) { return message.put( key, value ); } /** * {@inheritDoc} */ @Override public Message setMessageId( int messageId ) { message.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ @Override public M getDecorated() { return message; } } AbstractGrammar.java000066400000000000000000000113421525525160600360070ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import java.io.IOException; import java.util.HashMap; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.util.Strings; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; /** * The abstract Grammar which is the Mother of all the grammars. It contains * the transitions table. * * @author Apache Directory Project */ public abstract class AbstractGrammar implements Grammar { /** * Table of transitions. It's a two dimension array, the first dimension * indexes the states, the second dimension indexes the Tag value, so it is * 256 wide. */ protected HashMap[] transitions; /** The grammar name */ protected String name; /** * Default constructor */ public AbstractGrammar() { // Nothing to do } /** * Returns the grammar's name * * @return The grammar name */ @Override public String getName() { return name; } /** * Sets the grammar's name * * @param name the name to set */ @Override public void setName( String name ) { this.name = name; } /** * Gets the transition associated with the state and tag * * @param state The current state * @param tag The current tag * @return A valid transition if any, or null. */ public GrammarTransition getTransition( Enum state, Tag tag ) { return transitions[state.ordinal()].get( tag ); } /** * Gets the states of the current grammar * * @return Returns the statesEnum. */ @Override public Enum[] getStatesEnum() { return Dsmlv2StatesEnum.values(); } /** * {@inheritDoc} */ @Override public void executeAction( Dsmlv2Container container ) throws XmlPullParserException, IOException { XmlPullParser xpp = container.getParser(); int eventType = xpp.getEventType(); do { switch ( eventType ) { case XmlPullParser.START_DOCUMENT: container.setState( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE ); break; case XmlPullParser.END_DOCUMENT: container.setState( Dsmlv2StatesEnum.GRAMMAR_END ); break; case XmlPullParser.START_TAG: processTag( container, Tag.START ); break; case XmlPullParser.END_TAG: processTag( container, Tag.END ); break; default: break; } eventType = xpp.next(); } while ( eventType != XmlPullParser.END_DOCUMENT ); } /** * Processes the task required in the grammar to the given tag type * * @param container the DSML container * @param tagType the tag type * @throws XmlPullParserException when an error occurs during the parsing */ private void processTag( Dsmlv2Container container, int tagType ) throws XmlPullParserException { XmlPullParser xpp = container.getParser(); String tagName = Strings.toLowerCaseAscii( xpp.getName() ); GrammarTransition transition = getTransition( container.getState(), new Tag( tagName, tagType ) ); if ( transition != null ) { container.setState( transition.getNextState() ); if ( transition.hasAction() ) { GrammarAction action = transition.getAction(); action.action( container ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03036_MISSING_TAG, new Tag( tagName, tagType ) ), xpp, null ); } } } Action.java000066400000000000000000000026311525525160600341530ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import org.xmlpull.v1.XmlPullParserException; /** * IAction interface just contains the method 'action' which must be implemented * in all the implementation classes. * * @author Apache Directory Project */ public interface Action { /** * The action to be executed. * * @param container the container which stores the current data * @throws XmlPullParserException thrown if something went wrong. */ void action( Dsmlv2Container container ) throws XmlPullParserException; } Container.java000066400000000000000000000035301525525160600346570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; /** * This interface represents a container that can be used by the parser to store parsed information * * @author Apache Directory Project */ public interface Container { /** * Gets the current grammar state * * @return Returns the current grammar state */ Enum getState(); /** * Sets the new current state * * @param state The new state */ void setState( Enum state ); /** * Gets the transition * * @return Returns the transition from the previous state to the new state */ Enum getTransition(); /** * Updates the transition from a state to another * * @param transition The transition to set */ void setTransition( Enum transition ); /** * Get the states * * @return Returns the states. */ Enum[] getStates(); } DsmlControl.java000066400000000000000000000066711525525160600352060ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.Control; import org.dom4j.Element; /** * A DSML decorator for a {@link Control}. * * @param The decorated Control * * @author Apache Directory Project */ public class DsmlControl implements Control, DsmlDecorator { /** The decorated Control */ private C decorated; /** The encoded value of the control. */ protected byte[] value; /** The codec service responsible for encoding decoding this object */ private LdapApiService codec; /** * Creates a new instance of DsmlControl * @param codec The Codec used to encode/decode the Control * @param decorated The decorated control */ public DsmlControl( LdapApiService codec, C decorated ) { this.codec = codec; this.decorated = decorated; } /** * Get the LdapApiService instance * * @return The LDAP codec service. */ public LdapApiService getCodecService() { return codec; } /** * Checks to see if this DSML control decorator has a value. * * @return true if the DSML control has a value, false otherwise. */ public boolean hasValue() { return value != null; } /** * Gets the control value * * @return The control value */ public byte[] getValue() { return value; } /** * Sets the encoded control value * * @param value The encoded control value to store */ public void setValue( byte[] value ) { if ( value != null ) { byte[] copy = new byte[value.length]; System.arraycopy( value, 0, copy, 0, value.length ); this.value = copy; } else { this.value = null; } } /** * {@inheritDoc} */ @Override public String getOid() { return decorated.getOid(); } /** * {@inheritDoc} */ @Override public boolean isCritical() { return decorated.isCritical(); } /** * {@inheritDoc} */ @Override public void setCritical( boolean isCritical ) { decorated.setCritical( isCritical ); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { return null; } /** * {@inheritDoc} */ @Override public C getDecorated() { return decorated; } } DsmlDecorator.java000066400000000000000000000030251525525160600354760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import org.dom4j.Element; /** * This interface defines the methods that must be implemented to define a DSML Decorator * * @param The message to decorate * * @author Apache Directory Project */ public interface DsmlDecorator { /** * Converts the request/reponse to its XML representation in the DSMLv2 format * * @param root the root dom4j Element * @return the dom4j Element corresponding to the entry. */ Element toDsml( Element root ); /** * Gets the Message this DsmlDecorator decorates. * * @return The decorated Message instance */ M getDecorated(); } DsmlLiterals.java000066400000000000000000000225451525525160600353430ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; /** * This Class contains DMSL literals * * @author Apache Directory Project */ public final class DsmlLiterals { // Some literal /** Abandon ID */ public static final String ABANDON_ID = "abandonID"; /** AbandonRequest */ public static final String ABANDON_REQUEST = "abandonRequest"; /** Add */ public static final String ADD = "add"; /** AddRequest */ public static final String ADD_REQUEST = "addRequest"; /** AddResponse */ public static final String ADD_RESPONSE = "addResponse"; /** And */ public static final String AND = "and"; /** Any */ public static final String ANY = "any"; /** ApproxMatch */ public static final String APPROX_MATCH = "approxMatch"; /** Assertion */ public static final String ASSERTION = "assertion"; /** Attr */ public static final String ATTR = "attr"; /** Attribute */ public static final String ATTRIBUTE = "attribute"; /** Attributes */ public static final String ATTRIBUTES = "attributes"; /** AuthRequest */ public static final String AUTH_REQUEST = "authRequest"; /** AuthResponse */ public static final String AUTH_RESPONSE = "authResponse"; /** BaseObject */ public static final String BASE_OBJECT = "baseObject"; /** BatchRequest */ public static final String BATCH_REQUEST = "batchRequest"; /** BatchResponse */ public static final String BATCH_RESPONSE = "batchResponse"; /** Body */ public static final String BODY = "body"; /** code */ public static final String CODE = "code"; /** CompareRequest */ public static final String COMPARE_REQUEST = "compareRequest"; /** CompareResponse */ public static final String COMPARE_RESPONSE = "compareResponse"; /** Control */ public static final String CONTROL = "control"; /** ControlValue */ public static final String CONTROL_VALUE = "controlValue"; /** Citicality */ public static final String CRITICALITY = "criticality"; /** DelRequest */ public static final String DEL_REQUEST = "delRequest"; /** DelResponse */ public static final String DEL_RESPONSE = "delResponse"; /** Delete */ public static final String DELETE = "delete"; /** Deleteoldrdn */ public static final String DELETE_OLD_RDN = "deleteoldrdn"; /** DerefAliases */ public static final String DEREF_ALIASES = "derefAliases"; /** DerefAlways */ public static final String DEREF_ALWAYS = "derefAlways"; /** DerefFindingBaseObj */ public static final String DEREF_FINDING_BASE_OBJ = "derefFindingBaseObj"; /** DerefInSearching */ public static final String DEREF_IN_SEARCHING = "derefInSearching"; /** Descr */ public static final String DESCR = "descr"; /** Detail */ public static final String DETAIL = "detail"; /** Dn */ public static final String DN = "dn"; /** DnAttributes */ public static final String DN_ATTRIBUTES = "dnAttributes"; /** Envelope */ public static final String ENVELOPE = "envelope"; /** EqualityMatch */ public static final String EQUALITY_MATCH = "equalityMatch"; /** Error */ public static final String ERROR = "error"; /** ErrorMessage */ public static final String ERROR_MESSAGE = "errorMessage"; /** ErrorResponse */ public static final String ERROR_RESPONSE = "errorResponse"; /** exit */ public static final String EXIT = "exit"; /** ExtendedRequest */ public static final String EXTENDED_REQUEST = "extendedRequest"; /** ExtendedResponse */ public static final String EXTENDED_RESPONSE = "extendedResponse"; /** ExtensibleMatch */ public static final String EXTENSIBLE_MATCH = "extensibleMatch"; /** False */ public static final String FALSE = "false"; /** Filter */ public static final String FILTER = "filter"; /** Final */ public static final String FINAL = "final"; /** GreaterOrEqual */ public static final String GREATER_OR_EQUAL = "greaterOrEqual"; /** Header */ public static final String HEADER = "header"; /** Increment */ public static final String INCREMENT = "increment"; /** Initial */ public static final String INITIAL = "initial"; /** LessOrEqual */ public static final String LESS_OR_EQUAL = "lessOrEqual"; /** MatchedDN */ public static final String MATCHED_DN = "matchedDN"; /** MatchingRule */ public static final String MATCHING_RULE = "matchingRule"; /** Message */ public static final String MESSAGE = "message"; /** ModDNRequest */ public static final String MOD_DN_REQUEST = "modDNRequest"; /** ModDNResponse */ public static final String MOD_DN_RESPONSE = "modDNResponse"; /** Modification*/ public static final String MODIFICATION = "modification"; /** ModifyRequest */ public static final String MODIFY_REQUEST = "modifyRequest"; /** ModifyResponse */ public static final String MODIFY_RESPONSE = "modifyResponse"; /** Name */ public static final String NAME = "name"; /** NeverDerefAliases */ public static final String NEVER_DEREF_ALIASES = "neverDerefAliases"; /** NewRdn*/ public static final String NEW_RDN = "newrdn"; /** NewSuperior */ public static final String NEW_SUPERIOR = "newSuperior"; /** Not */ public static final String NOT = "not"; /** OnError */ public static final String ON_ERROR = "onError"; /** Operation */ public static final String OPERATION = "operation"; /** Or */ public static final String OR = "or"; /** Parallel */ public static final String PARALLEL = "parallel"; /** Present */ public static final String PRESENT = "present"; /** Principal */ public static final String PRINCIPAL = "principal"; /** Processing*/ public static final String PROCESSING = "processing"; /** Ref */ public static final String REF = "ref"; /** Referral */ public static final String REFERRAL = "referral"; /** Replace */ public static final String REPLACE = "replace"; /** RequestID */ public static final String REQUEST_ID = "requestID"; /** RequestName */ public static final String REQUEST_NAME = "requestName"; /** RequestValue */ public static final String REQUEST_VALUE = "requestValue"; /** Response */ public static final String RESPONSE = "response"; /** ResponseName */ public static final String RESPONSE_NAME = "responseName"; /** ResponseOrder */ public static final String RESPONSE_ORDER = "responseOrder"; /** ResultCode */ public static final String RESULT_CODE = "resultCode"; /** Resume */ public static final String RESUME = "resume"; /** Scope */ public static final String SCOPE = "scope"; /** SearchRequest */ public static final String SEARCH_REQUEST = "searchRequest"; /** SearchResponse */ public static final String SEARCH_RESPONSE = "searchResponse"; /** SearchResultDone */ public static final String SEARCH_RESULT_DONE = "searchResultDone"; /** SearchResultEntry */ public static final String SEARCH_RESULT_ENTRY = "searchResultEntry"; /** SearchResultReference */ public static final String SEARCH_RESULT_REFERENCE = "searchResultReference"; /** Sequential */ public static final String SEQUENTIAL = "sequential"; /** SingleLevel */ public static final String SINGLE_LEVEL = "singleLevel"; /** SizeLimit */ public static final String SIZE_LIMIT = "sizeLimit"; /**Substrings */ public static final String SUBSTRINGS = "substrings"; /** TimeLimit */ public static final String TIME_LIMIT = "timeLimit"; /** True */ public static final String TRUE = "true"; /** Type */ public static final String TYPE = "type"; /** TypesOnly */ public static final String TYPES_ONLY = "typesOnly"; /** Unordered */ public static final String UNORDERED = "unordered"; /**Value */ public static final String VALUE = "value"; /** WholeSubtree */ public static final String WHOLE_SUBTREE = "wholeSubtree"; private DsmlLiterals() { // Nothing to do } } Dsmlv2Container.java000066400000000000000000000125511525525160600357520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml; import org.apache.directory.api.dsmlv2.response.BatchResponseDsml; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.xmlpull.v1.XmlPullParser; /** * This class represents the DSML Container. * It used by the DSML Parser to store information. * * @author Apache Directory Project */ public class Dsmlv2Container implements Container { /** The current state of the decoding */ private Enum state; /** The current transition */ private Enum transition; /** Store the different states for debug purpose */ private Enum[] states; /** The pool parser */ private XmlPullParser parser; /** The BatchRequest of the parsing */ private BatchRequestDsml batchRequest; /** The BatchResponse of the parsing */ private BatchResponseDsml batchResponse; /** The associated grammar */ private AbstractGrammar grammar; /** The codec service */ private final LdapApiService codec; /** * Creates a new LdapMessageContainer object. * * @param codec the Codec used to encode/decode the messages */ public Dsmlv2Container( LdapApiService codec ) { this.codec = codec; } /** * Gets the {@link LdapApiService} associated with this Container. * * @return The codec used to encode/decode the messages */ public LdapApiService getLdapCodecService() { return codec; } /** * Gets the DSML Batch Request * * @return Returns the Batch Request */ public BatchRequestDsml getBatchRequest() { return batchRequest; } /** * Sets the DSML Batch Request * * @param batchRequest the Batch Request to set */ public void setBatchRequest( BatchRequestDsml batchRequest ) { this.batchRequest = batchRequest; } /** * Gets the DSML Batch Response * * @return Returns the Batch Response */ public BatchResponseDsml getBatchResponse() { return batchResponse; } /** * Sets the DSML Batch Request * * @param batchResponse the Batch Response to set */ public void setBatchResponse( BatchResponseDsml batchResponse ) { this.batchResponse = batchResponse; } /** * Gets the parser * * @return the parser */ public XmlPullParser getParser() { return parser; } /** * Sets the parser * * @param parser the parser to set */ public void setParser( XmlPullParser parser ) { this.parser = parser; } /** * Get the current grammar state * * @return the current grammar state */ @Override public Enum getState() { return state; } /** * Set the new current state * * @param state the new state */ @Override public void setState( Enum state ) { this.state = state; } /** * Get the transition * * @return the transition from the previous state to the new state */ @Override public Enum getTransition() { return transition; } /** * Update the transition from a state to another * * @param transition the transition to set */ @Override public void setTransition( Enum transition ) { this.transition = transition; } /** * Get the states for this container's grammars * * @return the states. */ @Override public Enum[] getStates() { return states; } /** * Gets the grammar * * @return the grammar */ public AbstractGrammar getGrammar() { return grammar; } /** * Sets the Grammar * * @param grammar the grammar to set */ public void setGrammar( AbstractGrammar grammar ) { this.grammar = grammar; } /** * Get the transition associated with the state and tag * * @param currentState the current state * @param currentTag the current tag * @return a valid transition if any, or null. */ public GrammarTransition getTransition( Enum currentState, Tag currentTag ) { return grammar.getTransition( currentState, currentTag ); } } Dsmlv2Parser.java000066400000000000000000000254371525525160600352730ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml; import org.apache.directory.api.dsmlv2.request.Dsmlv2Grammar; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.ldap.model.message.Request; import org.apache.directory.api.util.Strings; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; /** * This class represents the DSMLv2 Parser. * It can be used to parse a plain DSMLv2 Request input document or the one inside a SOAP envelop. * * @author Apache Directory Project */ public class Dsmlv2Parser { /** The associated DSMLv2 container */ private Dsmlv2Container container; /** * flag to indicate if the batch request should maintain a list of all the * operation request objects present in the DSML document. Default is true */ private boolean storeMsgInBatchReq = true; /** The thread safe DSMLv2 Grammar */ private Dsmlv2Grammar grammar; /** * Creates a new instance of Dsmlv2Parser. * * @throws XmlPullParserException if an error occurs during the initialization of the parser */ public Dsmlv2Parser() throws XmlPullParserException { this( true ); } /** * Creates a new instance of Dsmlv2Parser. * * @param storeMsgInBatchReq flag to set if the parsed requests should b stored * @throws XmlPullParserException if an error occurs during the initialization of the parser */ public Dsmlv2Parser( boolean storeMsgInBatchReq ) throws XmlPullParserException { this.storeMsgInBatchReq = storeMsgInBatchReq; this.grammar = new Dsmlv2Grammar(); this.container = new Dsmlv2Container( grammar.getLdapCodecService() ); this.container.setGrammar( grammar ); XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware( true ); XmlPullParser xpp = factory.newPullParser(); container.setParser( xpp ); } /** * Creates a new instance of Dsmlv2Parser. * * @param grammar The grammar in use * @throws XmlPullParserException if an error occurs during the initialization of the parser */ public Dsmlv2Parser( Dsmlv2Grammar grammar ) throws XmlPullParserException { this.container = new Dsmlv2Container( grammar.getLdapCodecService() ); this.container.setGrammar( grammar ); this.grammar = grammar; XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware( true ); XmlPullParser xpp = factory.newPullParser(); container.setParser( xpp ); } /** * Sets the input file the parser is going to parse. Default charset is used. * * @param fileName the name of the file * @throws IOException if the file does not exist * @throws XmlPullParserException if an error occurs in the parser */ public void setInputFile( String fileName ) throws IOException, XmlPullParserException { try ( Reader reader = new InputStreamReader( Files.newInputStream( Paths.get( ( fileName ) ) ), Charset.defaultCharset() ) ) { container.getParser().setInput( reader ); } } /** * Sets the input stream the parser is going to process * * @param inputStream contains a raw byte input stream of possibly unknown encoding (when inputEncoding is null) * @param inputEncoding if not null it MUST be used as encoding for inputStream * @throws XmlPullParserException if an error occurs in the parser */ public void setInput( InputStream inputStream, String inputEncoding ) throws XmlPullParserException { container.getParser().setInput( inputStream, inputEncoding ); } /** * Sets the input string the parser is going to parse * * @param str the string the parser is going to parse * @throws XmlPullParserException if an error occurs in the parser */ public void setInput( String str ) throws XmlPullParserException { container.getParser().setInput( new StringReader( str ) ); } /** * Launches the parsing on the input * This method will parse the whole DSML document, without considering the flag storeMsgInBatchReq * @throws XmlPullParserException when an unrecoverable error occurs * @throws IOException when an IO execption occurs */ public void parse() throws XmlPullParserException, IOException { grammar.executeAction( container ); } /** * Launches the parsing of the Batch Request only * * @throws XmlPullParserException if an error occurs in the parser */ public void parseBatchRequest() throws XmlPullParserException { XmlPullParser xpp = container.getParser(); int eventType = xpp.getEventType(); do { switch ( eventType ) { case XmlPullParser.START_DOCUMENT: container.setState( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE ); break; case XmlPullParser.END_DOCUMENT: container.setState( Dsmlv2StatesEnum.GRAMMAR_END ); break; case XmlPullParser.START_TAG: processTag( container, Tag.START ); break; case XmlPullParser.END_TAG: processTag( container, Tag.END ); break; default: break; } try { eventType = xpp.next(); } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03019_IO_EXCEPTION_OCCURED, ioe.getLocalizedMessage() ), xpp, ioe ); } } while ( container.getState() != Dsmlv2StatesEnum.BATCHREQUEST_START_TAG ); BatchRequestDsml br = container.getBatchRequest(); if ( br != null ) { br.setStoreReq( storeMsgInBatchReq ); } } /** * Processes the task required in the grammar to the given tag type * * @param container the DSML container * @param tagType the tag type * @throws XmlPullParserException when an error occurs during the parsing */ private static void processTag( Dsmlv2Container container, int tagType ) throws XmlPullParserException { XmlPullParser xpp = container.getParser(); String tagName = Strings.lowerCase( xpp.getName() ); GrammarTransition transition = container.getTransition( container.getState(), new Tag( tagName, tagType ) ); if ( transition != null ) { container.setState( transition.getNextState() ); if ( transition.hasAction() ) { transition.getAction().action( container ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03036_MISSING_TAG, new Tag( tagName, tagType ) ), xpp, null ); } } /** * Gets the Batch Request or null if the it has not been parsed yet * * @return the Batch Request or null if the it has not been parsed yet */ public BatchRequestDsml getBatchRequest() { return container.getBatchRequest(); } /** * Gets the next Request or null if there's no more request * @return the next Request or null if there's no more request * @throws XmlPullParserException when an error occurs during the parsing */ public DsmlDecorator getNextRequest() throws XmlPullParserException { if ( container.getBatchRequest() == null ) { parseBatchRequest(); } XmlPullParser xpp = container.getParser(); int eventType = xpp.getEventType(); do { while ( eventType == XmlPullParser.TEXT ) { try { xpp.next(); } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03019_IO_EXCEPTION_OCCURED, ioe.getLocalizedMessage() ), xpp, ioe ); } eventType = xpp.getEventType(); } switch ( eventType ) { case XmlPullParser.START_DOCUMENT: container.setState( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE ); break; case XmlPullParser.END_DOCUMENT: container.setState( Dsmlv2StatesEnum.GRAMMAR_END ); return null; case XmlPullParser.START_TAG: processTag( container, Tag.START ); break; case XmlPullParser.END_TAG: processTag( container, Tag.END ); break; default: break; } try { eventType = xpp.next(); } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03019_IO_EXCEPTION_OCCURED, ioe.getLocalizedMessage() ), xpp, ioe ); } } while ( container.getState() != Dsmlv2StatesEnum.BATCHREQUEST_LOOP ); return container.getBatchRequest().getCurrentRequest(); } /** * Parses all the requests * * @throws XmlPullParserException when an error occurs during the parsing */ public void parseAllRequests() throws XmlPullParserException { while ( getNextRequest() != null ) { continue; } } } Dsmlv2ResponseParser.java000066400000000000000000000226021525525160600370010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; import org.apache.directory.api.dsmlv2.response.BatchResponseDsml; import org.apache.directory.api.dsmlv2.response.Dsmlv2ResponseGrammar; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.Response; import org.apache.directory.api.util.Strings; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; /** * This class represents the DSMLv2 Parser. * It can be used to parse a DSMLv2 Response input. * * @author Apache Directory Project */ public class Dsmlv2ResponseParser { /** The associated DSMLv2 container */ private Dsmlv2Container container; /** * Creates a new instance of Dsmlv2ResponseParser. * * @param codec The Ldap Service to use * @throws XmlPullParserException if an error occurs while the initialization of the parser */ public Dsmlv2ResponseParser( LdapApiService codec ) throws XmlPullParserException { this.container = new Dsmlv2Container( codec ); this.container.setGrammar( Dsmlv2ResponseGrammar.getInstance() ); XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware( true ); XmlPullParser xpp = factory.newPullParser(); container.setParser( xpp ); } /** * Sets the input string the parser is going to parse * * @param str the string the parser is going to parse * @throws XmlPullParserException if an error occurs in the parser */ public void setInput( String str ) throws XmlPullParserException { container.getParser().setInput( new StringReader( str ) ); } /** * Sets the input file the parser is going to parse. Default charset is used. * * @param fileName the name of the file * @throws IOException if the file does not exist * @throws XmlPullParserException if an error occurs in the parser */ public void setInputFile( String fileName ) throws IOException, XmlPullParserException { try ( Reader reader = new InputStreamReader( Files.newInputStream( Paths.get( fileName ) ), Charset.defaultCharset() ) ) { container.getParser().setInput( reader ); } } /** * Sets the input stream the parser is going to process * * @param inputStream contains a raw byte input stream of possibly unknown encoding (when inputEncoding is null) * @param inputEncoding if not null it MUST be used as encoding for inputStream * @throws XmlPullParserException if an error occurs in the parser */ public void setInput( InputStream inputStream, String inputEncoding ) throws XmlPullParserException { container.getParser().setInput( inputStream, inputEncoding ); } /** * Launches the parsing on the input * * @throws XmlPullParserException when an unrecoverable error occurs * @throws IOException when an IO exception occurs */ public void parse() throws XmlPullParserException, IOException { Dsmlv2ResponseGrammar grammar = Dsmlv2ResponseGrammar.getInstance(); grammar.executeAction( container ); } /** * Launches the parsing of the Batch Response only * * @throws XmlPullParserException if an error occurs in the parser */ public void parseBatchResponse() throws XmlPullParserException { XmlPullParser xpp = container.getParser(); int eventType = xpp.getEventType(); do { switch ( eventType ) { case XmlPullParser.START_DOCUMENT : container.setState( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE ); break; case XmlPullParser.END_DOCUMENT : container.setState( Dsmlv2StatesEnum.GRAMMAR_END ); break; case XmlPullParser.START_TAG : processTag( container, Tag.START ); break; case XmlPullParser.END_TAG : processTag( container, Tag.END ); break; default: break; } try { eventType = xpp.next(); } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03019_IO_EXCEPTION_OCCURED, ioe.getLocalizedMessage() ), xpp, ioe ); } } while ( container.getState() != Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP ); } /** * Processes the task required in the grammar to the given tag type * * @param container the DSML container * @param tagType the tag type * @throws XmlPullParserException when an error occurs during the parsing */ private static void processTag( Dsmlv2Container container, int tagType ) throws XmlPullParserException { XmlPullParser xpp = container.getParser(); String tagName = Strings.lowerCase( xpp.getName() ); GrammarTransition transition = container.getTransition( container.getState(), new Tag( tagName, tagType ) ); if ( transition != null ) { container.setState( transition.getNextState() ); if ( transition.hasAction() ) { transition.getAction().action( container ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03036_MISSING_TAG, new Tag( tagName, tagType ) ), xpp, null ); } } /** * Gets the Batch Response or null if the it has not been parsed yet * * @return the Batch Response or null if the it has not been parsed yet */ public BatchResponseDsml getBatchResponse() { return container.getBatchResponse(); } /** * Returns the next Request or null if there's no more request * @return the next Request or null if there's no more request * @throws XmlPullParserException when an error occurs during the parsing */ public DsmlDecorator getNextResponse() throws XmlPullParserException { if ( container.getBatchResponse() == null ) { parseBatchResponse(); } XmlPullParser xpp = container.getParser(); int eventType = xpp.getEventType(); do { while ( eventType == XmlPullParser.TEXT ) { try { xpp.next(); } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03019_IO_EXCEPTION_OCCURED, ioe.getLocalizedMessage() ), xpp, ioe ); } eventType = xpp.getEventType(); } switch ( eventType ) { case XmlPullParser.START_DOCUMENT : container.setState( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE ); break; case XmlPullParser.END_DOCUMENT : container.setState( Dsmlv2StatesEnum.GRAMMAR_END ); return null; case XmlPullParser.START_TAG : processTag( container, Tag.START ); break; case XmlPullParser.END_TAG : processTag( container, Tag.END ); break; default: break; } try { eventType = xpp.next(); } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03019_IO_EXCEPTION_OCCURED, ioe.getLocalizedMessage() ), xpp, ioe ); } } while ( container.getState() != Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP ); return container.getBatchResponse().getCurrentResponse(); } /** * Parses all the responses * * @throws XmlPullParserException when an error occurs during the parsing */ public void parseAllResponses() throws XmlPullParserException { while ( getNextResponse() != null ) { continue; } } } Dsmlv2StatesEnum.java000066400000000000000000000341241525525160600361200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; /** * This class store the Dsml grammar's constants. It is also used for debugging * purpose. * * @author Apache Directory Project */ public enum Dsmlv2StatesEnum { /** The initial state of every grammar */ INIT_GRAMMAR_STATE, /** The ending state for every grammars */ GRAMMAR_END, //==================================================== // ... //==================================================== /** The <batchRequest> tag */ BATCHREQUEST_START_TAG, /** The BatchRequest loop */ BATCHREQUEST_LOOP, /** The </batchRequest> tag */ BATCHREQUEST_END_TAG, //==================================================== // ... //==================================================== /** The <abandonRequest> tag */ ABANDON_REQUEST_START_TAG, /** The <control> tag */ ABANDON_REQUEST_CONTROL_START_TAG, /** The </control> tag */ ABANDON_REQUEST_CONTROL_END_TAG, /** The <controlValue> tag */ ABANDON_REQUEST_CONTROLVALUE_START_TAG, /** The </controlValue> tag */ ABANDON_REQUEST_CONTROLVALUE_END_TAG, //==================================================== // ... //==================================================== /** The <addRequest> tag */ ADD_REQUEST_START_TAG, /** The <control> tag */ ADD_REQUEST_CONTROL_START_TAG, /** The </control> tag */ ADD_REQUEST_CONTROL_END_TAG, /** The <controlValue> tag */ ADD_REQUEST_CONTROLVALUE_START_TAG, /** The </controlValue> tag */ ADD_REQUEST_CONTROLVALUE_END_TAG, /** The <attr> tag */ ADD_REQUEST_ATTR_START_TAG, /** The </attr> tag */ ADD_REQUEST_ATTR_END_TAG, /** The <value> tag */ ADD_REQUEST_VALUE_START_TAG, /** The </value> tag */ ADD_REQUEST_VALUE_END_TAG, //==================================================== // ... //==================================================== /** The <authRequest> tag */ AUTH_REQUEST_START_TAG, /** The <control> tag */ AUTH_REQUEST_CONTROL_START_TAG, /** The </control> tag */ AUTH_REQUEST_CONTROL_END_TAG, /** The <controlValue> tag */ AUTH_REQUEST_CONTROLVALUE_START_TAG, /** The </controlValue> tag */ AUTH_REQUEST_CONTROLVALUE_END_TAG, //==================================================== // ... //==================================================== /** The <compareRequest> tag */ COMPARE_REQUEST_START_TAG, /** The <control> tag */ COMPARE_REQUEST_CONTROL_START_TAG, /** The </control> tag */ COMPARE_REQUEST_CONTROL_END_TAG, /** The <controlValue> tag */ COMPARE_REQUEST_CONTROLVALUE_START_TAG, /** The </controlValue> tag */ COMPARE_REQUEST_CONTROLVALUE_END_TAG, /** The <assertion> tag */ COMPARE_REQUEST_ASSERTION_START_TAG, /** The </assertion> tag */ COMPARE_REQUEST_ASSERTION_END_TAG, /** The <value> tag */ COMPARE_REQUEST_VALUE_START_TAG, /** The </value> tag */ COMPARE_REQUEST_VALUE_END_TAG, //==================================================== // ... //==================================================== /** The <delRequest> tag */ DEL_REQUEST_START_TAG, /** The <control> tag */ DEL_REQUEST_CONTROL_START_TAG, /** The </control> tag */ DEL_REQUEST_CONTROL_END_TAG, /** The <controlValue> tag */ DEL_REQUEST_CONTROLVALUE_START_TAG, /** The </controlValue> tag */ DEL_REQUEST_CONTROLVALUE_END_TAG, //==================================================== // ... //==================================================== /** The <extendedRequest> tag */ EXTENDED_REQUEST_START_TAG, /** The <control> tag */ EXTENDED_REQUEST_CONTROL_START_TAG, /** The </control> tag */ EXTENDED_REQUEST_CONTROL_END_TAG, /** The <controlValue> tag */ EXTENDED_REQUEST_CONTROLVALUE_START_TAG, /** The </controlValue> tag */ EXTENDED_REQUEST_CONTROLVALUE_END_TAG, /** The <requestName> tag */ EXTENDED_REQUEST_REQUESTNAME_START_TAG, /** The </requestName> tag */ EXTENDED_REQUEST_REQUESTNAME_END_TAG, /** The <requestValue> tag */ EXTENDED_REQUEST_REQUESTVALUE_START_TAG, /** The </requestValue> tag */ EXTENDED_REQUEST_REQUESTVALUE_END_TAG, //==================================================== // ... //==================================================== /** The <modDNRequest> tag */ MODIFY_DN_REQUEST_START_TAG, /** The <control> tag */ MODIFY_DN_REQUEST_CONTROL_START_TAG, /** The </control> tag */ MODIFY_DN_REQUEST_CONTROL_END_TAG, /** The <controlValue> tag */ MODIFY_DN_REQUEST_CONTROLVALUE_START_TAG, /** The </controlValue> tag */ MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG, //==================================================== // ... //==================================================== /** The <modifyRequest> tag */ MODIFY_REQUEST_START_TAG, /** The <control> tag */ MODIFY_REQUEST_CONTROL_START_TAG, /** The </control> tag */ MODIFY_REQUEST_CONTROL_END_TAG, /** The <controlValue> tag */ MODIFY_REQUEST_CONTROLVALUE_START_TAG, /** The </controlValue> tag */ MODIFY_REQUEST_CONTROLVALUE_END_TAG, /** The <modification> tag */ MODIFY_REQUEST_MODIFICATION_START_TAG, /** The </modification> tag */ MODIFY_REQUEST_MODIFICATION_END_TAG, /** The <value> tag */ MODIFY_REQUEST_VALUE_START_TAG, /** The </value> tag */ MODIFY_REQUEST_VALUE_END_TAG, //==================================================== // ... //==================================================== /** The <searchRequest> tag */ SEARCH_REQUEST_START_TAG, /** The <control> tag */ SEARCH_REQUEST_CONTROL_START_TAG, /** The </control> tag */ SEARCH_REQUEST_CONTROL_END_TAG, /** The <controlValue> tag */ SEARCH_REQUEST_CONTROLVALUE_START_TAG, /** The </controlValue> tag */ SEARCH_REQUEST_CONTROLVALUE_END_TAG, /** The <filter> tag */ SEARCH_REQUEST_FILTER_START_TAG, /** The </filter> tag */ SEARCH_REQUEST_FILTER_END_TAG, /** The <attributes> tag */ SEARCH_REQUEST_ATTRIBUTES_START_TAG, /** The </attributes> tag */ SEARCH_REQUEST_ATTRIBUTES_END_TAG, /** The <attribute> tag */ SEARCH_REQUEST_ATTRIBUTE_START_TAG, /** The </attribute> tag */ SEARCH_REQUEST_ATTRIBUTE_END_TAG, /** The <equalityMatch> tag */ SEARCH_REQUEST_EQUALITYMATCH_START_TAG, /** The <subStrings> tag */ SEARCH_REQUEST_SUBSTRINGS_START_TAG, /** The </subStrings> tag */ SEARCH_REQUEST_SUBSTRINGS_END_TAG, /** The <greaterOrEqual> tag */ SEARCH_REQUEST_GREATEROREQUAL_START_TAG, /** The <lessOrEqual> tag */ SEARCH_REQUEST_LESSOREQUAL_START_TAG, /** The <present> tag */ SEARCH_REQUEST_PRESENT_START_TAG, /** The <approxMatch> tag */ SEARCH_REQUEST_APPROXMATCH_START_TAG, /** The <extensibleMatch> tag */ SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, /** The <value> tag */ SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_START_TAG, /** The </value> tag */ SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG, /** The <initial> tag */ SEARCH_REQUEST_INITIAL_START_TAG, /** The </initial> tag */ SEARCH_REQUEST_INITIAL_END_TAG, /** The <any> tag */ SEARCH_REQUEST_ANY_START_TAG, /** The </any> tag */ SEARCH_REQUEST_ANY_END_TAG, /** The <final> tag */ SEARCH_REQUEST_FINAL_START_TAG, /** The </final> tag */ SEARCH_REQUEST_FINAL_END_TAG, /** The <value> tag */ SEARCH_REQUEST_VALUE_START_TAG, /** The </value> tag */ SEARCH_REQUEST_VALUE_END_TAG, /** The Filter Loop state */ SEARCH_REQUEST_FILTER_LOOP, //**************** // DSML Response //**************** /** The Batch Response Loop state */ BATCH_RESPONSE_LOOP, /** The Error Response Loop state */ ERROR_RESPONSE, /** The Message Start state */ MESSAGE_START, /** The Message End state */ MESSAGE_END, /** The Detail Start state */ DETAIL_START, /** The Detail End state */ DETAIL_END, /** The Extended Response state */ EXTENDED_RESPONSE, /** The Extended Response Control Start state */ EXTENDED_RESPONSE_CONTROL_START, /** The Extended Response Control End state */ EXTENDED_RESPONSE_CONTROL_END, /** The Extended Response Control Value Start state */ EXTENDED_RESPONSE_CONTROL_VALUE_START, /** The Extended Response Control Value End state */ EXTENDED_RESPONSE_CONTROL_VALUE_END, /** The Extended Response Result Code Start state */ EXTENDED_RESPONSE_RESULT_CODE_START, /** The Extended Response Result Code End state */ EXTENDED_RESPONSE_RESULT_CODE_END, /** The Extended Response Error Message Start state */ EXTENDED_RESPONSE_ERROR_MESSAGE_START, /** The Extended Response Error Message End state */ EXTENDED_RESPONSE_ERROR_MESSAGE_END, /** The Extended Response Referral Start state */ EXTENDED_RESPONSE_REFERRAL_START, /** The Extended Response Referral End state */ EXTENDED_RESPONSE_REFERRAL_END, /** The Response Name Start state */ RESPONSE_NAME_START, /** The Response Name End state */ RESPONSE_NAME_END, /** The Response Start state */ RESPONSE_START, /** The Response End state */ RESPONSE_END, /** The LDAP Result state */ LDAP_RESULT, /** The LDAP Result Control Start state */ LDAP_RESULT_CONTROL_START, /** The LDAP Result Control End state */ LDAP_RESULT_CONTROL_END, /** The LDAP Result Control Value Start state */ LDAP_RESULT_CONTROL_VALUE_START, /** The LDAP Result Control Value End state */ LDAP_RESULT_CONTROL_VALUE_END, /** The LDAP Result Result Code Start state */ LDAP_RESULT_RESULT_CODE_START, /** The LDAP Result Result Code End state */ LDAP_RESULT_RESULT_CODE_END, /** The LDAP Result Error Message Start state */ LDAP_RESULT_ERROR_MESSAGE_START, /** The LDAP Result Error Message End state */ LDAP_RESULT_ERROR_MESSAGE_END, /** The LDAP Result Referral Start state */ LDAP_RESULT_REFERRAL_START, /** The LDAP Result Referral End state */ LDAP_RESULT_REFERRAL_END, /** The LDAP Result End state */ LDAP_RESULT_END, /** The Search Response state */ SEARCH_RESPONSE, /** The Search Result Entry state */ SEARCH_RESULT_ENTRY, /** The Search Result Entry Control Start state */ SEARCH_RESULT_ENTRY_CONTROL_START, /** The Search Result Entry Control End state */ SEARCH_RESULT_ENTRY_CONTROL_END, /** The Search Result Entry Control Value Start state */ SEARCH_RESULT_ENTRY_CONTROL_VALUE_START, /** The Search Result Entry Control Value End state */ SEARCH_RESULT_ENTRY_CONTROL_VALUE_END, /** The Search Result Entry Attr Start state */ SEARCH_RESULT_ENTRY_ATTR_START, /** The Search Result Entry Attr End state */ SEARCH_RESULT_ENTRY_ATTR_END, /** The Search Result Entry Value Start state */ SEARCH_RESULT_ENTRY_VALUE_START, /** The Search Result Entry Value End state */ SEARCH_RESULT_ENTRY_VALUE_END, /** The Search Result Entry Loop state */ SEARCH_RESULT_ENTRY_LOOP, /** The Search Result Reference state */ SEARCH_RESULT_REFERENCE, /** The Search Result Reference Control Start state */ SEARCH_RESULT_REFERENCE_CONTROL_START, /** The Search Result Reference Control End state */ SEARCH_RESULT_REFERENCE_CONTROL_END, /** The Search Result Reference Control Value Start state */ SEARCH_RESULT_REFERENCE_CONTROL_VALUE_START, /** The Search Result Reference Control Value End state */ SEARCH_RESULT_REFERENCE_CONTROL_VALUE_END, /** The Search Result Reference Ref Start state */ SEARCH_RESULT_REFERENCE_REF_START, /** The Search Result Reference Ref End state */ SEARCH_RESULT_REFERENCE_REF_END, /** The Search Result Reference Loop state */ SEARCH_RESULT_REFERENCE_LOOP, /** The soap envelop start state */ SOAP_ENVELOPE_START_TAG, /** The soap envelop end state */ SOAP_ENVELOPE_END_TAG, /** The soap header start state */ SOAP_HEADER_START_TAG, /** The soap header end state */ SOAP_HEADER_END_TAG, /** The soap body start state */ SOAP_BODY_START_TAG, /** The soap body end state */ SOAP_BODY_END_TAG, /** The Search Result Done End state */ SEARCH_RESULT_DONE_END } Grammar.java000066400000000000000000000036531525525160600343310ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import java.io.IOException; import org.xmlpull.v1.XmlPullParserException; /** * The interface which expose common behavior of a Grammar implementer. * * @author Apache Directory Project */ public interface Grammar { /** * This method, when called, executes an action on the current data stored in * the container. * * @param container the DSML container * @throws XmlPullParserException when an unrecoverable error occurs * @throws IOException when an IO error occurs */ void executeAction( Dsmlv2Container container ) throws XmlPullParserException, IOException; /** * Get the grammar name * * @return Return the grammar's name */ String getName(); /** * Get the statesEnum for the current grammar * * @return The specific States Enum for the current grammar */ Enum[] getStatesEnum(); /** * Set the grammar's name * * @param name The grammar name */ void setName( String name ); } GrammarAction.java000066400000000000000000000030761525525160600354660ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; /** * A top level grammar class that store meta informations about the actions. * Those informations are not mandatory, but they can be usefull for debugging. * * @author Apache Directory Project */ public abstract class GrammarAction implements Action { /** The action's name */ private String name; /** * Creates a new GrammarAction object. * * @param name the name of the create daction */ public GrammarAction( String name ) { this.name = name; } /** * Print the action's name * * @return the action's name */ @Override public String toString() { return name; } } GrammarTransition.java000066400000000000000000000061531525525160600364020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; /** * Define a transition between two states of a grammar. It stores the next * state, and the action to execute while transiting. * * @author Apache Directory Project */ public class GrammarTransition { /** The next state in the grammar */ private Enum nextState; /** The action associated to the transition */ private GrammarAction action; /** The current state */ private Enum currentState; /** * Creates a new GrammarTransition object. * * @param currentState The current transition * @param nextState The target state * @param action The action to execute. It could be null. */ public GrammarTransition( Enum currentState, Enum nextState, GrammarAction action ) { this.currentState = currentState; this.nextState = nextState; this.action = action; } /** * Gets the target state * * @return the target state. */ public Enum getNextState() { return nextState; } /** * Tells if the transition has an associated action. * * @return true if an action has been associated to the transition */ public boolean hasAction() { return action != null; } /** * Gets the action associated with the transition * * @return the action associated with the transition */ public GrammarAction getAction() { return action; } /** * Returns a representation of the transition as a string * * @param grammar the grammar which state we want a String from * @param statesEnum the states enum that contains the states' names * @return a representation of the transition as a string. */ public String toString( int grammar, Enum statesEnum ) { StringBuilder sb = new StringBuilder(); sb.append( "Transition from <" ).append( currentState ).append( "> to <" ).append( nextState ).append( ">, action : " ).append( ( action == null ) ? "no action" : action.toString() ).append( ">" ); return sb.toString(); } } ParserUtils.java000066400000000000000000000323201525525160600352110ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Base64; import java.util.Collection; import javax.xml.XMLConstants; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamSource; import org.apache.directory.api.asn1.util.Asn1Buffer; import org.apache.directory.api.dsmlv2.actions.ReadSoapHeader; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.Processing; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.ResponseOrder; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.util.Strings; import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.Namespace; import org.dom4j.QName; import org.dom4j.io.DocumentResult; import org.dom4j.io.DocumentSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; /** * This class is a Helper class for the DSML Parser * * @author Apache Directory Project */ public final class ParserUtils { /** W3C XML Schema URI. */ public static final String XML_SCHEMA_URI = "http://www.w3.org/2001/XMLSchema"; /** W3C XML Schema Instance URI. */ public static final String XML_SCHEMA_INSTANCE_URI = "http://www.w3.org/2001/XMLSchema-instance"; /** Base-64 identifier. */ public static final String BASE64BINARY = "base64Binary"; /** XSI namespace prefix. */ public static final String XSI = "xsi"; /** XSD namespace prefix. */ public static final String XSD = "xsd"; /** XSD namespace prefix with ':'. */ public static final String XSD_COLON = "xsd:"; /** The DSML namespace */ public static final Namespace DSML_NAMESPACE = new Namespace( null, "urn:oasis:names:tc:DSML:2:0:core" ); /** The XSD namespace */ public static final Namespace XSD_NAMESPACE = new Namespace( XSD, XML_SCHEMA_URI ); /** The XSI namespace */ public static final Namespace XSI_NAMESPACE = new Namespace( XSI, XML_SCHEMA_INSTANCE_URI ); /** A logger for this class */ private static final Logger LOG = LoggerFactory.getLogger( ParserUtils.class ); /** * GrammarAction that reads the SOAP header data */ public static final GrammarAction READ_SOAP_HEADER = new ReadSoapHeader(); private ParserUtils() { } /** * Returns the value of the attribute 'type' of the "XMLSchema-instance' namespace if it exists * * @param xpp the XPP parser to use * @return the value of the attribute 'type' of the "XMLSchema-instance' namespace if it exists */ public static String getXsiTypeAttributeValue( XmlPullParser xpp ) { String type = null; int nbAttributes = xpp.getAttributeCount(); for ( int i = 0; i < nbAttributes; i++ ) { // Checking if the attribute 'type' from XML Schema Instance namespace is used. if ( DsmlLiterals.TYPE.equals( xpp.getAttributeName( i ) ) && xpp.getNamespace( xpp.getAttributePrefix( i ) ).equals( XML_SCHEMA_INSTANCE_URI ) ) { type = xpp.getAttributeValue( i ); break; } } return type; } /** * Tells is the given value is a Base64 binary value * * @param parser the XPP parser to use * @param attrValue the attribute value * @return true if the value of the current tag is Base64BinaryEncoded, false if not */ public static boolean isBase64BinaryValue( XmlPullParser parser, String attrValue ) { if ( attrValue == null ) { return false; } // We are looking for something that should look like that: "aNameSpace:base64Binary" // We split the String. The first element should be the namespace prefix and the second "base64Binary" String[] splitedString = attrValue.split( ":" ); return ( splitedString.length == 2 ) && ( XML_SCHEMA_URI.equals( parser.getNamespace( splitedString[0] ) ) ) && ( BASE64BINARY.equals( splitedString[1] ) ); } /** * Decodes a Base64 encoded value coming from a DSML document. Malformed * Base64 makes java.util.Base64's strict decoder throw an unchecked * IllegalArgumentException, which would escape the grammars and the * Dsmlv2Engine (they only handle XmlPullParserException) : convert it to * the declared error channel so a MALFORMED_REQUEST error response is * produced instead of an uncaught runtime exception. * * @param xpp the XPP parser (used to locate the error) * @param base64Value the Base64 encoded text to decode * @return the decoded bytes * @throws XmlPullParserException when the value is not valid Base64 */ public static byte[] base64Decode( XmlPullParser xpp, String base64Value ) throws XmlPullParserException { try { return Base64.getDecoder().decode( base64Value ); } catch ( IllegalArgumentException iae ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03047_INVALID_BASE64_VALUE, base64Value ), xpp, iae ); } } /** * Indicates if the value needs to be encoded as Base64 * * @param value the value to check * @return true if the value needs to be encoded as Base64 */ public static boolean needsBase64Encoding( Object value ) { return ( value instanceof byte[] ); } /** * Encodes the value as a Base64 String * * @param value the value to encode * @return the value encoded as a Base64 String */ public static String base64Encode( Object value ) { if ( value instanceof byte[] ) { return new String( Base64.getEncoder().encode( ( byte[] ) value ), StandardCharsets.UTF_8 ); } else if ( value instanceof String ) { return new String( Base64.getEncoder().encode( Strings.getBytesUtf8( ( String ) value ) ), StandardCharsets.UTF_8 ); } return Strings.EMPTY_STRING; } /** * Parses and verify the parsed value of the requestID * * @param attributeValue the value of the attribute * @param xpp the XmlPullParser * @return the int value of the resquestID * @throws XmlPullParserException if RequestID isn't an Integer and if requestID is below 0 */ public static int parseAndVerifyRequestID( String attributeValue, XmlPullParser xpp ) throws XmlPullParserException { try { int requestID = Integer.parseInt( attributeValue ); if ( requestID < 0 ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03016_BELOW_0_REQUEST_ID, requestID ), xpp, null ); } return requestID; } catch ( NumberFormatException nfe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03012_REQUEST_ID_NOT_INTEGER ), xpp, nfe ); } } /** * Adds Controls to the given Element. * * @param codec The LDAP Service to use * @param element the element to add the Controls to * @param controls a List of Controls * @param isRequest A flag set to true if the LDapMessage is a request */ public static void addControls( LdapApiService codec, Element element, Collection controls, boolean isRequest ) { if ( controls != null ) { for ( Control control : controls ) { Element controlElement = element.addElement( DsmlLiterals.CONTROL ); if ( control.getOid() != null ) { controlElement.addAttribute( DsmlLiterals.TYPE, control.getOid() ); } if ( control.isCritical() ) { controlElement.addAttribute( DsmlLiterals.CRITICALITY, DsmlLiterals.TRUE ); } Asn1Buffer asn1Buffer = new Asn1Buffer(); if ( isRequest ) { codec.getRequestControlFactories().get( control.getOid() ).encodeValue( asn1Buffer, control ); } else { codec.getResponseControlFactories().get( control.getOid() ).encodeValue( asn1Buffer, control ); } byte[] value = asn1Buffer.getBytes().array(); if ( value != null ) { if ( ParserUtils.needsBase64Encoding( value ) ) { element.getDocument().getRootElement().add( XSD_NAMESPACE ); element.getDocument().getRootElement().add( XSI_NAMESPACE ); Element valueElement = controlElement.addElement( DsmlLiterals.CONTROL_VALUE ).addText( ParserUtils.base64Encode( value ) ); valueElement.addAttribute( new QName( DsmlLiterals.TYPE, XSI_NAMESPACE ), ParserUtils.XSD_COLON + ParserUtils.BASE64BINARY ); } else { controlElement.addElement( DsmlLiterals.CONTROL_VALUE ).setText( Arrays.toString( value ) ); } } } } } /** * Indicates if a request ID is needed. * * @param container the associated container * @return true if a request ID is needed (ie Processing=Parallel and ResponseOrder=Unordered) * @throws XmlPullParserException if the batch request has not been parsed yet */ public static boolean isRequestIdNeeded( Dsmlv2Container container ) throws XmlPullParserException { BatchRequestDsml batchRequest = container.getBatchRequest(); if ( batchRequest == null ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03003_UNABLE_TO_FIND_BATCH_REQUEST ), container.getParser(), null ); } return ( batchRequest.getProcessing() == Processing.PARALLEL ) && ( batchRequest.getResponseOrder() == ResponseOrder.UNORDERED ); } /** * XML Pretty Printer XSLT Transformation * * @param document the Dom4j Document * @return the transformed document */ public static Document styleDocument( Document document ) { // load the transformer using JAXP TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = null; try ( InputStream xslt = ParserUtils.class.getResourceAsStream( "/org/apache/directory/shared/dsmlv2/DSMLv2.xslt" ) ) { factory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE ); try { factory.setAttribute( XMLConstants.ACCESS_EXTERNAL_DTD, Strings.EMPTY_STRING ); factory.setAttribute( XMLConstants.ACCESS_EXTERNAL_STYLESHEET, Strings.EMPTY_STRING ); } catch ( IllegalArgumentException ex ) { // ignore } transformer = factory.newTransformer( new StreamSource( xslt ) ); } catch ( TransformerConfigurationException e1 ) { if ( LOG.isWarnEnabled() ) { LOG.warn( I18n.msg( I18n.MSG_03000_FAILED_TO_CREATE_XSLT_TRANSFORMER ), e1 ); } // return original document return document; } catch ( IOException ioe ) { // Can't happen } // now lets style the given document DocumentSource source = new DocumentSource( document ); DocumentResult result = new DocumentResult(); try { transformer.transform( source, result ); } catch ( TransformerException e ) { // return original document return document; } // return the transformed document return result.getDocument(); } } apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Tag.java000066400000000000000000000061251525525160600335320ustar00rootroot00000000000000/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import org.apache.directory.api.util.Strings; /** * This class represents a XML tag. *
* A XML tag is defined with : *
    *
  • a name
  • *
  • a type (START tag or END tag)
  • *
* * @author Apache Directory Project */ public class Tag { /** The name of the tag */ private String name; /** The type of the tag */ private int type; /** This int represents a START tag */ public static final int START = 0; /** This int represents a END tag */ public static final int END = 1; /** * Creates a new instance of Tag. * * @param name the name of the tag * @param type the type of the tag */ public Tag( String name, int type ) { setName( name ); setType( type ); } /** * Gets the name of the tag * * @return the name of the tag */ public String getName() { return name; } /** * Sets the name of the tag * * @param name the name to set */ public void setName( String name ) { this.name = Strings.toLowerCaseAscii( name ); } /** * Gets the type of the tag * * @return the type of the tag */ public int getType() { return type; } /** * Sets the type of the tag * * @param type the type to set */ public void setType( int type ) { this.type = type; } /** * {@inheritDoc} */ @Override public boolean equals( Object obj ) { if ( obj instanceof Tag ) { Tag tag = ( Tag ) obj; return ( this.name.equals( tag.getName() ) ) && ( this.type == tag.getType() ); } else { return false; } } /** * {@inheritDoc} */ @Override public int hashCode() { return name.hashCode() + type << 24; } /** * {@inheritDoc} */ @Override public String toString() { if ( name != null ) { return "<" + ( ( type == Tag.END ) ? "/" : "" ) + name + ">"; } else { return "Unknown tag"; } } } apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/actions/000077500000000000000000000000001525525160600336105ustar00rootroot00000000000000ReadSoapHeader.java000066400000000000000000000053001525525160600372010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/actions/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.actions; import java.io.IOException; import org.apache.directory.api.dsmlv2.Dsmlv2Container; import org.apache.directory.api.dsmlv2.Dsmlv2StatesEnum; import org.apache.directory.api.dsmlv2.GrammarAction; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; /** * The action used to read the SOAP Header * * @author Apache Directory Project */ public class ReadSoapHeader extends GrammarAction { /** * Instantiates the action. */ public ReadSoapHeader() { super( "Reads SOAP header" ); } /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { try { XmlPullParser xpp = container.getParser(); StringBuilder sb = new StringBuilder(); String startTag = xpp.getText(); sb.append( startTag ); // string '<' and '>' startTag = startTag.substring( 1, startTag.length() - 1 ); int tagType; String endTag = ""; // continue parsing till we get to the end tag of SOAP header // and match the tag values including the namespace while ( !startTag.equals( endTag ) ) { tagType = xpp.next(); endTag = xpp.getText(); sb.append( endTag ); if ( tagType == XmlPullParser.END_TAG ) { // strip '<', '/' and '>' endTag = endTag.substring( 2, endTag.length() - 1 ); } } // change the state to header end container.setState( Dsmlv2StatesEnum.SOAP_HEADER_END_TAG ); } catch ( IOException e ) { e.printStackTrace(); } } } apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/000077500000000000000000000000001525525160600336405ustar00rootroot00000000000000AbandonRequestDsml.java000066400000000000000000000102221525525160600401540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.AbandonRequest; import org.apache.directory.api.ldap.model.message.AbandonRequestImpl; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.dom4j.Element; /** * DSML Decorator for AbandonRequest * * @author Apache Directory Project */ public class AbandonRequestDsml extends AbstractRequestDsml implements AbandonRequest { /** * Creates a new instance of AbandonRequestDsml. * * @param codec The LDAP Service to use */ public AbandonRequestDsml( LdapApiService codec ) { super( codec, new AbandonRequestImpl() ); } /** * Creates a new instance of AbandonRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public AbandonRequestDsml( LdapApiService codec, AbandonRequest ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element = super.toDsml( root ); // AbandonID if ( getDecorated().getAbandoned() != 0 ) { element.addAttribute( DsmlLiterals.ABANDON_ID, Integer.toString( getDecorated().getAbandoned() ) ); } return element; } /** * Get the abandoned message ID * * @return Returns the abandoned MessageId. */ public int getAbandonedMessageId() { return getDecorated().getAbandoned(); } /** * Set the abandoned message ID * * @param abandonedMessageId The abandoned messageID to set. * @return The modified AbandonRequest instance */ public AbandonRequest setAbandonedMessageId( int abandonedMessageId ) { getDecorated().setAbandoned( abandonedMessageId ); return this; } /** * {@inheritDoc} */ @Override public int getAbandoned() { return getDecorated().getAbandoned(); } /** * {@inheritDoc} */ @Override public AbandonRequest setAbandoned( int requestId ) { getDecorated().setAbandoned( requestId ); return this; } /** * {@inheritDoc} */ @Override public AbandonRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ @Override public AbandonRequest addControl( Control control ) { return ( AbandonRequest ) super.addControl( control ); } /** * {@inheritDoc} */ @Override public AbandonRequest addAllControls( Control[] controls ) { return ( AbandonRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ @Override public AbandonRequest removeControl( Control control ) { return ( AbandonRequest ) super.removeControl( control ); } } AbstractRequestDsml.java000066400000000000000000000104341525525160600403620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import java.nio.ByteBuffer; import org.apache.directory.api.asn1.EncoderException; import org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.Request; import org.dom4j.Element; /** * Abstract class for DSML requests. * * @param The request type * * @author Apache Directory Project */ public abstract class AbstractRequestDsml extends AbstractDsmlMessageDecorator implements Request { /** * Creates a new instance of AbstractRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public AbstractRequestDsml( LdapApiService codec, E ldapMessage ) { super( codec, ldapMessage ); } /** * Creates the Request Element and adds RequestID and Controls. * * @param root the root element * @return the Request Element of the given name containing */ @Override public Element toDsml( Element root ) { Element element = root.addElement( getRequestName() ); // Request ID int requestID = getDecorated().getMessageId(); if ( requestID > 0 ) { element.addAttribute( DsmlLiterals.REQUEST_ID, Integer.toString( requestID ) ); } // Controls ParserUtils.addControls( getCodecService(), element, getDecorated().getControls().values(), true ); return element; } /** * Gets the name of the request according to the type of the decorated element. * * @return the name of the request according to the type of the decorated element. */ protected String getRequestName() { switch ( getDecorated().getType() ) { case ABANDON_REQUEST: return DsmlLiterals.ABANDON_REQUEST; case ADD_REQUEST: return DsmlLiterals.ADD_REQUEST; case BIND_REQUEST: return DsmlLiterals.AUTH_REQUEST; case COMPARE_REQUEST: return DsmlLiterals.COMPARE_REQUEST; case DEL_REQUEST: return DsmlLiterals.DEL_REQUEST; case EXTENDED_REQUEST: return DsmlLiterals.EXTENDED_REQUEST; case MODIFYDN_REQUEST: return DsmlLiterals.MOD_DN_REQUEST; case MODIFY_REQUEST: return DsmlLiterals.MODIFY_REQUEST; case SEARCH_REQUEST: return DsmlLiterals.SEARCH_REQUEST; default: return DsmlLiterals.ERROR; } } /** * Get the length of the encoded request * * @return the buffer's length (always 0) */ public int computeLength() { return 0; } /** * Encode the request. Always return an empty buffer. * * @param buffer The buffer to allocate * @return The resulting buffer * @throws EncoderException If we had an error while encoding the request */ public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { return null; } /** * {@inheritDoc} */ @Override public boolean hasResponse() { return getDecorated().hasResponse(); } } AbstractResultResponseRequestDsml.java000066400000000000000000000074411525525160600433040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import java.nio.ByteBuffer; import org.apache.directory.api.asn1.EncoderException; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.AbandonListener; import org.apache.directory.api.ldap.model.message.AbandonableRequest; import org.apache.directory.api.ldap.model.message.ResultResponse; import org.apache.directory.api.ldap.model.message.ResultResponseRequest; import org.dom4j.Element; /** * Abstract class for DSML requests. * * @param The response request result type * @param The response result type * * @author Apache Directory Project */ public abstract class AbstractResultResponseRequestDsml extends AbstractRequestDsml implements ResultResponseRequest, AbandonableRequest { /** * Creates a new instance of AbstractRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public AbstractResultResponseRequestDsml( LdapApiService codec, E ldapMessage ) { super( codec, ldapMessage ); } /** * Creates the Request Element and adds RequestID and Controls. * * @param root the root element * @return the Request Element of the given name containing */ @Override public Element toDsml( Element root ) { Element element = root.addElement( getRequestName() ); // Request ID int requestID = getDecorated().getMessageId(); if ( requestID > 0 ) { element.addAttribute( DsmlLiterals.REQUEST_ID, Integer.toString( requestID ) ); } // Controls ParserUtils.addControls( getCodecService(), element, getDecorated().getControls().values(), false ); return element; } /** * {@inheritDoc} */ @Override public int computeLength() { return 0; } /** * {@inheritDoc} */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { return null; } /** * {@inheritDoc} */ @Override public ResultResponse getResultResponse() { return getDecorated().getResultResponse(); } /** * {@inheritDoc} */ @Override public void abandon() { ( ( AbandonableRequest ) getDecorated() ).abandon(); } /** * {@inheritDoc} */ @Override public boolean isAbandoned() { return ( ( AbandonableRequest ) getDecorated() ).isAbandoned(); } /** * {@inheritDoc} */ @Override public AbandonableRequest addAbandonListener( AbandonListener listener ) { ( ( AbandonableRequest ) getDecorated() ).addAbandonListener( listener ); return this; } } AddRequestDsml.java000066400000000000000000000215251525525160600373120ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.commons.text.StringEscapeUtils; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.entry.Attribute; import org.apache.directory.api.ldap.model.entry.DefaultAttribute; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.message.AddRequest; import org.apache.directory.api.ldap.model.message.AddRequestImpl; import org.apache.directory.api.ldap.model.message.AddResponse; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.name.Dn; import org.dom4j.Element; import org.dom4j.Namespace; import org.dom4j.QName; /** * DSML Decorator for AddRequest * * @author Apache Directory Project */ public class AddRequestDsml extends AbstractResultResponseRequestDsml implements AddRequest { /** The current attribute being decoded */ private Attribute currentAttribute; /** * Creates a new getDecoratedMessage() of AddRequestDsml. * * @param codec The LDAP Service to use */ public AddRequestDsml( LdapApiService codec ) { super( codec, new AddRequestImpl() ); } /** * Creates a new getDecoratedMessage() of AddRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public AddRequestDsml( LdapApiService codec, AddRequest ldapMessage ) { super( codec, ldapMessage ); } /** * Create a new attributeValue * * @param type The attribute's name (called 'type' in the grammar) * @throws LdapException If we can't add the type */ public void addAttributeType( String type ) throws LdapException { // do not create a new attribute if we have seen this attributeType before if ( getDecorated().getEntry().get( type ) != null ) { currentAttribute = getDecorated().getEntry().get( type ); return; } // fix this to use AttributeImpl(type.getString().toLowerCase()) currentAttribute = new DefaultAttribute( type ); getDecorated().getEntry().put( currentAttribute ); } /** * Get the current attributeType * * @return Returns the currentAttribute type. */ public String getCurrentAttributeType() { return currentAttribute.getId(); } /** * Add a new value to the current attribute * * @param value The value to add * @throws LdapException If we can't add a new value */ public void addAttributeValue( String value ) throws LdapException { currentAttribute.add( value ); } /** * Add a new value to the current attribute * * @param value The value to add * @throws LdapException If we can't add a new value */ public void addAttributeValue( Value value ) throws LdapException { currentAttribute.add( value ); } /** * Add a new value to the current attribute * * @param value The value to add * @throws LdapException If we can't add a new value */ public void addAttributeValue( byte[] value ) throws LdapException { currentAttribute.add( value ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element = super.toDsml( root ); // Dn if ( getDecorated().getEntry() != null ) { element.addAttribute( DsmlLiterals.DN, getDecorated().getEntry().getDn().getName() ); } // Attributes Entry entry = getDecorated().getEntry(); if ( entry != null ) { for ( Attribute attribute : entry ) { Element attributeElement = element.addElement( DsmlLiterals.ATTR ); attributeElement.addAttribute( DsmlLiterals.NAME, attribute.getId() ); // Looping on Values for ( Value value : attribute ) { if ( value.isHumanReadable() ) { attributeElement.addElement( DsmlLiterals.VALUE ).addText( StringEscapeUtils.escapeXml11( value.getString() ) ); } else { Namespace xsdNamespace = new Namespace( ParserUtils.XSD, ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( ParserUtils.XSI, ParserUtils.XML_SCHEMA_INSTANCE_URI ); attributeElement.getDocument().getRootElement().add( xsdNamespace ); attributeElement.getDocument().getRootElement().add( xsiNamespace ); Element valueElement = attributeElement.addElement( DsmlLiterals.VALUE ).addText( ParserUtils.base64Encode( value.getString() ) ); valueElement .addAttribute( new QName( DsmlLiterals.TYPE, xsiNamespace ), ParserUtils.XSD_COLON + ParserUtils.BASE64BINARY ); } } } } return element; } /** * Initialize the Entry. */ public void initEntry() { } /** * Get the entry with its attributes. * * @return Returns the entry. */ @Override public Entry getEntry() { return getDecorated().getEntry(); } /** * Add a new value to the current attribute * * @param value The value to be added * @throws LdapException If we can't add a new value */ public void addAttributeValue( Object value ) throws LdapException { if ( value instanceof Value ) { ( ( AddRequestDsml ) getDecorated() ).addAttributeValue( ( Value ) value ); } else if ( value instanceof String ) { ( ( AddRequestDsml ) getDecorated() ).addAttributeValue( ( String ) value ); } else if ( value instanceof byte[] ) { ( ( AddRequestDsml ) getDecorated() ).addAttributeValue( ( byte[] ) value ); } } /** * Get the added Dn * * @return Returns the entry Dn. */ @Override public Dn getEntryDn() { return getDecorated().getEntryDn(); } /** * {@inheritDoc} */ @Override public AddRequest setEntryDn( Dn entryDn ) { getDecorated().setEntryDn( entryDn ); return this; } /** * {@inheritDoc} */ @Override public AddRequest setEntry( Entry entry ) { getDecorated().setEntry( entry ); return this; } /** * {@inheritDoc} */ @Override public AddRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ @Override public AddRequest addControl( Control control ) { return ( AddRequest ) super.addControl( control ); } /** * {@inheritDoc} */ @Override public AddRequest addAllControls( Control[] controls ) { return ( AddRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ @Override public AddRequest removeControl( Control control ) { return ( AddRequest ) super.removeControl( control ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } } AndFilter.java000066400000000000000000000032301525525160600362720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import java.util.List; /** * And Filter Object to store the And filter. * * @author Apache Directory Project */ public class AndFilter extends ConnectorFilter { /** * Default constructor */ public AndFilter() { super(); } /** * Get the AndFilter. * * @return Returns the andFilter. */ public List getAndFilter() { return filterSet; } /** * Return a string compliant with RFC 2254 representing an AND filter * * @return The AND filter string */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( '&' ).append( super.toString() ); return sb.toString(); } } AttributeValueAssertion.java000066400000000000000000000127241525525160600412620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.ldap.codec.api.LdapCodecConstants; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.util.Strings; /** * A class to store an attribute value assertion. * The grammar is : * * AttributeValueAssertion ::= SEQUENCE { * attributeDesc AttributeDescription, * assertionValue AssertionValue } * * AttributeDescription ::= LDAPString * * AssertionValue ::= OCTET STRING * * @author Apache Directory Project */ public class AttributeValueAssertion { /** The attribute description */ private String attributeDesc; /** The assertion value */ private Value assertionValue; /** * Default constructor */ public AttributeValueAssertion() { // Nothing to do } /** * Helper method to render an object which can be a String or a byte[] * * @param object The Value to dump * @return A string representing the object */ public static String dumpObject( Object object ) { if ( object != null ) { if ( object instanceof String ) { return ( String ) object; } else if ( object instanceof byte[] ) { return Strings.dumpBytes( ( byte[] ) object ); } else if ( object instanceof Value ) { return ( ( Value ) object ).getString(); } else { return ""; } } else { return Strings.EMPTY_STRING; } } // ~ Methods // ------------------------------------------------------------------------------------ /** * Get the assertion value * * @return Returns the assertionValue. */ public Value getAssertionValue() { return assertionValue; } /** * Set the assertion value * * @param assertionValue The assertionValue to set. */ public void setAssertionValue( Value assertionValue ) { this.assertionValue = assertionValue; } /** * Get the attribute description * * @return Returns the attributeDesc. */ public String getAttributeDesc() { return attributeDesc; } /** * Set the attribute description * * @param attributeDesc The attributeDesc to set. */ public void setAttributeDesc( String attributeDesc ) { this.attributeDesc = attributeDesc; } /** * Get a String representation of an AttributeValueAssertion * * @param tabs The spacing to be put before the string * @return An AttributeValueAssertion String */ public String toString( String tabs ) { StringBuilder sb = new StringBuilder(); sb.append( tabs ).append( "AttributeValueAssertion\n" ); sb.append( tabs ).append( " Assertion description : '" ); sb.append( attributeDesc != null ? attributeDesc : "null" ); sb.append( "'\n" ); sb.append( tabs ).append( " Assertion value : '" ).append( dumpObject( assertionValue ) ).append( "'\n" ); return sb.toString(); } /** * Get a String representation of an AttributeValueAssertion, as of RFC * 2254. * * @param filterType The filter type * @return An AttributeValueAssertion String */ public String toStringRFC2254( int filterType ) { StringBuilder sb = new StringBuilder(); sb.append( attributeDesc ); switch ( filterType ) { case LdapCodecConstants.EQUALITY_MATCH_FILTER: sb.append( '=' ); break; case LdapCodecConstants.LESS_OR_EQUAL_FILTER: sb.append( "<=" ); break; case LdapCodecConstants.GREATER_OR_EQUAL_FILTER: sb.append( ">=" ); break; case LdapCodecConstants.APPROX_MATCH_FILTER: sb.append( "~=" ); break; default: throw new IllegalStateException( I18n.err( I18n.ERR_03037_UNEXPECTED_FILTER_TYPE, filterType ) ); } sb.append( dumpObject( assertionValue ) ); return sb.toString(); } /** * Get a String representation of an AttributeValueAssertion * * @return An AttributeValueAssertion String */ @Override public String toString() { return toString( Strings.EMPTY_STRING ); } } AttributeValueAssertionFilter.java000066400000000000000000000047401525525160600424270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.util.Strings; /** * Object to store the filter. A filter is seen as a tree with a root. * * @author Apache Directory Project */ public class AttributeValueAssertionFilter extends Filter { /** The assertion. */ private AttributeValueAssertion assertion; /** The filter type */ private int filterType; /** * The constructor. * * @param filterType The filter type */ public AttributeValueAssertionFilter( int filterType ) { this.filterType = filterType; } /** * Get the assertion * * @return Returns the assertion. */ public AttributeValueAssertion getAssertion() { return assertion; } /** * Set the assertion * * @param assertion The assertion to set. */ public void setAssertion( AttributeValueAssertion assertion ) { this.assertion = assertion; } /** * Get the filter type * * @return Returns the filterType. */ public int getFilterType() { return filterType; } /** * Set the filter type * * @param filterType The filterType to set. */ public void setFilterType( int filterType ) { this.filterType = filterType; } /** * Return a string compliant with RFC 2254 representing an item filter * * @return The item filter string */ @Override public String toString() { return assertion != null ? assertion.toStringRFC2254( filterType ) : Strings.EMPTY_STRING; } } BatchRequestDsml.java000066400000000000000000000211211525525160600376330ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import java.util.ArrayList; import java.util.List; import org.apache.directory.api.dsmlv2.DsmlDecorator; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.ldap.model.message.Request; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; /** * This class represents the Batch Request. It can be used to generate an the XML String of a BatchRequest. * * @author Apache Directory Project */ public class BatchRequestDsml { /** The Requests list */ private List> requests; /** The ID of the request */ private int requestID; /** The type of processing of the Batch Request */ private Processing processing; /** The type of on error handling */ private OnError onError; /** The response order */ private ResponseOrder responseOrder; /** * This enum represents the different types of processing for a Batch Request * * @author Apache Directory Project */ public enum Processing { /** Sequential processing. */ SEQUENTIAL, /** Parallel processing. */ PARALLEL } /** * This enum represents the different types of on error handling for a BatchRequest * * @author Apache Directory Project */ public enum OnError { /** Resume on error. */ RESUME, /** Exit on error. */ EXIT } /** * This enum represents the different types of response order for a Batch Request * * @author Apache Directory Project */ public enum ResponseOrder { /** Sequential response order. */ SEQUENTIAL, /** Unordered response order. */ UNORDERED } /** * flag to indicate to store the request objects present in * this batch request. Default is true */ private boolean storeReq = true; private DsmlDecorator currentReq; /** * Creates a new instance of BatchResponseDsml. */ public BatchRequestDsml() { requests = new ArrayList<>(); responseOrder = ResponseOrder.SEQUENTIAL; processing = Processing.SEQUENTIAL; onError = OnError.EXIT; } /** * Gets the current request * * @return * the current request */ public DsmlDecorator getCurrentRequest() { return currentReq; } /** * Adds a request to the Batch Request DSML. * * @param request * the request to add * @return * true (as per the general contract of the Collection.add method). */ public boolean addRequest( DsmlDecorator request ) { currentReq = request; if ( storeReq ) { return requests.add( request ); } else { return true; } } /** * Removes a request from the Batch Request DSML. * * @param request * the request to remove * @return * true if this list contained the specified element. */ public boolean removeRequest( DsmlDecorator request ) { return requests.remove( request ); } /** * Gets the ID of the request * * @return * the ID of the request */ public int getRequestID() { return requestID; } /** * Sets the ID of the request * * @param requestID * the ID to set */ public void setRequestID( int requestID ) { this.requestID = requestID; } /** * Gets the processing type of the request * * @return * the processing type of the request */ public Processing getProcessing() { return processing; } /** * Sets the processing type of the request * * @param processing * the processing type to set */ public void setProcessing( Processing processing ) { this.processing = processing; } /** * Gets the on error handling type of the request * * @return * the on error handling type of the request */ public OnError getOnError() { return onError; } /** * Sets the on error handling type of the request * * @param onError * the on error handling type to set */ public void setOnError( OnError onError ) { this.onError = onError; } /** * Gets the response order type of the request * * @return * the response order type of the request */ public ResponseOrder getResponseOrder() { return responseOrder; } /** * Sets the response order type of the request * * @param responseOrder * the response order type to set */ public void setResponseOrder( ResponseOrder responseOrder ) { this.responseOrder = responseOrder; } /** * Gets the List of all the requests in the Batch Request * * @return the List of all the requests in the Batch Request */ public List> getRequests() { return requests; } /** * Converts this Batch Request to its XML representation in the DSMLv2 format. * * @return the XML representation in DSMLv2 format */ public String toDsml() { Document document = DocumentHelper.createDocument(); Element element = document.addElement( DsmlLiterals.BATCH_REQUEST ); // RequestID if ( requestID != 0 ) { element.addAttribute( DsmlLiterals.REQUEST_ID, Integer.toString( requestID ) ); } // ResponseOrder if ( responseOrder == ResponseOrder.UNORDERED ) { element.addAttribute( DsmlLiterals.RESPONSE_ORDER, DsmlLiterals.UNORDERED ); } // Processing if ( processing == Processing.PARALLEL ) { element.addAttribute( DsmlLiterals.PROCESSING, DsmlLiterals.PARALLEL ); } // On Error if ( onError == OnError.RESUME ) { element.addAttribute( DsmlLiterals.ON_ERROR, DsmlLiterals.RESUME ); } // Requests for ( DsmlDecorator request : requests ) { request.toDsml( element ); } return ParserUtils.styleDocument( document ).asXML(); } /** * Tells if the request objects are stored * * @return true if the request objects are stored, false otherwise */ public boolean isStoringRequests() { return storeReq; } /** * set the storeReq flag to turn on/off storing of request objects * * Note: it is better to set this flag to false while processing large DSML * batch requests * * @param storeReq Tells if the request objects must be stored or not */ public void setStoreReq( boolean storeReq ) { this.storeReq = storeReq; } /** * {@inheritDoc} */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( "[" ); sb.append( "processing: " ).append( processing ); sb.append( " - " ); sb.append( "onError: " ).append( onError ); sb.append( " - " ); sb.append( "responseOrder: " ).append( responseOrder ); sb.append( "]" ); return sb.toString(); } } BindRequestDsml.java000066400000000000000000000143451525525160600375000ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.BindRequest; import org.apache.directory.api.ldap.model.message.BindRequestImpl; import org.apache.directory.api.ldap.model.message.BindResponse; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.name.Dn; import org.dom4j.Element; /** * DSML Decorator for BindRequest * * @author Apache Directory Project */ public class BindRequestDsml extends AbstractResultResponseRequestDsml implements BindRequest { /** * Creates a new getDecoratedMessage() of AuthRequestDsml. * * @param codec The LDAP Service to use */ public BindRequestDsml( LdapApiService codec ) { super( codec, new BindRequestImpl() ); } /** * Creates a new getDecoratedMessage() of AuthRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public BindRequestDsml( LdapApiService codec, BindRequest ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element = super.toDsml( root ); BindRequest request = getDecorated(); // Principal Dn dn = request.getDn(); if ( !Dn.isNullOrEmpty( dn ) ) { // A DN has been provided element.addAttribute( DsmlLiterals.PRINCIPAL, dn.getName() ); } else { // No DN has been provided, let's use the name as a string instead String name = request.getName(); element.addAttribute( DsmlLiterals.PRINCIPAL, name ); } return element; } /** * {@inheritDoc} */ @Override public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ @Override public boolean isSimple() { return getDecorated().isSimple(); } /** * {@inheritDoc} */ @Override public boolean getSimple() { return getDecorated().getSimple(); } /** * {@inheritDoc} */ @Override public BindRequest setSimple( boolean isSimple ) { getDecorated().setSimple( isSimple ); return this; } /** * {@inheritDoc} */ @Override public byte[] getCredentials() { return getDecorated().getCredentials(); } /** * {@inheritDoc} */ @Override public BindRequest setCredentials( String credentials ) { getDecorated().setCredentials( credentials ); return this; } /** * {@inheritDoc} */ @Override public BindRequest setCredentials( byte[] credentials ) { getDecorated().setCredentials( credentials ); return this; } /** * {@inheritDoc} */ @Override public String getName() { return getDecorated().getName(); } /** * {@inheritDoc} */ @Override public BindRequest setName( String name ) { getDecorated().setName( name ); return this; } /** * {@inheritDoc} */ @Override public Dn getDn() { return getDecorated().getDn(); } /** * {@inheritDoc} */ @Override public BindRequest setDn( Dn dn ) { getDecorated().setDn( dn ); return this; } /** * {@inheritDoc} */ @Override public boolean isVersion3() { return getDecorated().isVersion3(); } /** * {@inheritDoc} */ @Override public boolean getVersion3() { return getDecorated().getVersion3(); } /** * {@inheritDoc} */ @Override public BindRequest setVersion3( boolean isVersion3 ) { getDecorated().setVersion3( isVersion3 ); return this; } /** * {@inheritDoc} */ @Override public String getSaslMechanism() { return getDecorated().getSaslMechanism(); } /** * {@inheritDoc} */ @Override public BindRequest setSaslMechanism( String saslMechanism ) { getDecorated().setSaslMechanism( saslMechanism ); return this; } /** * {@inheritDoc} */ @Override public BindRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ @Override public BindRequest addControl( Control control ) { return ( BindRequest ) super.addControl( control ); } /** * {@inheritDoc} */ @Override public BindRequest addAllControls( Control[] controls ) { return ( BindRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ @Override public BindRequest removeControl( Control control ) { return ( BindRequest ) super.removeControl( control ); } } CompareRequestDsml.java000066400000000000000000000143711525525160600402110ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.message.CompareRequest; import org.apache.directory.api.ldap.model.message.CompareRequestImpl; import org.apache.directory.api.ldap.model.message.CompareResponse; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.name.Dn; import org.dom4j.Element; /** * DSML Decorator for CompareRequest * * @author Apache Directory Project */ public class CompareRequestDsml extends AbstractResultResponseRequestDsml implements CompareRequest { /** * Creates a new getDecoratedMessage() of CompareRequestDsml. * * @param codec The LDAP Service to use */ public CompareRequestDsml( LdapApiService codec ) { super( codec, new CompareRequestImpl() ); } /** * Creates a new getDecoratedMessage() of CompareRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public CompareRequestDsml( LdapApiService codec, CompareRequest ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element = super.toDsml( root ); CompareRequest request = getDecorated(); // Dn if ( request.getName() != null ) { element.addAttribute( DsmlLiterals.DN, request.getName().getName() ); } // Assertion Element assertionElement = element.addElement( DsmlLiterals.ASSERTION ); if ( request.getAttributeId() != null ) { assertionElement.addAttribute( DsmlLiterals.NAME, request.getAttributeId() ); } if ( request.getAssertionValue() != null ) { assertionElement.addElement( DsmlLiterals.VALUE ).setText( request.getAssertionValue().getString() ); } return element; } /** * Get the entry to be compared * * @return Returns the entry. */ @Override public Dn getName() { return getDecorated().getName(); } /** * Set the entry to be compared * * @param entry The entry to set. */ @Override public CompareRequest setName( Dn entry ) { getDecorated().setName( entry ); return this; } /** * Set the assertion value * * @param assertionValue The assertionValue to set. */ public void setAssertionValue( Object assertionValue ) { if ( assertionValue instanceof String ) { getDecorated().setAssertionValue( ( String ) assertionValue ); } else { getDecorated().setAssertionValue( ( byte[] ) assertionValue ); } } /** * Get the attribute description * * @return Returns the attributeDesc. */ public String getAttributeDesc() { return getDecorated().getAttributeId(); } /** * Set the attribute description * * @param attributeDesc The attributeDesc to set. */ public void setAttributeDesc( String attributeDesc ) { getDecorated().setAttributeId( attributeDesc ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ @Override public CompareRequest setAssertionValue( String value ) { getDecorated().setAssertionValue( value ); return this; } /** * {@inheritDoc} */ @Override public CompareRequest setAssertionValue( byte[] value ) { getDecorated().setAssertionValue( value ); return this; } /** * {@inheritDoc} */ @Override public String getAttributeId() { return getDecorated().getAttributeId(); } /** * {@inheritDoc} */ @Override public CompareRequest setAttributeId( String attrId ) { getDecorated().setAttributeId( attrId ); return this; } /** * {@inheritDoc} */ @Override public Value getAssertionValue() { return getDecorated().getAssertionValue(); } /** * {@inheritDoc} */ @Override public CompareRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ @Override public CompareRequest addControl( Control control ) { return ( CompareRequest ) super.addControl( control ); } /** * {@inheritDoc} */ @Override public CompareRequest addAllControls( Control[] controls ) { return ( CompareRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ @Override public CompareRequest removeControl( Control control ) { return ( CompareRequest ) super.removeControl( control ); } } ConnectorFilter.java000066400000000000000000000047571525525160600375410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import java.util.ArrayList; import java.util.List; import org.apache.directory.api.asn1.DecoderException; /** * This Filter abstract class is used to store a set of filters used by * OR/AND/NOT filters. * * @author Apache Directory Project */ public abstract class ConnectorFilter extends Filter { /** The set of filters used by And/Or filters */ protected List filterSet; /** * Default constructor */ public ConnectorFilter() { super(); } /** * Add a new Filter to the list. * * @param filter The filter to add * @throws DecoderException If the added filter is invalid */ public void addFilter( Filter filter ) throws DecoderException { if ( filterSet == null ) { filterSet = new ArrayList<>(); } filterSet.add( filter ); } /** * Get the list of filters stored in the composite filter * * @return And array of filters */ public List getFilterSet() { return filterSet; } /** * Return a string compliant with RFC 2254 representing a composite filter, * one of AND, OR and NOT * * @return The composite filter string */ @Override public String toString() { StringBuilder sb = new StringBuilder(); if ( ( filterSet != null ) && !filterSet.isEmpty() ) { for ( Filter filter : filterSet ) { sb.append( '(' ).append( filter ).append( ')' ); } } return sb.toString(); } } DelRequestDsml.java000066400000000000000000000103021525525160600373150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.DeleteRequest; import org.apache.directory.api.ldap.model.message.DeleteRequestImpl; import org.apache.directory.api.ldap.model.message.DeleteResponse; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.name.Dn; import org.dom4j.Element; /** * DSML Decorator for DeleteRequest * * @author Apache Directory Project */ public class DelRequestDsml extends AbstractResultResponseRequestDsml implements DeleteRequest { /** * Creates a new getDecoratedMessage() of DelRequestDsml. * * @param codec The LDAP Service to use */ public DelRequestDsml( LdapApiService codec ) { super( codec, new DeleteRequestImpl() ); } /** * Creates a new getDecoratedMessage() of DelRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public DelRequestDsml( LdapApiService codec, DeleteRequest ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element = super.toDsml( root ); // Dn if ( getDecorated().getName() != null ) { element.addAttribute( DsmlLiterals.DN, getDecorated().getName().getName() ); } return element; } /** * Get the entry to be deleted * * @return Returns the entry. */ public Dn getEntry() { return getDecorated().getName(); } /** * Set the entry to be deleted * * @param entry The entry to set. */ public void setEntry( Dn entry ) { getDecorated().setName( entry ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ @Override public Dn getName() { return getDecorated().getName(); } /** * {@inheritDoc} */ @Override public DeleteRequest setName( Dn name ) { getDecorated().setName( name ); return this; } /** * {@inheritDoc} */ @Override public DeleteRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ @Override public DeleteRequest addControl( Control control ) { return ( DeleteRequest ) super.addControl( control ); } /** * {@inheritDoc} */ @Override public DeleteRequest addAllControls( Control[] controls ) { return ( DeleteRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ @Override public DeleteRequest removeControl( Control control ) { return ( DeleteRequest ) super.removeControl( control ); } } Dsmlv2Grammar.java000066400000000000000000004476321525525160600371220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import java.io.IOException; import java.lang.reflect.Array; import java.util.HashMap; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.util.Oid; import org.apache.directory.api.dsmlv2.AbstractGrammar; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.Dsmlv2Container; import org.apache.directory.api.dsmlv2.Dsmlv2StatesEnum; import org.apache.directory.api.dsmlv2.Grammar; import org.apache.directory.api.dsmlv2.GrammarAction; import org.apache.directory.api.dsmlv2.GrammarTransition; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.dsmlv2.Tag; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.OnError; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.Processing; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.ResponseOrder; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.ldap.codec.api.ControlFactory; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory; import org.apache.directory.api.ldap.codec.api.LdapCodecConstants; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException; import org.apache.directory.api.ldap.model.exception.LdapSchemaException; import org.apache.directory.api.ldap.model.filter.ExprNode; import org.apache.directory.api.ldap.model.message.AbandonRequestImpl; import org.apache.directory.api.ldap.model.message.AddRequestImpl; import org.apache.directory.api.ldap.model.message.AliasDerefMode; import org.apache.directory.api.ldap.model.message.BindRequestImpl; import org.apache.directory.api.ldap.model.message.CompareRequest; import org.apache.directory.api.ldap.model.message.CompareRequestImpl; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.DeleteRequestImpl; import org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl; import org.apache.directory.api.ldap.model.message.ModifyRequestImpl; import org.apache.directory.api.ldap.model.message.OpaqueExtendedRequest; import org.apache.directory.api.ldap.model.message.Request; import org.apache.directory.api.ldap.model.message.SearchRequest; import org.apache.directory.api.ldap.model.message.SearchRequestImpl; import org.apache.directory.api.ldap.model.message.SearchScope; import org.apache.directory.api.ldap.model.message.controls.OpaqueControl; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.ldap.model.name.Rdn; import org.apache.directory.api.util.Strings; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; /** * This Class represents the DSMLv2 Request Grammar * * @author Apache Directory Project */ public final class Dsmlv2Grammar extends AbstractGrammar implements Grammar { private LdapApiService codec = LdapApiServiceFactory.getSingleton(); //************************* //* GRAMMAR ACTIONS * //************************* /** * GrammarAction that creates a Batch Request */ private final GrammarAction batchRequestCreation = new GrammarAction( "Create Batch Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { BatchRequestDsml batchRequest = new BatchRequestDsml(); container.setBatchRequest( batchRequest ); XmlPullParser xpp = container.getParser(); // Checking and adding the batchRequest's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { batchRequest.setRequestID( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } // processing attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.PROCESSING ); if ( attributeValue != null ) { if ( DsmlLiterals.SEQUENTIAL.equals( attributeValue ) ) { batchRequest.setProcessing( Processing.SEQUENTIAL ); } else if ( DsmlLiterals.PARALLEL.equals( attributeValue ) ) { batchRequest.setProcessing( Processing.PARALLEL ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03013_UNKNOWN_PROCESSING_VALUE ), xpp, null ); } } else { batchRequest.setProcessing( Processing.SEQUENTIAL ); } // onError attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.ON_ERROR ); if ( attributeValue != null ) { if ( DsmlLiterals.RESUME.equals( attributeValue ) ) { batchRequest.setOnError( OnError.RESUME ); } else if ( DsmlLiterals.EXIT.equals( attributeValue ) ) { batchRequest.setOnError( OnError.EXIT ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03014_UNKNOWN_ON_ERROR_VALUE ), xpp, null ); } } else { batchRequest.setOnError( OnError.EXIT ); } // responseOrder attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.RESPONSE_ORDER ); if ( attributeValue != null ) { if ( DsmlLiterals.SEQUENTIAL.equals( attributeValue ) ) { batchRequest.setResponseOrder( ResponseOrder.SEQUENTIAL ); } else if ( DsmlLiterals.UNORDERED.equals( attributeValue ) ) { batchRequest.setResponseOrder( ResponseOrder.UNORDERED ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03015_UNKNOWN_RESPONSE_ORDER_VALUE ), xpp, null ); } } else { batchRequest.setResponseOrder( ResponseOrder.SEQUENTIAL ); } } }; /** * GrammarAction that creates an Abandon Request */ private final GrammarAction abandonRequestCreation = new GrammarAction( "Create Abandon Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { AbandonRequestDsml abandonRequest = new AbandonRequestDsml( codec, new AbandonRequestImpl() ); container.getBatchRequest().addRequest( abandonRequest ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { abandonRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null ); } } // abandonID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.ABANDON_ID ); if ( attributeValue != null ) { try { abandonRequest.setAbandoned( Integer.parseInt( attributeValue ) ); } catch ( NumberFormatException nfe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03017_ABANDON_ID_NOT_INTEGER ), xpp, nfe ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03018_ABANDON_ID_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that creates an Add Request */ private final GrammarAction addRequestCreation = new GrammarAction( "Create Add Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { AddRequestDsml addRequest = new AddRequestDsml( codec, new AddRequestImpl() ); container.getBatchRequest().addRequest( addRequest ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { addRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DN ); if ( attributeValue != null ) { try { addRequest.setEntryDn( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that adds an attribute to an Add Request */ private final GrammarAction addRequestAddAttribute = new GrammarAction( "Add Attribute to Add Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { AddRequestDsml addRequest = ( AddRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // name attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeValue != null ) { try { addRequest.addAttributeType( attributeValue ); } catch ( LdapException le ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03020_CANT_ADD_ATTRIBUTE_VALUE ), xpp, le ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that adds a Value to an Attribute of an Add Request */ private final GrammarAction addRequestAddValue = new GrammarAction( "Add Value to Attribute" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { AddRequestDsml addRequest = ( AddRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { try { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { addRequest.addAttributeValue( ParserUtils.base64Decode( xpp, nextText.trim() ) ); } else { addRequest.addAttributeValue( nextText.trim() ); } } catch ( LdapException le ) { throw new XmlPullParserException( le.getMessage(), xpp, le ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates an Auth Request */ private final GrammarAction authRequestCreation = new GrammarAction( "Create Auth Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { BindRequestDsml authRequest = new BindRequestDsml( codec, new BindRequestImpl() ); container.getBatchRequest().addRequest( authRequest ); authRequest.setSimple( true ); authRequest.setVersion3( true ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { authRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null ); } } // principal attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.PRINCIPAL ); if ( attributeValue != null ) { authRequest.setName( attributeValue ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03021_PRINCIPAL_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that creates an Compare Request */ private final GrammarAction compareRequestCreation = new GrammarAction( "Create Compare Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { CompareRequestDsml compareRequest = new CompareRequestDsml( codec, new CompareRequestImpl() ); container.getBatchRequest().addRequest( compareRequest ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { compareRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DN ); if ( attributeValue != null ) { try { compareRequest.setName( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that adds an Assertion to a Compare Request */ private final GrammarAction compareRequestAddAssertion = new GrammarAction( "Add Assertion to Compare Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { CompareRequest compareRequest = ( CompareRequest ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeId; // name attributeId = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeId != null ) { compareRequest.setAttributeId( attributeId ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that adds a Value to a Compare Request */ private final GrammarAction compareRequestAddValue = new GrammarAction( "Add Value to Compare Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { CompareRequest compareRequest = ( CompareRequest ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { compareRequest.setAssertionValue( ParserUtils.base64Decode( xpp, nextText.trim() ) ); } else { compareRequest.setAssertionValue( nextText.trim() ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates a Del Request */ private final GrammarAction delRequestCreation = new GrammarAction( "Create Del Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { DelRequestDsml delRequest = new DelRequestDsml( codec, new DeleteRequestImpl() ); container.getBatchRequest().addRequest( delRequest ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { delRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DN ); if ( attributeValue != null ) { try { delRequest.setName( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that creates an Extended Request */ private final GrammarAction extendedRequestCreation = new GrammarAction( "Create Extended Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtendedRequestDsml extendedRequest = new ExtendedRequestDsml<>( codec, new OpaqueExtendedRequest() ); container.getBatchRequest().addRequest( extendedRequest ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { extendedRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null ); } } } }; /** * GrammarAction that adds a Name to an Extended Request */ private final GrammarAction extendedRequestAddName = new GrammarAction( "Add Name to Extended Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); try { String nextText = xpp.nextText(); if ( Strings.isEmpty( nextText ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03022_NULL_REQUEST_NAME ), xpp, null ); } else { String oid = nextText.trim(); if ( Oid.isOid( oid ) ) { extendedRequest.setRequestName( nextText.trim() ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03038_BAD_OID, oid ), xpp, null ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that adds a Value to an Extended Request */ private final GrammarAction extendedRequestAddValue = new GrammarAction( "Add Value to Extended Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { extendedRequest.setRequestValue( ParserUtils.base64Decode( xpp, nextText.trim() ) ); } else { extendedRequest.setRequestValue( Strings.getBytesUtf8( nextText.trim() ) ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates a Modify Dn Request */ private final GrammarAction modDNRequestCreation = new GrammarAction( "Create Modify Dn Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ModifyDNRequestDsml modifyDNRequest = new ModifyDNRequestDsml( codec, new ModifyDnRequestImpl() ); container.getBatchRequest().addRequest( modifyDNRequest ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { modifyDNRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DN ); if ( attributeValue != null ) { try { modifyDNRequest.setName( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null ); } // newrdn attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NEW_RDN ); if ( attributeValue != null ) { try { modifyDNRequest.setNewRdn( new Rdn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03023_NEW_RDN_ATTRIBUTE_REQUESTED ), xpp, null ); } // deleteoldrdn attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DELETE_OLD_RDN ); if ( attributeValue != null ) { if ( ( attributeValue.equalsIgnoreCase( DsmlLiterals.TRUE ) ) || ( "1".equals( attributeValue ) ) ) { modifyDNRequest.setDeleteOldRdn( true ); } else if ( ( attributeValue.equalsIgnoreCase( DsmlLiterals.FALSE ) ) || ( "0".equals( attributeValue ) ) ) { modifyDNRequest.setDeleteOldRdn( false ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03024_INCORRECT_DELETE_OLD_RDN_VALUE ), xpp, null ); } } else { modifyDNRequest.setDeleteOldRdn( true ); } // newsuperior attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NEW_SUPERIOR ); if ( attributeValue != null ) { try { modifyDNRequest.setNewSuperior( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide ); } } } }; /** * GrammarAction that creates a Modify Request */ private final GrammarAction modifyRequestCreation = new GrammarAction( "Create Modify Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ModifyRequestDsml modifyRequest = new ModifyRequestDsml( codec, new ModifyRequestImpl() ); container.getBatchRequest().addRequest( modifyRequest ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { modifyRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DN ); if ( attributeValue != null ) { try { modifyRequest.setName( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getLocalizedMessage() ), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that adds a Modification to a Modify Request */ private final GrammarAction modifyRequestAddModification = new GrammarAction( "Adds Modification to Modify Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ModifyRequestDsml modifyRequest = ( ModifyRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // operation attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.OPERATION ); if ( attributeValue != null ) { if ( DsmlLiterals.ADD.equals( attributeValue ) ) { modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_ADD ); } else if ( DsmlLiterals.DELETE.equals( attributeValue ) ) { modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_DELETE ); } else if ( DsmlLiterals.REPLACE.equals( attributeValue ) ) { modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_REPLACE ); } else if ( DsmlLiterals.INCREMENT.equals( attributeValue ) ) { modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_INCREMENT ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03040_UNKNOWN_OPERATION ), xpp, null ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03025_OPERATION_ATTRIBUTE_REQUIRED ), xpp, null ); } // name attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeValue != null ) { modifyRequest.addAttributeTypeAndValues( attributeValue ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that adds a Value to a Modification of a Modify Request */ private final GrammarAction modifyRequestAddValue = new GrammarAction( "Add Value to Modification of Modify Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ModifyRequestDsml modifyRequest = ( ModifyRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); // We are testing if nextText equals "" since a modification can be "". try { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { modifyRequest.addAttributeValue( ParserUtils.base64Decode( xpp, nextText.trim() ) ); } else { modifyRequest.addAttributeValue( nextText.trim() ); } } catch ( LdapException le ) { throw new XmlPullParserException( le.getMessage(), xpp, le ); } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates a Search Request */ private final GrammarAction searchRequestCreation = new GrammarAction( "Create Search Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequest = new SearchRequestDsml( codec, new SearchRequestImpl() ); container.getBatchRequest().addRequest( searchRequest ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { searchRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DN ); if ( attributeValue != null ) { try { searchRequest.setBase( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null ); } // scope attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.SCOPE ); if ( attributeValue != null ) { if ( DsmlLiterals.BASE_OBJECT.equals( attributeValue ) ) { searchRequest.setScope( SearchScope.OBJECT ); } else if ( DsmlLiterals.SINGLE_LEVEL.equals( attributeValue ) ) { searchRequest.setScope( SearchScope.ONELEVEL ); } else if ( DsmlLiterals.WHOLE_SUBTREE.equals( attributeValue ) ) { searchRequest.setScope( SearchScope.SUBTREE ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03026_UNKNOWN_SCOPE ), xpp, null ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03027_SCOPE_ATTRIBUTE_REQUIRED ), xpp, null ); } // derefAliases attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DEREF_ALIASES ); if ( attributeValue != null ) { if ( DsmlLiterals.NEVER_DEREF_ALIASES.equals( attributeValue ) ) { searchRequest.setDerefAliases( AliasDerefMode.NEVER_DEREF_ALIASES ); } else if ( DsmlLiterals.DEREF_IN_SEARCHING.equals( attributeValue ) ) { searchRequest.setDerefAliases( AliasDerefMode.DEREF_IN_SEARCHING ); } else if ( DsmlLiterals.DEREF_FINDING_BASE_OBJ.equals( attributeValue ) ) { searchRequest.setDerefAliases( AliasDerefMode.DEREF_FINDING_BASE_OBJ ); } else if ( DsmlLiterals.DEREF_ALWAYS.equals( attributeValue ) ) { searchRequest.setDerefAliases( AliasDerefMode.DEREF_ALWAYS ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03028_UNKNOWN_DEREFALIAS_VALUE ), xpp, null ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03029_DEREFALIA_ATTRIBUTE_REQUIRED ), xpp, null ); } // sizeLimit attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.SIZE_LIMIT ); if ( attributeValue != null ) { try { searchRequest.setSizeLimit( Long.parseLong( attributeValue ) ); } catch ( NumberFormatException nfe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03030_SIZE_LIMIT_NOT_INTEGER ), xpp, nfe ); } } else { searchRequest.setSizeLimit( 0L ); } // timeLimit attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.TIME_LIMIT ); if ( attributeValue != null ) { try { searchRequest.setTimeLimit( Integer.parseInt( attributeValue ) ); } catch ( NumberFormatException nfe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03031_TIME_LIMIT_NOT_INTEGER ), xpp, nfe ); } } else { searchRequest.setTimeLimit( 0 ); } // typesOnly attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.TYPES_ONLY ); if ( attributeValue != null ) { if ( ( attributeValue.equals( DsmlLiterals.TRUE ) ) || ( "1".equals( attributeValue ) ) ) { searchRequest.setTypesOnly( true ); } else if ( ( attributeValue.equals( DsmlLiterals.FALSE ) ) || ( "0".equals( attributeValue ) ) ) { searchRequest.setTypesOnly( false ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03032_TYPES_ONLY_NOT_BOOLEAN ), xpp, null ); } } else { searchRequest.setTypesOnly( false ); } } }; /** * GrammarAction that adds an Attribute to a Search Request */ private final GrammarAction searchRequestAddAttribute = new GrammarAction( "Add Value to Modification of Modify Request" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attribute name String attributeName = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeName != null ) { searchRequest.addAttributes( attributeName ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that create a Substring Filter */ private final GrammarAction substringsFilterCreation = new GrammarAction( "Create Substring Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); SubstringFilter filter = new SubstringFilter(); // Adding the filter to the Search Filter try { searchRequestDecorator.addCurrentFilter( filter ); } catch ( DecoderException de ) { throw new XmlPullParserException( de.getMessage(), xpp, de ); } searchRequestDecorator.setTerminalFilter( filter ); // Checking and adding the filter's attributes String attributeValue; // name attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeValue != null ) { filter.setType( attributeValue ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that sets the Initial value to a Substring Filter */ private final GrammarAction substringsFilterSetInitial = new GrammarAction( "Set Initial value to Substring Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); SubstringFilter substringFilter = ( SubstringFilter ) searchRequestDecorator.getTerminalFilter(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { substringFilter .setInitialSubstrings( Strings.utf8ToString( ParserUtils.base64Decode( xpp, nextText.trim() ) ) ); } else { substringFilter.setInitialSubstrings( nextText.trim() ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that adds a Any value to a Substring Filter */ private final GrammarAction substringsFilterAddAny = new GrammarAction( "Add Any value to Substring Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); SubstringFilter substringFilter = ( SubstringFilter ) searchRequestDecorator.getTerminalFilter(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { substringFilter.addAnySubstrings( Strings.utf8ToString( ParserUtils.base64Decode( xpp, nextText.trim() ) ) ); } else { substringFilter.addAnySubstrings( nextText.trim() ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that sets the Final value to a Substring Filter */ private final GrammarAction substringsFilterSetFinal = new GrammarAction( "Set Final value to Substring Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); SubstringFilter substringFilter = ( SubstringFilter ) searchRequestDecorator.getTerminalFilter(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { substringFilter .setFinalSubstrings( Strings.utf8ToString( ParserUtils.base64Decode( xpp, nextText.trim() ) ) ); } else { substringFilter.setFinalSubstrings( nextText.trim() ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that closes a Substring Filter */ private final GrammarAction substringsFilterClose = new GrammarAction( "Close Substring Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); searchRequestDecorator.setTerminalFilter( null ); } }; /** * GrammarAction that create a And Filter */ private final GrammarAction andFilterCreation = new GrammarAction( "Create And Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); AndFilter filter = new AndFilter(); // Adding the filter to the Search Filter try { searchRequestDecorator.addCurrentFilter( filter ); } catch ( DecoderException de ) { throw new XmlPullParserException( de.getMessage(), xpp, de ); } } }; /** * GrammarAction that closes a Connector Filter (And, Or, Not) */ private final GrammarAction connectorFilterClose = new GrammarAction( "Close Connector Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); searchRequestDecorator.endCurrentConnectorFilter(); } }; /** * GrammarAction that create a Or Filter */ private final GrammarAction orFilterCreation = new GrammarAction( "Create Or Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); OrFilter filter = new OrFilter(); // Adding the filter to the Search Filter try { searchRequestDecorator.addCurrentFilter( filter ); } catch ( DecoderException de ) { throw new XmlPullParserException( de.getMessage(), xpp, de ); } } }; /** * GrammarAction that create a Not Filter */ private final GrammarAction notFilterCreation = new GrammarAction( "Create Not Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); NotFilter filter = new NotFilter(); // Adding the filter to the Search Filter try { searchRequestDecorator.addCurrentFilter( filter ); } catch ( DecoderException de ) { throw new XmlPullParserException( de.getMessage(), xpp, de ); } } }; /** * GrammarAction that create a Equality Match Filter */ private final GrammarAction equalityMatchFilterCreation = new GrammarAction( "Create Equality Match Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); AttributeValueAssertion assertion = new AttributeValueAssertion(); // Checking and adding the filter's attributes String attributeName = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeName != null ) { assertion.setAttributeDesc( attributeName ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter( LdapCodecConstants.EQUALITY_MATCH_FILTER ); filter.setAssertion( assertion ); // Adding the filter to the Search Filter try { searchRequestDecorator.addCurrentFilter( filter ); } catch ( DecoderException de ) { throw new XmlPullParserException( de.getMessage(), xpp, de ); } searchRequestDecorator.setTerminalFilter( filter ); } }; /** * GrammarAction that create a Greater Or Equal Filter */ private final GrammarAction greaterOrEqualFilterCreation = new GrammarAction( "Create Greater Or Equal Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); AttributeValueAssertion assertion = new AttributeValueAssertion(); // Checking and adding the filter's attributes String attributeName = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeName != null ) { assertion.setAttributeDesc( attributeName ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter( LdapCodecConstants.GREATER_OR_EQUAL_FILTER ); filter.setAssertion( assertion ); // Adding the filter to the Search Filter try { searchRequestDecorator.addCurrentFilter( filter ); } catch ( DecoderException de ) { throw new XmlPullParserException( de.getMessage(), xpp, de ); } searchRequestDecorator.setTerminalFilter( filter ); } }; /** * GrammarAction that create a Less Or Equal Filter */ private final GrammarAction lessOrEqualFilterCreation = new GrammarAction( "Create Less Or Equal Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); AttributeValueAssertion assertion = new AttributeValueAssertion(); // Checking and adding the filter's attributes String attributeValue; // name attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeValue != null ) { assertion.setAttributeDesc( attributeValue ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter( LdapCodecConstants.LESS_OR_EQUAL_FILTER ); filter.setAssertion( assertion ); // Adding the filter to the Search Filter try { searchRequestDecorator.addCurrentFilter( filter ); } catch ( DecoderException de ) { throw new XmlPullParserException( de.getMessage(), xpp, de ); } searchRequestDecorator.setTerminalFilter( filter ); } }; /** * GrammarAction that create an Approx Match Filter */ private final GrammarAction approxMatchFilterCreation = new GrammarAction( "Create Approx Match Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); AttributeValueAssertion assertion = new AttributeValueAssertion(); // Checking and adding the filter's attributes String attributeName = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeName != null ) { assertion.setAttributeDesc( attributeName ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter( LdapCodecConstants.APPROX_MATCH_FILTER ); filter.setAssertion( assertion ); // Adding the filter to the Search Filter try { searchRequestDecorator.addCurrentFilter( filter ); } catch ( DecoderException de ) { throw new XmlPullParserException( de.getMessage(), xpp, de ); } searchRequestDecorator.setTerminalFilter( filter ); } }; /** * GrammarAction that adds a Value to a Filter */ private final GrammarAction filterAddValue = new GrammarAction( "Adds Value to Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); AttributeValueAssertionFilter filter = ( AttributeValueAssertionFilter ) searchRequestDecorator .getTerminalFilter(); AttributeValueAssertion assertion = filter.getAssertion(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { Value value = new Value( ParserUtils.base64Decode( xpp, nextText.trim() ) ); assertion.setAssertionValue( value ); } else { Value value = new Value( nextText.trim() ); assertion.setAssertionValue( value ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates a Present Filter */ private final GrammarAction presentFilterCreation = new GrammarAction( "Create Present Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { PresentFilter presentFilter = new PresentFilter(); XmlPullParser xpp = container.getParser(); // Adding the filter to the Search Filter SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); try { searchRequestDecorator.addCurrentFilter( presentFilter ); } catch ( DecoderException de ) { throw new XmlPullParserException( de.getMessage(), xpp, de ); } // Checking and adding the filter's attributes String attributeValue; // name attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeValue != null ) { presentFilter.setAttributeDescription( attributeValue ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that store the Filter into the searchRequest */ private final GrammarAction storeFilter = new GrammarAction( "Store Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { // Adding the filter to the Search Filter SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); SearchRequest searchRequest = searchRequestDecorator.getDecorated(); try { ExprNode exprNode = searchRequestDecorator.getFilterNode(); if ( exprNode == null ) { throw new IllegalStateException( I18n.err( I18n.ERR_03041_NO_FILTER_ELEMENT ) ); } searchRequest.setFilter( exprNode ); } catch ( LdapSchemaException lse ) { } } }; /** * GrammarAction that creates an Extensible Match Filter */ private final GrammarAction extensibleMatchFilterCreation = new GrammarAction( "Create Extensible Match Filter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtensibleMatchFilter extensibleMatchFilter = new ExtensibleMatchFilter(); XmlPullParser xpp = container.getParser(); // Adding the filter to the Search Filter SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); try { searchRequestDecorator.addCurrentFilter( extensibleMatchFilter ); } catch ( DecoderException de ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, de ); } searchRequestDecorator.setTerminalFilter( extensibleMatchFilter ); // Checking and adding the filter's attributes String attributeValue; // dnAttributes attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DN_ATTRIBUTES ); if ( attributeValue != null ) { if ( ( attributeValue.equals( DsmlLiterals.TRUE ) ) || ( "1".equals( attributeValue ) ) ) { extensibleMatchFilter.setDnAttributes( true ); } else if ( ( attributeValue.equals( DsmlLiterals.FALSE ) ) || ( "0".equals( attributeValue ) ) ) { extensibleMatchFilter.setDnAttributes( false ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03033_DN_ATTRIBUTES_NOT_BOOLEAN ), xpp, null ); } } else { extensibleMatchFilter.setDnAttributes( false ); } // matchingRule attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.MATCHING_RULE ); if ( attributeValue != null ) { extensibleMatchFilter.setMatchingRule( attributeValue ); } // name attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeValue != null ) { extensibleMatchFilter.setType( attributeValue ); } } }; /** * GrammarAction that adds a Value to an Extensible Match Filter */ private final GrammarAction extensibleMatchAddValue = new GrammarAction( "Adds Value to Extensible MatchFilter" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); ExtensibleMatchFilter filter = ( ExtensibleMatchFilter ) searchRequestDecorator.getTerminalFilter(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { filter.setMatchValue( new Value( ParserUtils.base64Decode( xpp, nextText.trim() ) ) ); } else { filter.setMatchValue( new Value( nextText.trim() ) ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates a Control */ private final GrammarAction controlCreation = new GrammarAction( "Create Control" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { XmlPullParser xpp = container.getParser(); Control control; // Checking and adding the Control's attributes String attributeValue; // TYPE attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.TYPE ); if ( attributeValue != null ) { if ( !Oid.isOid( attributeValue ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03034_INCORRECT_TYPE_VALUE ), xpp, null ); } ControlFactory factory = codec.getRequestControlFactories().get( attributeValue ); if ( factory == null ) { control = new OpaqueControl( attributeValue ); } else { control = factory.newControl(); } ( ( Request ) container.getBatchRequest().getCurrentRequest() ).addControl( control ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03035_TYPE_ATTRIBUTE_REQUIRED ), xpp, null ); } // CRITICALITY attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.CRITICALITY ); if ( attributeValue != null ) { if ( attributeValue.equals( DsmlLiterals.TRUE ) ) { control.setCritical( true ); } else if ( attributeValue.equals( DsmlLiterals.FALSE ) ) { control.setCritical( false ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03007_INCORRECT_CRITICALITY_VALUE ), xpp, null ); } } } }; /** * GrammarAction that adds a Value to a Control */ private final GrammarAction controlValueCreation = new GrammarAction( "Add ControlValue to Control" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { AbstractRequestDsml request = ( AbstractRequestDsml ) container.getBatchRequest().getCurrentRequest(); DsmlControl control = request.getCurrentControl(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { control.setValue( ParserUtils.base64Decode( xpp, nextText.trim() ) ); } else { control.setValue( Strings.getBytesUtf8( nextText.trim() ) ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * Creates a new instance of Dsmlv2Grammar. */ @SuppressWarnings("unchecked") public Dsmlv2Grammar() { name = Dsmlv2Grammar.class.getName(); // Create the transitions table super.transitions = ( HashMap[] ) Array.newInstance( HashMap.class, 200 ); //==================================================== // Transitions concerning : BATCH REQUEST //==================================================== super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_END_TAG.ordinal()] = new HashMap(); // ** OPEN BATCH REQUEST ** // State: [INIT_GRAMMAR_STATE] - Tag: super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE.ordinal()].put( new Tag( DsmlLiterals.BATCH_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE, Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, batchRequestCreation ) ); // ** CLOSE BATCH REQUEST ** // state: [BATCHREQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()] .put( new Tag( DsmlLiterals.BATCH_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_END_TAG, null ) ); //state: [BATCHREQUEST_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( DsmlLiterals.BATCH_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.GRAMMAR_END, null ) ); // ** ABANDON REQUEST ** // State: [BATCHREQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.ABANDON_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG, abandonRequestCreation ) ); // state: [BATCHREQUEST_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( DsmlLiterals.ABANDON_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG, abandonRequestCreation ) ); // ** ADD REQUEST ** // state: [BATCHREQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.ADD_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, addRequestCreation ) ); // state: [BATCHREQUEST_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( DsmlLiterals.ADD_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, addRequestCreation ) ); // ** AUTH REQUEST ** // state: [BATCHREQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.AUTH_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG, authRequestCreation ) ); // ** COMPARE REQUEST ** // state: [BATCHREQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.COMPARE_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG, compareRequestCreation ) ); // state: [BATCHREQUEST_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( DsmlLiterals.COMPARE_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG, compareRequestCreation ) ); // ** DEL REQUEST ** // state: [BATCHREQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.DEL_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.DEL_REQUEST_START_TAG, delRequestCreation ) ); // state: [BATCHREQUEST_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( DsmlLiterals.DEL_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.DEL_REQUEST_START_TAG, delRequestCreation ) ); // ** EXTENDED REQUEST ** // state: [BATCHREQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG, extendedRequestCreation ) ); // state: [BATCHREQUEST_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG, extendedRequestCreation ) ); // ** MOD Dn REQUEST ** // state: [BATCHREQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.MOD_DN_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, modDNRequestCreation ) ); // state: [BATCHREQUEST_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( DsmlLiterals.MOD_DN_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, modDNRequestCreation ) ); // ** MODIFY REQUEST ** // state: [BATCHREQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.MODIFY_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, modifyRequestCreation ) ); // state: [BATCHREQUEST_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( DsmlLiterals.MODIFY_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, modifyRequestCreation ) ); // ** SEARCH REQUEST ** // state: [BATCHREQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.SEARCH_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG, searchRequestCreation ) ); // state: [BATCHREQUEST_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( DsmlLiterals.SEARCH_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG, searchRequestCreation ) ); //==================================================== // Transitions concerning : ABANDON REQUEST //==================================================== super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap(); // State: [ABANDON_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG.ordinal()] .put( new Tag( DsmlLiterals.ABANDON_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [ABANDON_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG, Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [ABANDON_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); // State: [ABANDON_REQUEST_CONTROLVALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG, Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, null ) ); // State: [ABANDON_REQUEST_CONTROL_START_TAG] - Tag:
super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, null ) ); // State: [ABANDON_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [ABANDON_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ABANDON_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); //==================================================== // Transitions concerning : ADD REQUEST //==================================================== super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG.ordinal()] = new HashMap(); // state: [ADD_REQUEST_START_TAG] -> Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.ADD_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [ADD_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [ADD_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); // State: [ADD_REQUEST_CONTROLVALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG, Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, null ) ); // State: [ADD_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, null ) ); // State: [ADD_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [ADD_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ADD_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [ADD_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.ATTR, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddAttribute ) ); // State: [ADD_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ATTR, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddAttribute ) ); // State: [ADD_REQUEST_ATTR_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ATTR, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG, Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddAttribute ) ); // State: [ADD_REQUEST_ATTR_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG.ordinal()].put( new Tag( DsmlLiterals.ATTR, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG, null ) ); // State: [ADD_REQUEST_ATTR_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddValue ) ); // State: [ADD_REQUEST_ATTR_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG.ordinal()] .put( new Tag( DsmlLiterals.ADD_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); //==================================================== // Transitions concerning : AUTH REQUEST //==================================================== super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap(); // state: [AUTH_REQUEST_START_TAG] -> Tag: super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.AUTH_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [AUTH_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG, Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [AUTH_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); // State: [AUTH_REQUEST_CONTROLVALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG, Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, null ) ); // State: [AUTH_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, null ) ); // State: [AUTH_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [AUTH_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.AUTH_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); //==================================================== // Transitions concerning : COMPARE REQUEST //==================================================== super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG.ordinal()] = new HashMap(); // State: [COMPARE_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [COMPARE_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); // State: [COMPARE_REQUEST_CONTROLVALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, null ) ); // State: [COMPARE_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, null ) ); // State: [COMPARE_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [COMPARE_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.COMPARE_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [COMPARE_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.ASSERTION, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG, compareRequestAddAssertion ) ); // State: [COMPARE_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ASSERTION, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG, compareRequestAddAssertion ) ); // State: [COMPARE_REQUEST_ASSERTION_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG, compareRequestAddValue ) ); //State: [COMPARE_REQUEST_VALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ASSERTION, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG, null ) ); // State: [COMPARE_REQUEST_ASSERTION_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG.ordinal()].put( new Tag( DsmlLiterals.COMPARE_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); //==================================================== // Transitions concerning : DEL REQUEST //==================================================== super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap(); // State: [DEL_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.DEL_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [DEL_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_START_TAG, Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [DEL_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); // State: [DEL_REQUEST_CONTROLVALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG, Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, null ) ); // State: [DEL_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, null ) ); // State: [DEL_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [DEL_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.DEL_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); //==================================================== // Transitions concerning : EXTENDED REQUEST //==================================================== super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG.ordinal()] = new HashMap(); // State: [EXTENDED_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG, Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [EXTENDED_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); // State: [EXTENDED_REQUEST_CONTROLVALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG, Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, null ) ); // State: [EXTENDED_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, null ) ); // State: [EXTENDED_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [EXTENDED_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [EXTENDED_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.REQUEST_NAME, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG, Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, extendedRequestAddName ) ); // State: [EXTENDED_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.REQUEST_NAME, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, extendedRequestAddName ) ); // State: [EXTENDED_REQUEST_REQUESTNAME_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [EXTENDED_REQUEST_REQUESTNAME_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG.ordinal()].put( new Tag( DsmlLiterals.REQUEST_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG, extendedRequestAddValue ) ); // State: [EXTENDED_REQUEST_REQUESTVALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); //==================================================== // Transitions concerning : MODIFY Dn REQUEST //==================================================== super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap(); // State: [MODIFY_DN_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.MOD_DN_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [MODIFY_DN_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [MODIFY_DN_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); // State: [MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG, Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, null ) ); // State: [MODIFY_DN_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, null ) ); // State: [MODIFY_DN_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [MODIFY_DN_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.MOD_DN_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); //==================================================== // Transitions concerning : MODIFY REQUEST //==================================================== super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG.ordinal()] = new HashMap(); // State: [MODIFY_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG.ordinal()] .put( new Tag( DsmlLiterals.MODIFY_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [MODIFY_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [MODIFY_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); // State: [MODIFY_REQUEST_CONTROLVALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, null ) ); // State: [MODIFY_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, null ) ); // State: [MODIFY_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [MODIFY_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.MODIFY_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); // State: [MODIFY_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.MODIFICATION, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) ); // State: [MODIFY_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.MODIFICATION, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) ); // State: [MODIFY_REQUEST_MODIFICATION_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG.ordinal()].put( new Tag( DsmlLiterals.MODIFICATION, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) ); // State: [MODIFY_REQUEST_MODIFICATION_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG.ordinal()].put( new Tag( DsmlLiterals.MODIFICATION, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, null ) ); // State: [MODIFY_REQUEST_MODIFICATION_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, modifyRequestAddValue ) ); // State: [MODIFY_REQUEST_VALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, modifyRequestAddValue ) ); // State: [MODIFY_REQUEST_VALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.MODIFICATION, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, null ) ); // State: [MODIFY_REQUEST_MODIFICATION_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG.ordinal()].put( new Tag( DsmlLiterals.MODIFY_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) ); //==================================================== // Transitions concerning : SEARCH REQUEST //==================================================== super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG.ordinal()] = new HashMap(); // State: [SEARCH_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [SEARCH_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) ); // State: [SEARCH_REQUEST_CONTROLVALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, null ) ); // State: [SEARCH_REQUEST_CONTROL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, null ) ); // State: [SEARCH_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, controlCreation ) ); // State: [SEARCH_REQUEST_FILTER_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.SEARCH_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, storeFilter ) ); // State: [SEARCH_REQUEST_ATTRIBUTES_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG.ordinal()].put( new Tag( DsmlLiterals.ATTRIBUTES, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG, null ) ); // State: [SEARCH_REQUEST_ATTRIBUTES_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG.ordinal()].put( new Tag( DsmlLiterals.ATTRIBUTE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG, searchRequestAddAttribute ) ); // State: [SEARCH_REQUEST_ATTRIBUTE_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG.ordinal()].put( new Tag( DsmlLiterals.ATTRIBUTE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG, null ) ); // State: [SEARCH_REQUEST_ATTRIBUTE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ATTRIBUTE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG, searchRequestAddAttribute ) ); // State: [SEARCH_REQUEST_ATTRIBUTE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ATTRIBUTES, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG, null ) ); // State: [SEARCH_REQUEST_ATTRIBUTES_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG.ordinal()].put( new Tag( DsmlLiterals.SEARCH_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, storeFilter ) ); //==================================================== // Transitions concerning : FILTER //==================================================== super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG.ordinal()] = new HashMap(); // State: [SEARCH_REQUEST_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG.ordinal()].put( new Tag( DsmlLiterals.FILTER, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, null ) ); // State: [SEARCH_REQUEST_CONTROL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.FILTER, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, null ) ); //*** AND *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( DsmlLiterals.AND, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, andFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.AND, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, andFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.AND, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) ); //*** OR *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( DsmlLiterals.OR, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, orFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.OR, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, orFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.OR, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) ); //*** NOT *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( DsmlLiterals.NOT, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, notFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.NOT, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, notFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.NOT, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) ); //*** DsmlLiterals.SUBSTRINGS *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( DsmlLiterals.SUBSTRINGS, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, substringsFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.SUBSTRINGS, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, substringsFilterCreation ) ); //*** EQUALITY MATCH *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( DsmlLiterals.EQUALITY_MATCH, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG, equalityMatchFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.EQUALITY_MATCH, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG, equalityMatchFilterCreation ) ); // State: [SEARCH_REQUEST_EQUALITYMATCH_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) ); // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.EQUALITY_MATCH, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); //*** GREATER OR EQUAL *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( DsmlLiterals.GREATER_OR_EQUAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG, greaterOrEqualFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.GREATER_OR_EQUAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG, greaterOrEqualFilterCreation ) ); // State: [SEARCH_REQUEST_GREATEROREQUAL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) ); // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.GREATER_OR_EQUAL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); //*** LESS OR EQUAL *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( DsmlLiterals.LESS_OR_EQUAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG, lessOrEqualFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.LESS_OR_EQUAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG, lessOrEqualFilterCreation ) ); // State: [SEARCH_REQUEST_LESSOREQUAL_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) ); // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.LESS_OR_EQUAL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); //*** LESS OR EQUAL *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( DsmlLiterals.APPROX_MATCH, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG, approxMatchFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.APPROX_MATCH, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG, approxMatchFilterCreation ) ); // State: [SEARCH_REQUEST_APPROXMATCH_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) ); // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.APPROX_MATCH, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); //*** PRESENT *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( DsmlLiterals.PRESENT, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG, presentFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.PRESENT, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG, presentFilterCreation ) ); // State: [SEARCH_REQUEST_PRESENT_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG.ordinal()].put( new Tag( DsmlLiterals.PRESENT, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); //*** EXTENSIBLE MATCH *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( DsmlLiterals.EXTENSIBLE_MATCH, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, extensibleMatchFilterCreation ) ); // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.EXTENSIBLE_MATCH, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, extensibleMatchFilterCreation ) ); // State: [SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG, extensibleMatchAddValue ) ); // State: [SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG.ordinal()].put( new Tag( DsmlLiterals.EXTENSIBLE_MATCH, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); //*** Filter (end) *** // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( DsmlLiterals.FILTER, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG, null ) ); // State: [SEARCH_REQUEST_FILTER_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ATTRIBUTES, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG, null ) ); // State: [SEARCH_REQUEST_FILTER_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG.ordinal()].put( new Tag( DsmlLiterals.SEARCH_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, storeFilter ) ); //==================================================== // Transitions concerning : SUBSTRING FILTER //==================================================== super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_END_TAG.ordinal()] = new HashMap(); // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG.ordinal()].put( new Tag( DsmlLiterals.SUBSTRINGS, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) ); // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG.ordinal()].put( new Tag( DsmlLiterals.INITIAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG, substringsFilterSetInitial ) ); // State: [SEARCH_REQUEST_INITIAL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ANY, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) ); // State: [SEARCH_REQUEST_INITIAL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.FINAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) ); // State: [SEARCH_REQUEST_INITIAL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.SUBSTRINGS, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) ); // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG.ordinal()].put( new Tag( DsmlLiterals.ANY, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) ); // State: [SEARCH_REQUEST_ANY_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG.ordinal()].put( new Tag( DsmlLiterals.ANY, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) ); // State: [SEARCH_REQUEST_ANY_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG.ordinal()].put( new Tag( DsmlLiterals.FINAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) ); // State: [SEARCH_REQUEST_ANY_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG.ordinal()].put( new Tag( DsmlLiterals.SUBSTRINGS, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) ); // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG.ordinal()].put( new Tag( DsmlLiterals.FINAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) ); // State: [SEARCH_REQUEST_FINAL_END_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG.ordinal()].put( new Tag( DsmlLiterals.SUBSTRINGS, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) ); //------------------------------------------ handle SOAP envelopes -------------------------- super.transitions[Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SOAP_BODY_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SOAP_BODY_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()] = new HashMap(); // State: [INIT_GRAMMAR_STATE] - Tag: super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE.ordinal()].put( new Tag( DsmlLiterals.ENVELOPE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE, Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG, null ) ); // state: [SOAP_ENVELOPE_START_TAG] -> Tag:
super.transitions[Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG.ordinal()].put( new Tag( DsmlLiterals.HEADER, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG, Dsmlv2StatesEnum.SOAP_HEADER_START_TAG, ParserUtils.READ_SOAP_HEADER ) ); // state: [SOAP_HEADER_START_TAG] -> Tag:
super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_START_TAG.ordinal()] .put( new Tag( DsmlLiterals.HEADER, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SOAP_HEADER_START_TAG, Dsmlv2StatesEnum.SOAP_HEADER_END_TAG, null ) ); // state: [SOAP_HEADER_END_TAG] -> Tag: super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_END_TAG.ordinal()].put( new Tag( DsmlLiterals.BODY, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SOAP_HEADER_END_TAG, Dsmlv2StatesEnum.SOAP_BODY_START_TAG, null ) ); // state: [SOAP_BODY_START_TAG] -> Tag: super.transitions[Dsmlv2StatesEnum.SOAP_BODY_START_TAG.ordinal()].put( new Tag( DsmlLiterals.BATCH_REQUEST, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SOAP_BODY_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, batchRequestCreation ) ); // the optional transition if no soap header is present // state: [SOAP_ENVELOPE_START_TAG] -> Tag: super.transitions[Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG.ordinal()] .put( new Tag( DsmlLiterals.BODY, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG, Dsmlv2StatesEnum.SOAP_BODY_START_TAG, null ) ); // the below two transitions are a bit unconventional, technically the container's state is set to GRAMMAR_END // when the tag is encountered by the parser and the corresponding action gets executed but in // a SOAP envelop we still have two more end tags( and
) are left so we set those corresponding // current and next transition states always to GRAMMAR_END super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()].put( new Tag( DsmlLiterals.BODY, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.GRAMMAR_END, Dsmlv2StatesEnum.GRAMMAR_END, null ) ); super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()].put( new Tag( DsmlLiterals.ENVELOPE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.GRAMMAR_END, Dsmlv2StatesEnum.GRAMMAR_END, null ) ); //------------------------------------------ } // End of the constructor /** * Get the LdapApiService instance * * @return The LDAP codec service. */ public LdapApiService getLdapCodecService() { return codec; } } ExtendedRequestDsml.java000066400000000000000000000123561525525160600403640ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.asn1.util.Oid; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.ExtendedRequest; import org.apache.directory.api.ldap.model.message.ExtendedResponse; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.dom4j.Element; import org.dom4j.Namespace; import org.dom4j.QName; /** * DSML Decorator for ExtendedRequest * * @param The extended request type * @param

The extended response type * * @author Apache Directory Project */ public class ExtendedRequestDsml extends AbstractResultResponseRequestDsml implements ExtendedRequest { private byte[] requestValue; /** * Creates a new getDecoratedMessage() of ExtendedRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public ExtendedRequestDsml( LdapApiService codec, Q ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element = super.toDsml( root ); // Request Name if ( getDecorated().getRequestName() != null ) { element.addElement( DsmlLiterals.REQUEST_NAME ).setText( getDecorated().getRequestName() ); } // Request Value Namespace xsdNamespace = new Namespace( ParserUtils.XSD, ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( ParserUtils.XSI, ParserUtils.XML_SCHEMA_INSTANCE_URI ); element.getDocument().getRootElement().add( xsdNamespace ); element.getDocument().getRootElement().add( xsiNamespace ); Element valueElement = element.addElement( DsmlLiterals.REQUEST_VALUE ).addText( ParserUtils.base64Encode( getRequestValue() ) ); valueElement.addAttribute( new QName( DsmlLiterals.TYPE, xsiNamespace ), ParserUtils.XSD_COLON + ParserUtils.BASE64BINARY ); return element; } /** * Get the extended request name * * @return Returns the request name. */ @Override public String getRequestName() { return getDecorated().getRequestName(); } /** * Set the extended request name * * @param requestName The request name to set. */ public void setRequestName( Oid requestName ) { getDecorated().setRequestName( requestName.toString() ); } /** * Get the extended request value * * @return Returns the request value. */ public byte[] getRequestValue() { return this.requestValue; } /** * Set the extended request value * * @param requestValue The request value to set. */ public void setRequestValue( byte[] requestValue ) { this.requestValue = requestValue; } /** * {@inheritDoc} */ @Override public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ @Override public ExtendedRequest setRequestName( String oid ) { getDecorated().setRequestName( oid ); return this; } /** * {@inheritDoc} */ @Override public ExtendedRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ @Override public ExtendedRequest addControl( Control control ) { return ( ExtendedRequest ) super.addControl( control ); } /** * {@inheritDoc} */ @Override public ExtendedRequest addAllControls( Control[] controls ) { return ( ExtendedRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ @Override public ExtendedRequest removeControl( Control control ) { return ( ExtendedRequest ) super.removeControl( control ); } } ExtensibleMatchFilter.java000066400000000000000000000072221525525160600406540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.ldap.model.entry.Value; /** * The search request filter Matching Rule assertion * * @author Apache Directory Project */ public class ExtensibleMatchFilter extends Filter { /** Matching rule */ private String matchingRule; /** Matching rule type */ private String type; /** Matching rule value */ private org.apache.directory.api.ldap.model.entry.Value matchValue; /** The dnAttributes flag */ private boolean dnAttributes = false; /** * Default constructor */ public ExtensibleMatchFilter() { super(); } /** * Get the dnAttributes flag * * @return Returns the dnAttributes. */ public boolean isDnAttributes() { return dnAttributes; } /** * Set the dnAttributes flag * * @param dnAttributes The dnAttributes to set. */ public void setDnAttributes( boolean dnAttributes ) { this.dnAttributes = dnAttributes; } /** * Get the matchingRule * * @return Returns the matchingRule. */ public String getMatchingRule() { return matchingRule; } /** * Set the matchingRule * * @param matchingRule The matchingRule to set. */ public void setMatchingRule( String matchingRule ) { this.matchingRule = matchingRule; } /** * Get the matchValue * * @return Returns the matchValue. */ public Value getMatchValue() { return matchValue; } /** * Set the matchValue * * @param matchValue The matchValue to set. */ public void setMatchValue( Value matchValue ) { this.matchValue = matchValue; } /** * Get the type * * @return Returns the type. */ public String getType() { return type; } /** * Set the type * * @param type The type to set. */ public void setType( String type ) { this.type = type; } /** * Return a String representing an extended filter as of RFC 2254 * * @return An Extened Filter String */ @Override public String toString() { StringBuilder sb = new StringBuilder(); if ( type != null ) { sb.append( type ); } if ( dnAttributes ) { sb.append( ":dn" ); } if ( matchingRule == null ) { if ( type == null ) { return "Extended Filter wrong syntax"; } } else { sb.append( ':' ).append( matchingRule ); } sb.append( ":=" ).append( matchValue ); return sb.toString(); } } Filter.java000066400000000000000000000031671525525160600356600ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; /** * An abstract Asn1Object used to store the filter. A filter is seen as a tree * with a root. This class does nothing, it's just the root of all the different * filters. * * @author Apache Directory Project */ public class Filter { /** The parent Filter */ protected Filter parent; /** * Default constructor */ public Filter() { // Nothing to do } /** * Get the parent * * @return Returns the parent. */ public Filter getParent() { return parent; } /** * Set the parent * * @param parent The parent to set. */ public void setParent( Filter parent ) { this.parent = parent; } } ModifyDNRequestDsml.java000066400000000000000000000142431525525160600402720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.ModifyDnRequest; import org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl; import org.apache.directory.api.ldap.model.message.ModifyDnResponse; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.ldap.model.name.Rdn; import org.dom4j.Element; /** * DSML Decorator for ModifyDNRequest * * @author Apache Directory Project */ public class ModifyDNRequestDsml extends AbstractResultResponseRequestDsml implements ModifyDnRequest { /** * Creates a new getDecoratedMessage() of ModifyDNRequestDsml. * * @param codec The LDAP Service to use */ public ModifyDNRequestDsml( LdapApiService codec ) { super( codec, new ModifyDnRequestImpl() ); } /** * Creates a new getDecoratedMessage() of ModifyDNRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public ModifyDNRequestDsml( LdapApiService codec, ModifyDnRequest ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element = super.toDsml( root ); ModifyDnRequest request = getDecorated(); // Dn if ( request.getName() != null ) { element.addAttribute( DsmlLiterals.DN, request.getName().getName() ); } // NewRDN if ( request.getNewRdn() != null ) { element.addAttribute( DsmlLiterals.NEW_RDN, request.getNewRdn().getName() ); } // DeleteOldRDN element.addAttribute( DsmlLiterals.DELETE_OLD_RDN, request.getDeleteOldRdn() ? DsmlLiterals.TRUE : DsmlLiterals.FALSE ); // NewSuperior if ( request.getNewRdn() != null ) { element.addAttribute( DsmlLiterals.NEW_SUPERIOR, request.getNewSuperior().getName() ); } return element; } /** * Get the modification's Dn * * @return Returns the name. */ @Override public Dn getName() { return getDecorated().getName(); } /** * Set the modification Dn. * * @param name The name to set. */ public void setEntry( Dn name ) { getDecorated().setName( name ); } /** * Tells if the old Rdn is to be deleted * * @return Returns the deleteOldRDN. */ public boolean isDeleteOldRDN() { return getDecorated().getDeleteOldRdn(); } /** * Get the newSuperior * * @return Returns the newSuperior. */ @Override public Dn getNewSuperior() { return getDecorated().getNewSuperior(); } /** * Set the new superior * * @param newSuperior The newSuperior to set. */ @Override public ModifyDnRequest setNewSuperior( Dn newSuperior ) { getDecorated().setNewSuperior( newSuperior ); return this; } /** * {@inheritDoc} */ @Override public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ @Override public ModifyDnRequest setName( Dn name ) { getDecorated().setName( name ); return this; } /** * {@inheritDoc} */ @Override public Rdn getNewRdn() { return getDecorated().getNewRdn(); } /** * {@inheritDoc} */ @Override public ModifyDnRequest setNewRdn( Rdn newRdn ) { getDecorated().setNewRdn( newRdn ); return this; } /** * {@inheritDoc} */ @Override public boolean getDeleteOldRdn() { return getDecorated().getDeleteOldRdn(); } /** * {@inheritDoc} */ @Override public ModifyDnRequest setDeleteOldRdn( boolean deleteOldRdn ) { getDecorated().setDeleteOldRdn( deleteOldRdn ); return this; } /** * {@inheritDoc} */ @Override public boolean isMove() { return getDecorated().isMove(); } /** * {@inheritDoc} */ @Override public ModifyDnRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ @Override public ModifyDnRequest addControl( Control control ) { return ( ModifyDnRequest ) super.addControl( control ); } /** * {@inheritDoc} */ @Override public ModifyDnRequest addAllControls( Control[] controls ) { return ( ModifyDnRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ @Override public ModifyDnRequest removeControl( Control control ) { return ( ModifyDnRequest ) super.removeControl( control ); } } ModifyRequestDsml.java000066400000000000000000000304771525525160600400570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import java.util.Collection; import org.apache.commons.text.StringEscapeUtils; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.entry.Attribute; import org.apache.directory.api.ldap.model.entry.DefaultAttribute; import org.apache.directory.api.ldap.model.entry.DefaultModification; import org.apache.directory.api.ldap.model.entry.Modification; import org.apache.directory.api.ldap.model.entry.ModificationOperation; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.ModifyRequest; import org.apache.directory.api.ldap.model.message.ModifyRequestImpl; import org.apache.directory.api.ldap.model.message.ModifyResponse; import org.apache.directory.api.ldap.model.name.Dn; import org.dom4j.Element; import org.dom4j.Namespace; import org.dom4j.QName; /** * DSML Decorator for ModifyRequest * * @author Apache Directory Project */ public class ModifyRequestDsml extends AbstractResultResponseRequestDsml implements ModifyRequest { /** The current attribute being decoded */ private Attribute currentAttribute; /** A local storage for the operation */ private ModificationOperation currentOperation; /** * Creates a new getDecoratedMessage() of ModifyRequestDsml. * * @param codec The LDAP Service to use */ public ModifyRequestDsml( LdapApiService codec ) { super( codec, new ModifyRequestImpl() ); } /** * Creates a new getDecoratedMessage() of ModifyRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public ModifyRequestDsml( LdapApiService codec, ModifyRequest ldapMessage ) { super( codec, ldapMessage ); } /** * Get the cirrent attribute's type * * @return the current attribute's type */ public String getCurrentAttributeType() { return currentAttribute.getId(); } /** * Store the current operation * * @param currentOperation The currentOperation to set. */ public void setCurrentOperation( int currentOperation ) { this.currentOperation = ModificationOperation.getOperation( currentOperation ); } /** * Add a new attributeTypeAndValue * * @param type The attribute's name */ public void addAttributeTypeAndValues( String type ) { currentAttribute = new DefaultAttribute( type ); Modification modification = new DefaultModification( currentOperation, currentAttribute ); getDecorated().addModification( modification ); } /** * Add a new value to the current attribute * * @param value The value to add * @throws LdapException If we can't add a value */ public void addAttributeValue( byte[] value ) throws LdapException { currentAttribute.add( value ); } /** * Add a new value to the current attribute * * @param value The value to add * @throws LdapException If we can't add a value */ public void addAttributeValue( String value ) throws LdapException { currentAttribute.add( value ); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element = super.toDsml( root ); ModifyRequest request = getDecorated(); // Dn if ( request.getName() != null ) { element.addAttribute( DsmlLiterals.DN, request.getName().getName() ); } // Modifications Collection modifications = request.getModifications(); for ( Modification modification : modifications ) { Element modElement = element.addElement( DsmlLiterals.MODIFICATION ); if ( modification.getAttribute() != null ) { modElement.addAttribute( DsmlLiterals.NAME, modification.getAttribute().getId() ); for ( Value value : modification.getAttribute() ) { if ( value.isHumanReadable() ) { modElement.addElement( DsmlLiterals.VALUE ).setText( StringEscapeUtils.escapeXml11( value.getString() ) ); } else { Namespace xsdNamespace = new Namespace( ParserUtils.XSD, ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( ParserUtils.XSI, ParserUtils.XML_SCHEMA_INSTANCE_URI ); element.getDocument().getRootElement().add( xsdNamespace ); element.getDocument().getRootElement().add( xsiNamespace ); Element valueElement = modElement.addElement( DsmlLiterals.VALUE ).addText( ParserUtils.base64Encode( value.getString() ) ); valueElement.addAttribute( new QName( DsmlLiterals.TYPE, xsiNamespace ), ParserUtils.XSD_COLON + ParserUtils.BASE64BINARY ); } } } ModificationOperation operation = modification.getOperation(); if ( operation == ModificationOperation.ADD_ATTRIBUTE ) { modElement.addAttribute( DsmlLiterals.OPERATION, DsmlLiterals.ADD ); } else if ( operation == ModificationOperation.REPLACE_ATTRIBUTE ) { modElement.addAttribute( DsmlLiterals.OPERATION, DsmlLiterals.REPLACE ); } else if ( operation == ModificationOperation.REMOVE_ATTRIBUTE ) { modElement.addAttribute( DsmlLiterals.OPERATION, DsmlLiterals.DELETE ); } else if ( operation == ModificationOperation.INCREMENT_ATTRIBUTE ) { modElement.addAttribute( DsmlLiterals.OPERATION, DsmlLiterals.INCREMENT ); } } return element; } //------------------------------------------------------------------------- // The ModifyRequest methods //------------------------------------------------------------------------- /** * {@inheritDoc} */ @Override public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ @Override public Dn getName() { return getDecorated().getName(); } /** * {@inheritDoc} */ @Override public ModifyRequest setName( Dn name ) { getDecorated().setName( name ); return this; } /** * {@inheritDoc} */ @Override public Collection getModifications() { return getDecorated().getModifications(); } /** * {@inheritDoc} */ @Override public ModifyRequest addModification( Modification mod ) { getDecorated().addModification( mod ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest removeModification( Modification mod ) { getDecorated().removeModification( mod ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest remove( String attributeName, String... attributeValue ) { getDecorated().remove( attributeName, attributeValue ); return this; } /** * {@inheritDoc} */ public ModifyRequest remove( String attributeName, byte[]... attributeValue ) { getDecorated().remove( attributeName, attributeValue ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest remove( Attribute attr ) { getDecorated().remove( attr ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest remove( String attributeName ) { getDecorated().remove( attributeName ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest addModification( Attribute attr, ModificationOperation modOp ) { getDecorated().addModification( attr, modOp ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest add( String attributeName, String... attributeValue ) { getDecorated().add( attributeName, attributeValue ); return this; } /** * {@inheritDoc} */ public ModifyRequest add( String attributeName, byte[]... attributeValue ) { getDecorated().add( attributeName, attributeValue ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest add( Attribute attr ) { getDecorated().add( attr ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest replace( String attributeName ) { getDecorated().replace( attributeName ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest replace( String attributeName, String... attributeValue ) { getDecorated().replace( attributeName, attributeValue ); return this; } /** * {@inheritDoc} */ public ModifyRequest replace( String attributeName, byte[]... attributeValue ) { getDecorated().replace( attributeName, attributeValue ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest replace( Attribute attr ) { getDecorated().replace( attr ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest increment( Attribute attributeName ) { getDecorated().increment( attributeName ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest increment( Attribute attributeName, int increment ) { getDecorated().increment( attributeName, increment ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest increment( String attr ) { getDecorated().increment( attr ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest increment( String attr, int increment ) { getDecorated().increment( attr, increment ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ @Override public ModifyRequest addControl( Control control ) { return ( ModifyRequest ) super.addControl( control ); } /** * {@inheritDoc} */ @Override public ModifyRequest addAllControls( Control[] controls ) { return ( ModifyRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ @Override public ModifyRequest removeControl( Control control ) { return ( ModifyRequest ) super.removeControl( control ); } } NotFilter.java000066400000000000000000000051631525525160600363370ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.i18n.I18n; /** * Not Filter Object to store the Not filter. * * @author Apache Directory Project */ public class NotFilter extends ConnectorFilter { /** * Default constructor */ public NotFilter() { super(); } /** * Subclass the addFilterMethod, as this is specific for a NotFilter (we * cannot have more than one elements). * * @param filter The Filter to add */ @Override public void addFilter( Filter filter ) throws DecoderException { if ( filterSet != null ) { throw new DecoderException( I18n.err( I18n.ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER ) ); } super.addFilter( filter ); } /** * Get the NotFilter * * @return Returns the notFilter. */ public Filter getNotFilter() { return filterSet.get( 0 ); } /** * Set the NotFilter * * @param notFilter The notFilter to set. * @throws DecoderException If the filter is invalid */ public void setNotFilter( Filter notFilter ) throws DecoderException { if ( filterSet != null ) { throw new DecoderException( I18n.err( I18n.ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER ) ); } super.addFilter( notFilter ); } /** * Return a string compliant with RFC 2254 representing a NOT filter * * @return The NOT filter string */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( '!' ).append( super.toString() ); return sb.toString(); } } OrFilter.java000066400000000000000000000032171525525160600361550ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import java.util.List; /** * Or Filter Object to store the Or filter. * * @author Apache Directory Project */ public class OrFilter extends ConnectorFilter { /** * Default constructor */ public OrFilter() { super(); } /** * Get the OrFilter * * @return Returns the orFilter. */ public List getOrFilter() { return filterSet; } /** * Return a string compliant with RFC 2254 representing an OR filter * * @return The OR filter string */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( '|' ).append( super.toString() ); return sb.toString(); } } PresentFilter.java000066400000000000000000000040341525525160600372130ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; /** * Object to store the filter. A filter is seen as a tree with a root. * * @author Apache Directory Project */ public class PresentFilter extends Filter { /** The attribute description. */ private String attributeDescription; /** * Default constructor */ public PresentFilter() { super(); } /** * Get the attribute * * @return Returns the attributeDescription. */ public String getAttributeDescription() { return attributeDescription; } /** * Set the attributeDescription * * @param attributeDescription The attributeDescription to set. */ public void setAttributeDescription( String attributeDescription ) { this.attributeDescription = attributeDescription; } /** * Return a string compliant with RFC 2254 representing a Present filter * * @return The Present filter string */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( attributeDescription ).append( "=*" ); return sb.toString(); } } SearchRequestDsml.java000066400000000000000000000701361525525160600400310ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import java.util.ArrayList; import java.util.List; import org.apache.commons.text.StringEscapeUtils; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.codec.api.LdapCodecConstants; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.exception.LdapSchemaException; import org.apache.directory.api.ldap.model.filter.AndNode; import org.apache.directory.api.ldap.model.filter.ApproximateNode; import org.apache.directory.api.ldap.model.filter.BranchNode; import org.apache.directory.api.ldap.model.filter.EqualityNode; import org.apache.directory.api.ldap.model.filter.ExprNode; import org.apache.directory.api.ldap.model.filter.ExtensibleNode; import org.apache.directory.api.ldap.model.filter.GreaterEqNode; import org.apache.directory.api.ldap.model.filter.LeafNode; import org.apache.directory.api.ldap.model.filter.LessEqNode; import org.apache.directory.api.ldap.model.filter.NotNode; import org.apache.directory.api.ldap.model.filter.OrNode; import org.apache.directory.api.ldap.model.filter.PresenceNode; import org.apache.directory.api.ldap.model.filter.SimpleNode; import org.apache.directory.api.ldap.model.filter.SubstringNode; import org.apache.directory.api.ldap.model.message.AliasDerefMode; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.SearchRequest; import org.apache.directory.api.ldap.model.message.SearchRequestImpl; import org.apache.directory.api.ldap.model.message.SearchResultDone; import org.apache.directory.api.ldap.model.message.SearchScope; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.util.Strings; import org.dom4j.Element; import org.dom4j.Namespace; import org.dom4j.QName; /** * DSML Decorator for SearchRequest * * @author Apache Directory Project */ public class SearchRequestDsml extends AbstractResultResponseRequestDsml implements SearchRequest { /** A temporary storage for a terminal Filter */ private Filter terminalFilter; /** The current filter. This is used while decoding a PDU */ private Filter currentFilter; /** The global filter. This is used while decoding a PDU */ private Filter topFilter; /** * The default maximum depth accepted for nested filter elements : 128. * The nesting depth is fully driven by the incoming DSML document, and * the recursive transform() consumes one stack frame per level, so an * unbounded depth lets a document of nested <not>/<and> * elements throw a StackOverflowError while it is parsed. */ public static final int DEFAULT_MAX_FILTER_DEPTH = 128; /** The maximum accepted depth for nested filter elements. Defaults to {@link #DEFAULT_MAX_FILTER_DEPTH} */ private int maxFilterDepth = DEFAULT_MAX_FILTER_DEPTH; /** * Creates a new getDecoratedMessage() of SearchRequestDsml. * * @param codec The LDAP Service to use */ public SearchRequestDsml( LdapApiService codec ) { super( codec, new SearchRequestImpl() ); } /** * Creates a new getDecoratedMessage() of SearchRequestDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public SearchRequestDsml( LdapApiService codec, SearchRequest ldapMessage ) { super( codec, ldapMessage ); } /** * Gets the search filter associated with this search request. * * @return the expression node for the root of the filter expression tree. */ public Filter getCodecFilter() { return topFilter; } /** * Gets the search filter associated with this search request. * * @return the expression node for the root of the filter expression tree. * @throws LdapSchemaException If the filter is invalid */ public ExprNode getFilterNode() throws LdapSchemaException { return transform( topFilter ); } /** * Get the terminal filter * * @return Returns the terminal filter. */ public Filter getTerminalFilter() { return terminalFilter; } /** * Set the terminal filter * * @param terminalFilter the teminalFilter. */ public void setTerminalFilter( Filter terminalFilter ) { this.terminalFilter = terminalFilter; } /** * set the currentFilter to its parent */ public void endCurrentConnectorFilter() { currentFilter = currentFilter.getParent(); } /** * Add a current filter. We have two cases : *

    *
  • there is no previous current filter : the filter * is the top level filter
  • *
  • there is a previous current filter : the filter is added * to the currentFilter set, and the current filter is changed
  • *
* In any case, the previous current filter will always be a * ConnectorFilter when this method is called. * * @param localFilter The filter to set. * @throws DecoderException If the added filter is invalid */ public void addCurrentFilter( Filter localFilter ) throws DecoderException { if ( currentFilter != null ) { // Guard against StackOverflowError : the nesting depth of the filter // is driven by the incoming document, so it has to be bounded before // we accept one more level. int depth = 0; for ( Filter ancestor = currentFilter; ancestor != null; ancestor = ancestor.getParent() ) { depth++; if ( depth >= maxFilterDepth ) { String message = I18n.err( I18n.ERR_03048_FILTER_TOO_DEEP, maxFilterDepth ); LOG_DSML.error( message ); throw new DecoderException( message ); } } // Ok, we have a parent. The new Filter will be added to // this parent, and will become the currentFilter if it's a connector. ( ( ConnectorFilter ) currentFilter ).addFilter( localFilter ); localFilter.setParent( currentFilter ); if ( localFilter instanceof ConnectorFilter ) { currentFilter = localFilter; } } else { // No parent. This Filter will become the root. currentFilter = localFilter; currentFilter.setParent( null ); topFilter = localFilter; } } /** * Get the maximum accepted depth for nested filter elements * * @return the maximum accepted depth */ public int getMaxFilterDepth() { return maxFilterDepth; } /** * Set the maximum accepted depth for nested filter elements. It defaults to * {@link #DEFAULT_MAX_FILTER_DEPTH} : the depth is driven by the incoming * document and each level consumes one stack frame while the filter is * transformed, so only raise it if deeper filters really are expected. * * @param maxFilterDepth the maximum accepted depth */ public void setMaxFilterDepth( int maxFilterDepth ) { this.maxFilterDepth = maxFilterDepth; } /** * Transform the Filter part of a SearchRequest to an ExprNode * * @param filter The filter to be transformed * @return An ExprNode * @throws LdapSchemaException If the filter contains a wrong schema element */ @SuppressWarnings({ "rawtypes" }) private ExprNode transform( Filter filter ) throws LdapSchemaException { if ( filter != null ) { // Transform OR, AND or NOT leaves if ( filter instanceof ConnectorFilter ) { BranchNode branch; if ( filter instanceof AndFilter ) { branch = new AndNode(); } else if ( filter instanceof OrFilter ) { branch = new OrNode(); } else { branch = new NotNode(); } List filtersSet = ( ( ConnectorFilter ) filter ).getFilterSet(); // Loop on all AND/OR children if ( filtersSet != null ) { for ( Filter node : filtersSet ) { branch.addNode( transform( node ) ); } } return branch; } else { // Transform PRESENT or ATTRIBUTE_VALUE_ASSERTION LeafNode branch = null; if ( filter instanceof PresentFilter ) { branch = new PresenceNode( ( ( PresentFilter ) filter ).getAttributeDescription() ); } else if ( filter instanceof AttributeValueAssertionFilter ) { AttributeValueAssertionFilter avaFilter = ( AttributeValueAssertionFilter ) filter; AttributeValueAssertion ava = avaFilter.getAssertion(); // Transform =, >=, <=, ~= filters int filterType = avaFilter.getFilterType(); byte[] value = null; if ( ava.getAssertionValue() != null ) { value = ava.getAssertionValue().getBytes(); } switch ( filterType ) { case LdapCodecConstants.EQUALITY_MATCH_FILTER: branch = new EqualityNode( ava.getAttributeDesc(), value ); break; case LdapCodecConstants.GREATER_OR_EQUAL_FILTER: branch = new GreaterEqNode( ava.getAttributeDesc(), value ); break; case LdapCodecConstants.LESS_OR_EQUAL_FILTER: branch = new LessEqNode( ava.getAttributeDesc(), value ); break; case LdapCodecConstants.APPROX_MATCH_FILTER: branch = new ApproximateNode( ava.getAttributeDesc(), value ); break; default: throw new IllegalStateException( I18n.err( I18n.ERR_03042_UNEXPECTED_FILTER_TYPE, filterType ) ); } } else if ( filter instanceof SubstringFilter ) { // Transform Substring filters SubstringFilter substrFilter = ( SubstringFilter ) filter; String initialString = null; String finalString = null; List anyString = null; if ( substrFilter.getInitialSubstrings() != null ) { initialString = substrFilter.getInitialSubstrings(); } if ( substrFilter.getFinalSubstrings() != null ) { finalString = substrFilter.getFinalSubstrings(); } if ( substrFilter.getAnySubstrings() != null ) { anyString = new ArrayList<>(); for ( String any : substrFilter.getAnySubstrings() ) { anyString.add( any ); } } branch = new SubstringNode( anyString, substrFilter.getType(), initialString, finalString ); } else if ( filter instanceof ExtensibleMatchFilter ) { // Transform Extensible Match Filter ExtensibleMatchFilter extFilter = ( ExtensibleMatchFilter ) filter; String matchingRule = null; Value value = extFilter.getMatchValue(); if ( extFilter.getMatchingRule() != null ) { matchingRule = extFilter.getMatchingRule(); } branch = new ExtensibleNode( extFilter.getType(), value, matchingRule, extFilter.isDnAttributes() ); } return branch; } } else { // We have found nothing to transform. Return null then. return null; } } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element = super.toDsml( root ); SearchRequest request = getDecorated(); // Dn if ( request.getBase() != null ) { element.addAttribute( DsmlLiterals.DN, request.getBase().getName() ); } // Scope SearchScope scope = request.getScope(); if ( scope != null ) { if ( scope == SearchScope.OBJECT ) { element.addAttribute( DsmlLiterals.SCOPE, DsmlLiterals.BASE_OBJECT ); } else if ( scope == SearchScope.ONELEVEL ) { element.addAttribute( DsmlLiterals.SCOPE, DsmlLiterals.SINGLE_LEVEL ); } else if ( scope == SearchScope.SUBTREE ) { element.addAttribute( DsmlLiterals.SCOPE, DsmlLiterals.WHOLE_SUBTREE ); } } // DerefAliases AliasDerefMode derefAliases = request.getDerefAliases(); switch ( derefAliases ) { case NEVER_DEREF_ALIASES: element.addAttribute( DsmlLiterals.DEREF_ALIASES, DsmlLiterals.NEVER_DEREF_ALIASES ); break; case DEREF_ALWAYS: element.addAttribute( DsmlLiterals.DEREF_ALIASES, DsmlLiterals.DEREF_ALWAYS ); break; case DEREF_FINDING_BASE_OBJ: element.addAttribute( DsmlLiterals.DEREF_ALIASES, DsmlLiterals.DEREF_FINDING_BASE_OBJ ); break; case DEREF_IN_SEARCHING: element.addAttribute( DsmlLiterals.DEREF_ALIASES, DsmlLiterals.DEREF_IN_SEARCHING ); break; default: throw new IllegalStateException( I18n.err( I18n.ERR_03043_UNEXPECTED_DEREF_ALIAS, derefAliases ) ); } // SizeLimit if ( request.getSizeLimit() != 0L ) { element.addAttribute( DsmlLiterals.SIZE_LIMIT, Long.toString( request.getSizeLimit() ) ); } // TimeLimit if ( request.getTimeLimit() != 0 ) { element.addAttribute( DsmlLiterals.TIME_LIMIT, Integer.toString( request.getTimeLimit() ) ); } // TypesOnly if ( request.getTypesOnly() ) { element.addAttribute( DsmlLiterals.TYPES_ONLY, DsmlLiterals.TRUE ); } // Filter Element filterElement = element.addElement( DsmlLiterals.FILTER ); toDsml( filterElement, request.getFilter() ); // Attributes List attributes = request.getAttributes(); if ( !attributes.isEmpty() ) { Element attributesElement = element.addElement( DsmlLiterals.ATTRIBUTES ); for ( String entryAttribute : attributes ) { attributesElement.addElement( DsmlLiterals.ATTRIBUTE ).addAttribute( DsmlLiterals.NAME, entryAttribute ); } } return element; } /** * Recursively converts the filter of the Search Request into a DSML representation and adds * it to the XML Element corresponding to the Search Request * * @param element * the parent Element * @param filter * the filter to convert */ private void toDsml( Element element, ExprNode filter ) { // AND FILTER if ( filter instanceof AndNode ) { Element newElement = element.addElement( DsmlLiterals.AND ); List filterList = ( ( AndNode ) filter ).getChildren(); for ( int i = 0; i < filterList.size(); i++ ) { toDsml( newElement, filterList.get( i ) ); } } // OR FILTER else if ( filter instanceof OrNode ) { Element newElement = element.addElement( DsmlLiterals.OR ); List filterList = ( ( OrNode ) filter ).getChildren(); for ( int i = 0; i < filterList.size(); i++ ) { toDsml( newElement, filterList.get( i ) ); } } // NOT FILTER else if ( filter instanceof NotNode ) { Element newElement = element.addElement( DsmlLiterals.NOT ); toDsml( newElement, ( ( NotNode ) filter ).getFirstChild() ); } // SUBSTRING FILTER else if ( filter instanceof SubstringNode ) { Element newElement = element.addElement( DsmlLiterals.SUBSTRINGS ); SubstringNode substringFilter = ( SubstringNode ) filter; newElement.addAttribute( DsmlLiterals.NAME, substringFilter.getAttribute() ); String initial = substringFilter.getInitial(); if ( Strings.isNotEmpty( initial ) ) { newElement.addElement( DsmlLiterals.INITIAL ).setText( initial ); } List anyList = substringFilter.getAny(); for ( int i = 0; i < anyList.size(); i++ ) { newElement.addElement( DsmlLiterals.ANY ).setText( anyList.get( i ) ); } String finalString = substringFilter.getFinal(); if ( Strings.isNotEmpty( finalString ) ) { newElement.addElement( DsmlLiterals.FINAL ).setText( finalString ); } } // APPROXMATCH, EQUALITYMATCH, GREATEROREQUALS & LESSOREQUAL FILTERS else if ( filter instanceof SimpleNode ) { Element newElement; if ( filter instanceof ApproximateNode ) { newElement = element.addElement( DsmlLiterals.APPROX_MATCH ); } else if ( filter instanceof EqualityNode ) { newElement = element.addElement( DsmlLiterals.EQUALITY_MATCH ); } else if ( filter instanceof GreaterEqNode ) { newElement = element.addElement( DsmlLiterals.GREATER_OR_EQUAL ); } else // it is a LessEqNode ) { newElement = element.addElement( DsmlLiterals.LESS_OR_EQUAL ); } String attributeName = ( ( SimpleNode ) filter ).getAttribute(); newElement.addAttribute( DsmlLiterals.NAME, attributeName ); Value value = ( ( SimpleNode ) filter ).getValue(); if ( value != null ) { if ( value.isHumanReadable() ) { newElement.addElement( DsmlLiterals.VALUE ).setText( StringEscapeUtils.escapeXml11( value.getString() ) ); } else { Namespace xsdNamespace = new Namespace( ParserUtils.XSD, ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( ParserUtils.XSI, ParserUtils.XML_SCHEMA_INSTANCE_URI ); element.getDocument().getRootElement().add( xsdNamespace ); element.getDocument().getRootElement().add( xsiNamespace ); Element valueElement = newElement.addElement( DsmlLiterals.VALUE ).addText( ParserUtils.base64Encode( value.getBytes() ) ); valueElement .addAttribute( new QName( DsmlLiterals.TYPE, xsiNamespace ), ParserUtils.XSD_COLON + ParserUtils.BASE64BINARY ); } } } // PRESENT FILTER else if ( filter instanceof PresenceNode ) { Element newElement = element.addElement( DsmlLiterals.PRESENT ); newElement.addAttribute( DsmlLiterals.NAME, ( ( PresenceNode ) filter ).getAttribute() ); } // EXTENSIBLEMATCH else if ( filter instanceof ExtensibleNode ) { Element newElement = element.addElement( DsmlLiterals.EXTENSIBLE_MATCH ); Value value = ( ( ExtensibleNode ) filter ).getValue(); if ( value != null ) { if ( !value.isHumanReadable() ) { Namespace xsdNamespace = new Namespace( ParserUtils.XSD, ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( ParserUtils.XSI, ParserUtils.XML_SCHEMA_INSTANCE_URI ); element.getDocument().getRootElement().add( xsdNamespace ); element.getDocument().getRootElement().add( xsiNamespace ); Element valueElement = newElement.addElement( DsmlLiterals.VALUE ).addText( ParserUtils.base64Encode( value.getBytes() ) ); valueElement.addAttribute( new QName( DsmlLiterals.TYPE, xsiNamespace ), ParserUtils.XSD_COLON + ParserUtils.BASE64BINARY ); } else { newElement.addElement( DsmlLiterals.VALUE ).setText( value.getString() ); } } if ( ( ( ExtensibleNode ) filter ).hasDnAttributes() ) { newElement.addAttribute( DsmlLiterals.DN_ATTRIBUTES, DsmlLiterals.TRUE ); } String matchingRule = ( ( ExtensibleNode ) filter ).getMatchingRuleId(); if ( Strings.isNotEmpty( matchingRule ) ) { newElement.addAttribute( DsmlLiterals.MATCHING_RULE, matchingRule ); } } } /** * {@inheritDoc} */ @Override public MessageTypeEnum[] getResponseTypes() { return getDecorated().getResponseTypes(); } /** * {@inheritDoc} */ @Override public Dn getBase() { return getDecorated().getBase(); } /** * {@inheritDoc} */ @Override public SearchRequest setBase( Dn baseDn ) { getDecorated().setBase( baseDn ); return this; } /** * {@inheritDoc} */ @Override public SearchScope getScope() { return getDecorated().getScope(); } /** * {@inheritDoc} */ @Override public SearchRequest setScope( SearchScope scope ) { getDecorated().setScope( scope ); return this; } /** * {@inheritDoc} */ @Override public AliasDerefMode getDerefAliases() { return getDecorated().getDerefAliases(); } /** * {@inheritDoc} */ @Override public SearchRequest setDerefAliases( AliasDerefMode aliasDerefAliases ) { getDecorated().setDerefAliases( aliasDerefAliases ); return this; } /** * {@inheritDoc} */ @Override public long getSizeLimit() { return getDecorated().getSizeLimit(); } /** * {@inheritDoc} */ @Override public SearchRequest setSizeLimit( long entriesMax ) { getDecorated().setSizeLimit( entriesMax ); return this; } /** * {@inheritDoc} */ @Override public int getTimeLimit() { return getDecorated().getTimeLimit(); } /** * {@inheritDoc} */ @Override public SearchRequest setTimeLimit( int secondsMax ) { getDecorated().setTimeLimit( secondsMax ); return this; } /** * {@inheritDoc} */ @Override public boolean getTypesOnly() { return getDecorated().getTypesOnly(); } /** * {@inheritDoc} */ @Override public SearchRequest setTypesOnly( boolean typesOnly ) { getDecorated().setTypesOnly( typesOnly ); return this; } /** * {@inheritDoc} */ @Override public ExprNode getFilter() { return getDecorated().getFilter(); } /** * {@inheritDoc} */ @Override public SearchRequest setFilter( ExprNode filter ) { getDecorated().setFilter( filter ); return this; } /** * {@inheritDoc} */ @Override public SearchRequest setFilter( String filter ) throws LdapException { getDecorated().setFilter( filter ); return this; } /** * {@inheritDoc} */ @Override public SearchRequest setFilter( SchemaManager schemaManager, String filter ) throws LdapException { getDecorated().setFilter( schemaManager, filter ); return this; } /** * {@inheritDoc} */ @Override public List getAttributes() { return getDecorated().getAttributes(); } /** * {@inheritDoc} */ @Override public SearchRequest addAttributes( String... attributes ) { getDecorated().addAttributes( attributes ); return this; } /** * {@inheritDoc} */ @Override public SearchRequest removeAttribute( String attribute ) { getDecorated().removeAttribute( attribute ); return this; } /** * {@inheritDoc} */ @Override public SearchRequest setMessageId( int messageId ) { return ( SearchRequest ) super.setMessageId( messageId ); } /** * {@inheritDoc} */ @Override public SearchRequest addControl( Control control ) { return ( SearchRequest ) super.addControl( control ); } /** * {@inheritDoc} */ @Override public SearchRequest addAllControls( Control[] controls ) { return ( SearchRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ @Override public SearchRequest removeControl( Control control ) { return ( SearchRequest ) super.removeControl( control ); } /** * {@inheritDoc} */ @Override public boolean isFollowReferrals() { return getDecorated().isFollowReferrals(); } /** * {@inheritDoc} */ @Override public SearchRequest followReferrals() { return getDecorated().followReferrals(); } /** * {@inheritDoc} */ @Override public boolean isIgnoreReferrals() { return getDecorated().isIgnoreReferrals(); } /** * {@inheritDoc} */ @Override public SearchRequest ignoreReferrals() { return getDecorated().ignoreReferrals(); } } SubstringFilter.java000066400000000000000000000100541525525160600375520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.request; import java.util.ArrayList; import java.util.List; /** * A Object that stores the substring filter. * * A substring filter follow this * grammar : * * substring = attr "=" ( ([initial] any [final] | * (initial [any] [final) | * ([initial] [any] final) ) * * initial = value * any = "*" *(value "*") * final = value * * @author Apache Directory Project */ public class SubstringFilter extends Filter { /** The substring filter type (an attributeDescription) */ private String type; /** The initial filter */ private String initialSubstrings; /** The any filter. It's a list of LdapString */ private List anySubstrings = new ArrayList<>( 1 ); /** The final filter */ private String finalSubstrings; /** * Default constructor */ public SubstringFilter() { super(); } /** * Get the internal substrings * * @return Returns the anySubstrings. */ public List getAnySubstrings() { return anySubstrings; } /** * Add a internal substring * * @param any The anySubstrings to set. */ public void addAnySubstrings( String any ) { this.anySubstrings.add( any ); } /** * Get the final substring * * @return Returns the finalSubstrings. */ public String getFinalSubstrings() { return finalSubstrings; } /** * Set the final substring * * @param finalSubstrings The finalSubstrings to set. */ public void setFinalSubstrings( String finalSubstrings ) { this.finalSubstrings = finalSubstrings; } /** * Get the initial substring * * @return Returns the initialSubstrings. */ public String getInitialSubstrings() { return initialSubstrings; } /** * Set the initial substring * * @param initialSubstrings The initialSubstrings to set. */ public void setInitialSubstrings( String initialSubstrings ) { this.initialSubstrings = initialSubstrings; } /** * Get the attribute * * @return Returns the type. */ public String getType() { return type; } /** * Set the attribute to match * * @param type The type to set. */ public void setType( String type ) { this.type = type; } /** * Return a string compliant with RFC 2254 representing a Substring filter * * @return The substring filter string */ @Override public String toString() { StringBuilder sb = new StringBuilder(); if ( initialSubstrings != null ) { sb.append( initialSubstrings ); } sb.append( '*' ); if ( anySubstrings != null ) { for ( String any : anySubstrings ) { sb.append( any ).append( '*' ); } } if ( finalSubstrings != null ) { sb.append( finalSubstrings ); } return sb.toString(); } } response/000077500000000000000000000000001525525160600337275ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2AbstractResponseDsml.java000066400000000000000000000032101525525160600406700ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.Response; /** * Base class for all DSML responses. * * @param The response type * * @author Apache Directory Project */ public abstract class AbstractResponseDsml extends AbstractDsmlMessageDecorator implements Response { /** * Instantiates a new abstract DSML response. * * @param codec the Ldap Service to use * @param response the LDAP response message to decorate */ public AbstractResponseDsml( LdapApiService codec, E response ) { super( codec, response ); } } AbstractResultResponseDsml.java000066400000000000000000000034751525525160600421040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.ResultResponse; /** * Base class for all DSML responses. * * @param The response result type * * @author Apache Directory Project */ public abstract class AbstractResultResponseDsml extends AbstractResponseDsml implements ResultResponse { /** * Instantiates a new abstract DSML response. * * @param codec The LDAP Service to use * @param resultResponse the LDAP message to decorate */ public AbstractResultResponseDsml( LdapApiService codec, E resultResponse ) { super( codec, resultResponse ); } /** * {@inheritDoc} */ @Override public LdapResult getLdapResult() { return getDecorated().getLdapResult(); } } AddResponseDsml.java000066400000000000000000000053021525525160600376210ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.AddResponse; import org.apache.directory.api.ldap.model.message.AddResponseImpl; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.dom4j.Element; import org.dom4j.tree.DefaultElement; /** * DSML Decorator for AddResponse * * @author Apache Directory Project */ public class AddResponseDsml extends AbstractResultResponseDsml implements AddResponse { /** * Creates a new getDecoratedMessage() of AddResponseDsml. * * @param codec The LDAP Service to use */ public AddResponseDsml( LdapApiService codec ) { super( codec, new AddResponseImpl() ); } /** * Creates a new getDecoratedMessage() of AddResponseDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public AddResponseDsml( LdapApiService codec, AddResponse ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.ADD_RESPONSE ); } else { element = new DefaultElement( DsmlLiterals.ADD_RESPONSE ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } } BatchResponseDsml.java000066400000000000000000000110131525525160600401460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import java.util.ArrayList; import java.util.List; import org.apache.directory.api.dsmlv2.DsmlDecorator; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.ldap.model.message.Response; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; /** * This class represents the Batch Response. It can be used to generate an the XML String of a BatchResponse. * * @author Apache Directory Project */ public class BatchResponseDsml { /** The Responses list */ private List> responses; /** The ID of the response */ private int requestID; /** * Creates a new instance of BatchResponseDsml. */ public BatchResponseDsml() { responses = new ArrayList<>(); } /** * Gets the current response * * @return the current response */ public DsmlDecorator getCurrentResponse() { return responses.get( responses.size() - 1 ); } /** * Adds a request to the Batch Response DSML. * * @param response the request to add * @return true (as per the general contract of the Collection.add method). */ public boolean addResponse( DsmlDecorator response ) { return responses.add( response ); } /** * Removes a request from the Batch Response DSML. * * @param response the request to remove * @return true if this list contained the specified element. */ public boolean removeResponse( DsmlDecorator response ) { return responses.remove( response ); } /** * Gets the ID of the response * * @return the ID of the response */ public int getRequestID() { return requestID; } /** * Sets the ID of the response * * @param requestID * the ID to set */ public void setRequestID( int requestID ) { this.requestID = requestID; } /** * Gets the List of all the responses * * @return * the List of all the responses */ public List> getResponses() { return responses; } /** * Converts this Batch Response to its XML representation in the DSMLv2 format. * The XML document will be formatted for pretty printing by default. * * @return the XML representation in DSMLv2 format */ public String toDsml() { return toDsml( true ); } /** * Converts this Batch Response to its XML representation in the DSMLv2 format. * * @param prettyPrint if true, formats the document for pretty printing * @return the XML representation in DSMLv2 format */ public String toDsml( boolean prettyPrint ) { Document document = DocumentHelper.createDocument(); Element element = document.addElement( DsmlLiterals.BATCH_RESPONSE ); element.add( ParserUtils.DSML_NAMESPACE ); element.add( ParserUtils.XSD_NAMESPACE ); element.add( ParserUtils.XSI_NAMESPACE ); // RequestID if ( requestID != 0 ) { element.addAttribute( DsmlLiterals.REQUEST_ID, Integer.toString( requestID ) ); } for ( DsmlDecorator response : responses ) { response.toDsml( element ); } if ( prettyPrint ) { document = ParserUtils.styleDocument( document ); } return document.asXML(); } } BindResponseDsml.java000066400000000000000000000055221525525160600400110ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.BindResponse; import org.apache.directory.api.ldap.model.message.BindResponseImpl; import org.dom4j.Element; import org.dom4j.tree.DefaultElement; /** * DSML Decorator for AuthResponse * * @author Apache Directory Project */ public class BindResponseDsml extends AbstractResultResponseDsml implements BindResponse { /** * Creates a new getDecoratedMessage() of AuthResponseDsml. * * @param codec The LDAP Service to use */ public BindResponseDsml( LdapApiService codec ) { super( codec, new BindResponseImpl() ); } /** * Creates a new getDecoratedMessage() of AuthResponseDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public BindResponseDsml( LdapApiService codec, BindResponse ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.AUTH_RESPONSE ); } else { element = new DefaultElement( DsmlLiterals.AUTH_RESPONSE ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } /** * {@inheritDoc} */ @Override public byte[] getServerSaslCreds() { return getDecorated().getServerSaslCreds(); } /** * {@inheritDoc} */ @Override public void setServerSaslCreds( byte[] serverSaslCreds ) { getDecorated().setServerSaslCreds( serverSaslCreds ); } } CompareResponseDsml.java000066400000000000000000000055741525525160600405320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.CompareResponse; import org.apache.directory.api.ldap.model.message.CompareResponseImpl; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.dom4j.Element; import org.dom4j.tree.DefaultElement; /** * DSML Decorator for CompareResponse * * @author Apache Directory Project */ public class CompareResponseDsml extends AbstractResultResponseDsml implements CompareResponse { /** * Creates a new getDecoratedMessage() of CompareResponseDsml. * * @param codec The LDAP Service to use */ public CompareResponseDsml( LdapApiService codec ) { super( codec, new CompareResponseImpl() ); } /** * Creates a new getDecoratedMessage() of CompareResponseDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public CompareResponseDsml( LdapApiService codec, CompareResponse ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.COMPARE_RESPONSE ); } else { element = new DefaultElement( DsmlLiterals.COMPARE_RESPONSE ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } /** * {@inheritDoc} */ @Override public boolean isTrue() { return getDecorated().isTrue(); } } DelResponseDsml.java000066400000000000000000000053251525525160600376420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.DeleteResponse; import org.apache.directory.api.ldap.model.message.DeleteResponseImpl; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.dom4j.Element; import org.dom4j.tree.DefaultElement; /** * DSML Decorator for DelResponse * * @author Apache Directory Project */ public class DelResponseDsml extends AbstractResultResponseDsml implements DeleteResponse { /** * Creates a new getDecoratedMessage() of DelResponseDsml. * * @param codec The LDAP Service to use */ public DelResponseDsml( LdapApiService codec ) { super( codec, new DeleteResponseImpl() ); } /** * Creates a new getDecoratedMessage() of DelResponseDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public DelResponseDsml( LdapApiService codec, DeleteResponse ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.DEL_RESPONSE ); } else { element = new DefaultElement( DsmlLiterals.DEL_RESPONSE ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } } Dsmlv2ResponseGrammar.java000066400000000000000000003136721525525160600410030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import java.io.IOException; import java.lang.reflect.Array; import java.util.HashMap; import java.util.HashSet; import java.util.Set; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.util.Oid; import org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator; import org.apache.directory.api.dsmlv2.AbstractGrammar; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.DsmlDecorator; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.Dsmlv2Container; import org.apache.directory.api.dsmlv2.Dsmlv2StatesEnum; import org.apache.directory.api.dsmlv2.Grammar; import org.apache.directory.api.dsmlv2.GrammarAction; import org.apache.directory.api.dsmlv2.GrammarTransition; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.dsmlv2.Tag; import org.apache.directory.api.dsmlv2.response.ErrorResponse.ErrorResponseType; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.ldap.codec.api.ControlFactory; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException; import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException; import org.apache.directory.api.ldap.model.message.AddResponseImpl; import org.apache.directory.api.ldap.model.message.BindResponseImpl; import org.apache.directory.api.ldap.model.message.CompareResponseImpl; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.DeleteResponseImpl; import org.apache.directory.api.ldap.model.message.ExtendedResponse; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.Message; import org.apache.directory.api.ldap.model.message.ModifyDnResponseImpl; import org.apache.directory.api.ldap.model.message.ModifyResponseImpl; import org.apache.directory.api.ldap.model.message.OpaqueExtendedResponse; import org.apache.directory.api.ldap.model.message.ReferralImpl; import org.apache.directory.api.ldap.model.message.Response; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.message.ResultResponse; import org.apache.directory.api.ldap.model.message.SearchResultDoneImpl; import org.apache.directory.api.ldap.model.message.SearchResultEntryImpl; import org.apache.directory.api.ldap.model.message.SearchResultReference; import org.apache.directory.api.ldap.model.message.SearchResultReferenceImpl; import org.apache.directory.api.ldap.model.message.controls.OpaqueControl; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.apache.directory.api.util.Strings; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; /** * This Class represents the DSMLv2 Response Grammar * * @author Apache Directory Project */ public final class Dsmlv2ResponseGrammar extends AbstractGrammar implements Grammar { /** The instance of grammar. Dsmlv2ResponseGrammar is a singleton */ private static Dsmlv2ResponseGrammar instance = new Dsmlv2ResponseGrammar(); /** The DSMLv2 description tags */ private static final Set DSMLV2_DESCR_TAGS; static { DSMLV2_DESCR_TAGS = new HashSet<>(); DSMLV2_DESCR_TAGS.add( "success" ); DSMLV2_DESCR_TAGS.add( "operationsError" ); DSMLV2_DESCR_TAGS.add( "protocolError" ); DSMLV2_DESCR_TAGS.add( "timeLimitExceeded" ); DSMLV2_DESCR_TAGS.add( "sizeLimitExceeded" ); DSMLV2_DESCR_TAGS.add( "compareFalse" ); DSMLV2_DESCR_TAGS.add( "compareTrue" ); DSMLV2_DESCR_TAGS.add( "authMethodNotSupported" ); DSMLV2_DESCR_TAGS.add( "strongAuthRequired" ); DSMLV2_DESCR_TAGS.add( "referral" ); DSMLV2_DESCR_TAGS.add( "adminLimitExceeded" ); DSMLV2_DESCR_TAGS.add( "unavailableCriticalExtension" ); DSMLV2_DESCR_TAGS.add( "confidentialityRequired" ); DSMLV2_DESCR_TAGS.add( "saslBindInProgress" ); DSMLV2_DESCR_TAGS.add( "noSuchAttribute" ); DSMLV2_DESCR_TAGS.add( "undefinedAttributeType" ); DSMLV2_DESCR_TAGS.add( "inappropriateMatching" ); DSMLV2_DESCR_TAGS.add( "constraintViolation" ); DSMLV2_DESCR_TAGS.add( "attributeOrValueExists" ); DSMLV2_DESCR_TAGS.add( "invalidAttributeSyntax" ); DSMLV2_DESCR_TAGS.add( "noSuchObject" ); DSMLV2_DESCR_TAGS.add( "aliasProblem" ); DSMLV2_DESCR_TAGS.add( "invalidDNSyntax" ); DSMLV2_DESCR_TAGS.add( "aliasDereferencingProblem" ); DSMLV2_DESCR_TAGS.add( "inappropriateAuthentication" ); DSMLV2_DESCR_TAGS.add( "invalidCredentials" ); DSMLV2_DESCR_TAGS.add( "insufficientAccessRights" ); DSMLV2_DESCR_TAGS.add( "busy" ); DSMLV2_DESCR_TAGS.add( "unavailable" ); DSMLV2_DESCR_TAGS.add( "unwillingToPerform" ); DSMLV2_DESCR_TAGS.add( "loopDetect" ); DSMLV2_DESCR_TAGS.add( "namingViolation" ); DSMLV2_DESCR_TAGS.add( "objectClassViolation" ); DSMLV2_DESCR_TAGS.add( "notAllowedOnNonLeaf" ); DSMLV2_DESCR_TAGS.add( "notAllowedOnRDN" ); DSMLV2_DESCR_TAGS.add( "entryAlreadyExists" ); DSMLV2_DESCR_TAGS.add( "objectClassModsProhibited" ); DSMLV2_DESCR_TAGS.add( "affectMultipleDSAs" ); DSMLV2_DESCR_TAGS.add( "other" ); } /** * GrammarAction that creates the Batch Response */ private final GrammarAction batchResponseCreation = new GrammarAction( "Create Batch Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { BatchResponseDsml batchResponse = new BatchResponseDsml(); container.setBatchResponse( batchResponse ); XmlPullParser xpp = container.getParser(); // Checking and adding the batchRequest's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { batchResponse.setRequestID( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { // The request ID is optional batchResponse.setRequestID( -1 ); } } }; /** * GrammarAction that creates the Add Response */ private final GrammarAction addResponseCreation = new GrammarAction( "Create Add Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { AddResponseDsml addResponse = new AddResponseDsml( container.getLdapCodecService(), new AddResponseImpl() ); container.getBatchResponse().addResponse( addResponse ); LdapResult ldapResult = addResponse.getLdapResult(); XmlPullParser xpp = container.getParser(); // Checking and adding the batchRequest's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { addResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { // The request ID is optional addResponse.setMessageId( -1 ); } // MatchedDN attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.MATCHED_DN ); if ( attributeValue != null ) { try { ldapResult.setMatchedDn( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } } }; /** * GrammarAction that creates the Auth Response */ private final GrammarAction authResponseCreation = new GrammarAction( "Create Auth Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { BindResponseDsml bindResponse = new BindResponseDsml( container.getLdapCodecService(), new BindResponseImpl() ); container.getBatchResponse().addResponse( bindResponse ); LdapResult ldapResult = bindResponse.getLdapResult(); XmlPullParser xpp = container.getParser(); // Checking and adding the batchRequest's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { bindResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { // The request ID is optional bindResponse.setMessageId( -1 ); } // MatchedDN attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.MATCHED_DN ); if ( attributeValue != null ) { try { ldapResult.setMatchedDn( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } } }; /** * GrammarAction that creates the Compare Response */ private final GrammarAction compareResponseCreation = new GrammarAction( "Create Compare Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { CompareResponseDsml compareResponse = new CompareResponseDsml( container.getLdapCodecService(), new CompareResponseImpl() ); container.getBatchResponse().addResponse( compareResponse ); LdapResult ldapResult = compareResponse.getLdapResult(); XmlPullParser xpp = container.getParser(); // Checking and adding the batchRequest's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { compareResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { // The request ID is optional compareResponse.setMessageId( -1 ); } // MatchedDN attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.MATCHED_DN ); if ( attributeValue != null ) { try { ldapResult.setMatchedDn( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } } }; /** * GrammarAction that creates the Del Response */ private final GrammarAction delResponseCreation = new GrammarAction( "Create Del Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { DelResponseDsml delResponse = new DelResponseDsml( container.getLdapCodecService(), new DeleteResponseImpl() ); container.getBatchResponse().addResponse( delResponse ); LdapResult ldapResult = delResponse.getLdapResult(); XmlPullParser xpp = container.getParser(); // Checking and adding the batchRequest's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { delResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { // The request ID is optional delResponse.setMessageId( -1 ); } // MatchedDN attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.MATCHED_DN ); if ( attributeValue != null ) { try { ldapResult.setMatchedDn( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } } }; /** * GrammarAction that creates the Modify Response */ private final GrammarAction modifyResponseCreation = new GrammarAction( "Create Modify Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ModifyResponseDsml modifyResponse = new ModifyResponseDsml( container.getLdapCodecService(), new ModifyResponseImpl() ); container.getBatchResponse().addResponse( modifyResponse ); LdapResult ldapResult = modifyResponse.getLdapResult(); XmlPullParser xpp = container.getParser(); // Checking and adding the batchRequest's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { modifyResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { // The request ID is optional modifyResponse.setMessageId( -1 ); } // MatchedDN attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.MATCHED_DN ); if ( attributeValue != null ) { try { ldapResult.setMatchedDn( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } } }; /** * GrammarAction that creates the Mod Dn Response */ private final GrammarAction modDNResponseCreation = new GrammarAction( "Create Mod Dn Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ModDNResponseDsml modDNResponse = new ModDNResponseDsml( container.getLdapCodecService(), new ModifyDnResponseImpl() ); container.getBatchResponse().addResponse( modDNResponse ); LdapResult ldapResult = modDNResponse.getLdapResult(); XmlPullParser xpp = container.getParser(); // Checking and adding the batchRequest's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { modDNResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { // The request ID is optional modDNResponse.setMessageId( -1 ); } // MatchedDN attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.MATCHED_DN ); if ( attributeValue != null ) { try { ldapResult.setMatchedDn( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } } }; /** * GrammarAction that creates the Extended Response */ private final GrammarAction extendedResponseCreation = new GrammarAction( "Create Extended Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtendedResponseDsml extendedResponse; // Checking and adding the batchRequest's attributes String attributeValue; XmlPullParser xpp = container.getParser(); // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { extendedResponse = new ExtendedResponseDsml( container.getLdapCodecService(), new OpaqueExtendedResponse( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ) ); } else { extendedResponse = new ExtendedResponseDsml( container.getLdapCodecService(), new OpaqueExtendedResponse( -1 ) ); } container.getBatchResponse().addResponse( extendedResponse ); LdapResult ldapResult = extendedResponse.getLdapResult(); // MatchedDN attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.MATCHED_DN ); if ( attributeValue != null ) { try { ldapResult.setMatchedDn( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } } }; /** * GrammarAction that creates the Error Response */ private final GrammarAction errorResponseCreation = new GrammarAction( "Create Error Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ErrorResponse errorResponse = null; XmlPullParser xpp = container.getParser(); // Checking and adding the batchRequest's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { errorResponse = new ErrorResponse( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ), null ); container.getBatchResponse().addResponse( errorResponse ); } else { // No request ID: no problem, it's optional errorResponse = new ErrorResponse( -1, null ); container.getBatchResponse().addResponse( errorResponse ); } // type attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.TYPE ); if ( attributeValue != null ) { if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.NOT_ATTEMPTED ) ) ) { errorResponse.setErrorType( ErrorResponseType.NOT_ATTEMPTED ); } else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.COULD_NOT_CONNECT ) ) ) { errorResponse.setErrorType( ErrorResponseType.COULD_NOT_CONNECT ); } else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.CONNECTION_CLOSED ) ) ) { errorResponse.setErrorType( ErrorResponseType.CONNECTION_CLOSED ); } else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.MALFORMED_REQUEST ) ) ) { errorResponse.setErrorType( ErrorResponseType.MALFORMED_REQUEST ); } else if ( attributeValue .equals( errorResponse.getTypeDescr( ErrorResponseType.GATEWAY_INTERNAL_ERROR ) ) ) { errorResponse.setErrorType( ErrorResponseType.GATEWAY_INTERNAL_ERROR ); } else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.AUTHENTICATION_FAILED ) ) ) { errorResponse.setErrorType( ErrorResponseType.AUTHENTICATION_FAILED ); } else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.UNRESOLVABLE_URI ) ) ) { errorResponse.setErrorType( ErrorResponseType.UNRESOLVABLE_URI ); } else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.OTHER ) ) ) { errorResponse.setErrorType( ErrorResponseType.OTHER ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03004_UNKNOWN_TYPE ), xpp, null ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03005_REQUIRE_ATTRIBUTE_TYPE ), xpp, null ); } } }; /** * GrammarAction that adds Message to an Error Response */ private final GrammarAction errorResponseAddMessage = new GrammarAction( "Add Message to Error Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ErrorResponse errorResponse = ( ErrorResponse ) container.getBatchResponse().getCurrentResponse(); XmlPullParser xpp = container.getParser(); try { String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { errorResponse.setMessage( nextText.trim() ); } } catch ( IOException ioe ) { throw new XmlPullParserException( ioe.getMessage(), xpp, ioe ); } } }; /** * GrammarAction that adds Detail to an Error Response */ // TODO Look for documentation about this Detail element (the DSML documentation doesn't give enough information) private static final GrammarAction ERROR_RESPONSE_ADD_DETAIL = null; /** * GrammarAction that creates a Control for LDAP Result */ private final GrammarAction ldapResultControlCreation = new GrammarAction( "Create Control for LDAP Result" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { AbstractDsmlMessageDecorator message = ( AbstractDsmlMessageDecorator ) container.getBatchResponse().getCurrentResponse(); if ( message instanceof SearchResponseDsml ) { createAndAddControl( container, ( ( SearchResponse ) ( ( SearchResponseDsml ) message ).getDecorated() ).getSearchResultDone() ); } else { createAndAddControl( container, message ); } } }; /** * GrammarAction that creates a Control for Search Result Entry */ private final GrammarAction searchResultEntryControlCreation = new GrammarAction( "Create Control for Search Result Entry" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResponse response = ( SearchResponse ) ( ( SearchResponseDsml ) container.getBatchResponse() .getCurrentResponse() ).getDecorated(); createAndAddControl( container, response.getCurrentSearchResultEntry() ); } }; /** * GrammarAction that creates a Control for Search Result Entry */ private final GrammarAction searchResultReferenceControlCreation = new GrammarAction( "Create Control for Search Result Reference" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResponse response = ( SearchResponse ) ( ( SearchResponseDsml ) container.getBatchResponse() .getCurrentResponse() ).getDecorated(); createAndAddControl( container, response.getCurrentSearchResultReference() ); } }; /** * GrammarAction that creates a Control Value for LDAP Result */ private final GrammarAction ldapResultControlValueCreation = new GrammarAction( "Add ControlValue to Control for LDAP Result" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { AbstractDsmlMessageDecorator response = ( AbstractDsmlMessageDecorator ) container.getBatchResponse().getCurrentResponse(); if ( response instanceof SearchResponseDsml ) { SearchResponse searchResponse = ( SearchResponse ) response.getDecorated(); createAndAddControlValue( container, searchResponse.getSearchResultDone() ); } else { createAndAddControlValue( container, response ); } } }; /** * GrammarAction that creates a Control Value for Search Result Entry */ private final GrammarAction searchResultEntryControlValueCreation = new GrammarAction( "Add ControlValue to Control for Search Result Entry" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResponse response = ( SearchResponse ) container.getBatchResponse().getCurrentResponse().getDecorated(); createAndAddControlValue( container, response.getCurrentSearchResultEntry() ); } }; /** * GrammarAction that creates a Control Value for Search Result Reference */ private final GrammarAction searchResultReferenceControlValueCreation = new GrammarAction( "Add ControlValue to Control for Search Result Entry" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResponseDsml response = ( SearchResponseDsml ) container.getBatchResponse().getCurrentResponse(); createAndAddControlValue( container, ( ( SearchResponse ) response.getDecorated() ).getCurrentSearchResultReference() ); } }; /** * GrammarAction that adds a Result Code to a LDAP Result */ private final GrammarAction ldapResultAddResultCode = new GrammarAction( "Add ResultCode to LDAP Result" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { DsmlDecorator ldapResponse = container.getBatchResponse().getCurrentResponse(); LdapResult ldapResult; // Search Response is a special case // ResultCode can only occur in a case of Search Result Done in a Search Response if ( ldapResponse.getDecorated() instanceof SearchResponse ) { SearchResponse searchResponse = ( SearchResponse ) ldapResponse.getDecorated(); ldapResult = searchResponse.getSearchResultDone().getLdapResult(); } else { ldapResult = ( ( ResultResponse ) ldapResponse.getDecorated() ).getLdapResult(); } XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // code attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.CODE ); if ( attributeValue != null ) { try { ldapResult.setResultCode( ResultCodeEnum.getResultCode( Integer.parseInt( attributeValue ) ) ); } catch ( NumberFormatException nfe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03009_RESULT_CODE_NOT_INTEGER ), xpp, nfe ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03010_CODE_ATTRIBUTE_REQUIRED ), xpp, null ); } // descr attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DESCR ); if ( ( attributeValue != null ) && !DSMLV2_DESCR_TAGS.contains( attributeValue ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03011_DESCR_DOESNT_MATCH_VALUES, attributeValue ), xpp, null ); } } }; /** * GrammarAction that adds a Error Message to a LDAP Result */ private final GrammarAction ldapResultAddErrorMessage = new GrammarAction( "Add Error Message to LDAP Result" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { DsmlDecorator ldapResponse = container.getBatchResponse().getCurrentResponse(); LdapResult ldapResult; // Search Response is a special case // ResultCode can only occur in a case of Search Result Done in a Search Response if ( ldapResponse.getDecorated() instanceof SearchResponse ) { SearchResponse searchResponse = ( SearchResponse ) ldapResponse.getDecorated(); ldapResult = searchResponse.getSearchResultDone().getLdapResult(); } else { ldapResult = ( ( ResultResponse ) ldapResponse.getDecorated() ).getLdapResult(); } XmlPullParser xpp = container.getParser(); try { String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { ldapResult.setDiagnosticMessage( nextText.trim() ); } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that adds a Referral to a LDAP Result */ private final GrammarAction ldapResultAddReferral = new GrammarAction( "Add Referral to LDAP Result" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { DsmlDecorator ldapResponse = container.getBatchResponse().getCurrentResponse(); LdapResult ldapResult; // Search Response is a special case // ResultCode can only occur in a case of Search Result Done in a Search Response if ( ldapResponse.getDecorated() instanceof SearchResponse ) { SearchResponse searchResponse = ( SearchResponse ) ldapResponse.getDecorated(); ldapResult = searchResponse.getSearchResultDone().getLdapResult(); } else { ldapResult = ( ( ResultResponse ) ldapResponse.getDecorated() ).getLdapResult(); } // Initialization of the Referrals if needed if ( ldapResult.getReferral() == null ) { ldapResult.setReferral( new ReferralImpl() ); } XmlPullParser xpp = container.getParser(); try { String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { try { String urlStr = nextText.trim(); LdapUrl ldapUrl = new LdapUrl( urlStr ); ldapResult.getReferral().addLdapUrl( ldapUrl.toString() ); } catch ( LdapURLEncodingException luee ) { throw new XmlPullParserException( luee.getMessage(), xpp, luee ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates the Search Response */ private final GrammarAction searchResponseCreation = new GrammarAction( "Create Search Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { XmlPullParser xpp = container.getParser(); SearchResponse searchResponse; // Checking and adding the batchRequest's attributes String attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { searchResponse = new SearchResponse( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { searchResponse = new SearchResponse( -1 ); } container.getBatchResponse().addResponse( new SearchResponseDsml( container.getLdapCodecService(), searchResponse ) ); } }; /** * GrammarAction that creates a Search Result Entry */ private final GrammarAction searchResultEntryCreation = new GrammarAction( "Add Search Result Entry to Search Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResultEntryDsml searchResultEntry = new SearchResultEntryDsml( container.getLdapCodecService(), new SearchResultEntryImpl() ); SearchResponseDsml searchResponse = ( SearchResponseDsml ) container.getBatchResponse().getCurrentResponse(); searchResponse.addResponse( searchResultEntry ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { searchResultEntry.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { // The request ID is optional searchResultEntry.setMessageId( -1 ); } // dn attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.DN ); if ( attributeValue != null ) { try { searchResultEntry.setObjectName( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03049_DN_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that creates a Search Result Reference */ private final GrammarAction searchResultReferenceCreation = new GrammarAction( "Add Search Result Reference to Search Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResultReferenceDsml searchResultReference = new SearchResultReferenceDsml( container.getLdapCodecService(), new SearchResultReferenceImpl() ); SearchResponseDsml searchResponseDsml = ( SearchResponseDsml ) container.getBatchResponse().getCurrentResponse(); searchResponseDsml.addResponse( searchResultReference ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { searchResultReference.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { // The request ID is optional searchResultReference.setMessageId( -1 ); } } }; /** * GrammarAction that creates a Search Result Done */ private final GrammarAction searchResultDoneCreation = new GrammarAction( "Add Search Result Done to Search Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResultDoneDsml searchResultDone = new SearchResultDoneDsml( container.getLdapCodecService(), new SearchResultDoneImpl() ); SearchResponseDsml searchResponseDsml = ( SearchResponseDsml ) container.getBatchResponse().getCurrentResponse(); searchResponseDsml.addResponse( searchResultDone ); XmlPullParser xpp = container.getParser(); // Checking and adding the batchRequest's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.REQUEST_ID ); if ( attributeValue != null ) { searchResultDone.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { // The request ID is optional searchResultDone.setMessageId( -1 ); } // MatchedDN attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.MATCHED_DN ); if ( attributeValue != null ) { try { searchResultDone.getLdapResult().setMatchedDn( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } } }; /** * GrammarAction that adds an Attr to a Search Result Entry */ private final GrammarAction searchResultEntryAddAttr = new GrammarAction( "Add Attr to Search Result Entry" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse().getDecorated(); SearchResultEntryDsml searchResultEntry = searchResponse.getCurrentSearchResultEntry(); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // name attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.NAME ); if ( attributeValue != null ) { try { searchResultEntry.addAttribute( attributeValue ); } catch ( LdapException le ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, le ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null ); } } }; /** * GrammarAction that adds a Value to an Attr of a Search Result Entry */ private final GrammarAction searchResultEntryAddValue = new GrammarAction( "Add a Value to an Attr of a Search Result Entry" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse().getDecorated(); SearchResultEntryDsml searchResultEntry = searchResponse.getCurrentSearchResultEntry(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); try { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { searchResultEntry.addAttributeValue( ParserUtils.base64Decode( xpp, nextText ) ); } else { searchResultEntry.addAttributeValue( nextText ); } } catch ( LdapException le ) { throw new XmlPullParserException( le.getMessage(), xpp, le ); } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that adds a Ref to a Search Result Reference */ private final GrammarAction searchResultReferenceAddRef = new GrammarAction( "Add a Ref to a Search Result Reference" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse().getDecorated(); SearchResultReference searchResultReference = searchResponse.getCurrentSearchResultReference(); XmlPullParser xpp = container.getParser(); try { String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { LdapUrl ldapUrl = new LdapUrl( nextText ); searchResultReference.getReferral().addLdapUrl( ldapUrl.toString() ); } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } catch ( LdapURLEncodingException luee ) { throw new XmlPullParserException( luee.getMessage(), xpp, luee ); } } }; /** * GrammarAction that adds Result Code to an Extended Response */ private final GrammarAction extendedResponseAddResultCode = ldapResultAddResultCode; /** * GrammarAction that creates the Search Response */ private final GrammarAction extendedResponseAddErrorMessage = ldapResultAddErrorMessage; /** * GrammarAction that adds a Referral to an Extended Response */ private final GrammarAction extendedResponseAddReferral = ldapResultAddReferral; /** * GrammarAction that adds a Response Name to an Extended Response */ private final GrammarAction extendedResponseAddResponseName = new GrammarAction( "Add Response Name to Extended Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtendedResponse extendedResponse = ( ExtendedResponse ) container.getBatchResponse().getCurrentResponse(); XmlPullParser xpp = container.getParser(); try { String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { extendedResponse.setResponseName( Oid.fromString( nextText.trim() ).toString() ); } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } catch ( DecoderException de ) { throw new XmlPullParserException( de.getMessage(), xpp, de ); } } }; /** * GrammarAction that adds a Response to an Extended Response */ private final GrammarAction extendedResponseAddResponse = new GrammarAction( "Add Response to Extended Response" ) { /** * {@inheritDoc} */ @Override public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtendedResponseDsml extendedResponse = ( ExtendedResponseDsml ) container.getBatchResponse() .getCurrentResponse(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { extendedResponse.setResponseValue( ParserUtils.base64Decode( xpp, nextText.trim() ) ); } else { extendedResponse.setResponseValue( Strings.getBytesUtf8( nextText.trim() ) ); } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } }; @SuppressWarnings("unchecked") private Dsmlv2ResponseGrammar() { name = Dsmlv2ResponseGrammar.class.getName(); // Create the transitions table super.transitions = ( HashMap[] ) Array.newInstance( HashMap.class, 300 ); //==================================================== // Transitions concerning : BATCH RESPONSE //==================================================== super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE.ordinal()] = new HashMap(); // ** OPEN BATCH Reponse ** // State: [INIT_GRAMMAR_STATE] - Tag: super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE.ordinal()].put( new Tag( DsmlLiterals.BATCH_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, batchResponseCreation ) ); //==================================================== // Transitions concerning : BATCH RESPONSE LOOP //==================================================== super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()] = new HashMap(); // State: [BATCH_RESPONSE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()].put( new Tag( DsmlLiterals.ADD_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, Dsmlv2StatesEnum.LDAP_RESULT, addResponseCreation ) ); // State: [BATCH_RESPONSE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()].put( new Tag( DsmlLiterals.AUTH_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, Dsmlv2StatesEnum.LDAP_RESULT, authResponseCreation ) ); // State: [BATCH_RESPONSE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()].put( new Tag( DsmlLiterals.COMPARE_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, Dsmlv2StatesEnum.LDAP_RESULT, compareResponseCreation ) ); // State: [BATCH_RESPONSE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()].put( new Tag( DsmlLiterals.DEL_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, Dsmlv2StatesEnum.LDAP_RESULT, delResponseCreation ) ); // State: [BATCH_RESPONSE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()].put( new Tag( DsmlLiterals.MODIFY_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, Dsmlv2StatesEnum.LDAP_RESULT, modifyResponseCreation ) ); // State: [BATCH_RESPONSE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()].put( new Tag( DsmlLiterals.MOD_DN_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, Dsmlv2StatesEnum.LDAP_RESULT, modDNResponseCreation ) ); // State: [BATCH_RESPONSE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, Dsmlv2StatesEnum.EXTENDED_RESPONSE, extendedResponseCreation ) ); // State: [BATCH_RESPONSE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()].put( new Tag( DsmlLiterals.ERROR_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, Dsmlv2StatesEnum.ERROR_RESPONSE, errorResponseCreation ) ); // State: [BATCH_RESPONSE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, Dsmlv2StatesEnum.SEARCH_RESPONSE, searchResponseCreation ) ); // State: [BATCH_RESPONSE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP.ordinal()].put( new Tag( DsmlLiterals.BATCH_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, Dsmlv2StatesEnum.GRAMMAR_END, null ) ); //==================================================== // Transitions concerning : ERROR RESPONSE //==================================================== super.transitions[Dsmlv2StatesEnum.ERROR_RESPONSE.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.MESSAGE_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.DETAIL_START.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.DETAIL_END.ordinal()] = new HashMap(); // State: [ERROR_RESPONSE] - Tag: super.transitions[Dsmlv2StatesEnum.ERROR_RESPONSE.ordinal()].put( new Tag( DsmlLiterals.MESSAGE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ERROR_RESPONSE, Dsmlv2StatesEnum.MESSAGE_END, errorResponseAddMessage ) ); // State: [ERROR_RESPONSE] - Tag: super.transitions[Dsmlv2StatesEnum.ERROR_RESPONSE.ordinal()].put( new Tag( DsmlLiterals.DETAIL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.ERROR_RESPONSE, Dsmlv2StatesEnum.DETAIL_START, ERROR_RESPONSE_ADD_DETAIL ) ); // State: [MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.ERROR_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.MESSAGE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.DETAIL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.MESSAGE_END, Dsmlv2StatesEnum.DETAIL_START, ERROR_RESPONSE_ADD_DETAIL ) ); // State: [DETAIL_START] - Tag: super.transitions[Dsmlv2StatesEnum.DETAIL_START.ordinal()].put( new Tag( DsmlLiterals.DETAIL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.DETAIL_START, Dsmlv2StatesEnum.DETAIL_END, null ) ); // State: [DETAIL_END] - Tag: super.transitions[Dsmlv2StatesEnum.DETAIL_END.ordinal()].put( new Tag( DsmlLiterals.DETAIL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.DETAIL_END, Dsmlv2StatesEnum.DETAIL_END, ERROR_RESPONSE_ADD_DETAIL ) ); // State: [ERROR_RESPONSE] - Tag: super.transitions[Dsmlv2StatesEnum.ERROR_RESPONSE.ordinal()].put( new Tag( DsmlLiterals.ERROR_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ERROR_RESPONSE, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); //==================================================== // Transitions concerning : EXTENDED RESPONSE //==================================================== super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_START.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_VALUE_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_START.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_ERROR_MESSAGE_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.RESPONSE_NAME_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.RESPONSE_END.ordinal()] = new HashMap(); // State: [EXTENDED_RESPONSE] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE, Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_START, ldapResultControlCreation ) ); // State: [EXTENDED_RESPONSE_CONTROL_START] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_START.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_START, Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_VALUE_END, ldapResultControlValueCreation ) ); // State: [EXTENDED_RESPONSE_CONTROL_VALUE_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_VALUE_END.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_VALUE_END, Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_END, null ) ); // State: [EXTENDED_RESPONSE_CONTROL_START] - Tag:
super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_START.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_START, Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_END, null ) ); // State: [EXTENDED_RESPONSE_CONTROL_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_END.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_END, Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_START, ldapResultControlCreation ) ); // State: [EXTENDED_RESPONSE_CONTROL_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_END.ordinal()].put( new Tag( DsmlLiterals.RESULT_CODE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_CONTROL_END, Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_START, extendedResponseAddResultCode ) ); // State: [EXTENDED_RESPONSE] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE.ordinal()].put( new Tag( DsmlLiterals.RESULT_CODE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE, Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_START, extendedResponseAddResultCode ) ); // State: [EXTENDED_RESPONSE_RESULT_CODE_START] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_START.ordinal()].put( new Tag( DsmlLiterals.RESULT_CODE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_START, Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END, null ) ); // State: [EXTENDED_RESPONSE_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.ERROR_MESSAGE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END, Dsmlv2StatesEnum.EXTENDED_RESPONSE_ERROR_MESSAGE_END, extendedResponseAddErrorMessage ) ); // State: [EXTENDED_RESPONSE_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.REFERRAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END, Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END, extendedResponseAddReferral ) ); // State: [EXTENDED_RESPONSE_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.RESPONSE_NAME, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END, Dsmlv2StatesEnum.RESPONSE_NAME_END, extendedResponseAddResponseName ) ); // State: [EXTENDED_RESPONSE_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END, Dsmlv2StatesEnum.RESPONSE_END, extendedResponseAddResponse ) ); // State: [EXTENDED_RESPONSE_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_RESULT_CODE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [EXTENDED_RESPONSE_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.REFERRAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_ERROR_MESSAGE_END, Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END, extendedResponseAddReferral ) ); // State: [EXTENDED_RESPONSE_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.RESPONSE_NAME, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_ERROR_MESSAGE_END, Dsmlv2StatesEnum.RESPONSE_NAME_END, extendedResponseAddResponseName ) ); // State: [EXTENDED_RESPONSE_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_ERROR_MESSAGE_END, Dsmlv2StatesEnum.RESPONSE_END, extendedResponseAddResponse ) ); // State: [EXTENDED_RESPONSE_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_ERROR_MESSAGE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [EXTENDED_RESPONSE_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.REFERRAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END, Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END, extendedResponseAddReferral ) ); // State: [EXTENDED_RESPONSE_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.RESPONSE_NAME, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END, Dsmlv2StatesEnum.RESPONSE_NAME_END, extendedResponseAddResponseName ) ); // State: [EXTENDED_RESPONSE_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END, Dsmlv2StatesEnum.RESPONSE_END, extendedResponseAddResponse ) ); // State: [EXTENDED_RESPONSE_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_RESPONSE_REFERRAL_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [RESPONSE_NAME_END] - Tag: super.transitions[Dsmlv2StatesEnum.RESPONSE_NAME_END.ordinal()].put( new Tag( DsmlLiterals.RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.RESPONSE_NAME_END, Dsmlv2StatesEnum.RESPONSE_END, extendedResponseAddResponse ) ); // State: [RESPONSE_NAME_END] - Tag: super.transitions[Dsmlv2StatesEnum.RESPONSE_NAME_END.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.RESPONSE_NAME_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [RESPONSE_END] - Tag: super.transitions[Dsmlv2StatesEnum.RESPONSE_END.ordinal()].put( new Tag( DsmlLiterals.EXTENDED_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.RESPONSE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); //==================================================== // Transitions concerning : LDAP RESULT //==================================================== super.transitions[Dsmlv2StatesEnum.LDAP_RESULT.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_START.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_VALUE_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_START.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_DONE_END.ordinal()] = new HashMap(); // State: [LDAP_RESULT] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT, Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_START, ldapResultControlCreation ) ); // State: [LDAP_RESULT] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT.ordinal()] .put( new Tag( DsmlLiterals.RESULT_CODE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT, Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_START, ldapResultAddResultCode ) ); // State: [LDAP_RESULT_CONTROL_START] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_START.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_START, Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_VALUE_END, ldapResultControlValueCreation ) ); // State: [LDAP_RESULT_CONTROL_VALUE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_VALUE_END.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_VALUE_END, Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_END, null ) ); // State: [LDAP_RESULT_CONTROL_START] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_START.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_START, Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_END, null ) ); // State: [LDAP_RESULT_CONTROL_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_END.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_END, Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_START, ldapResultControlCreation ) ); // State: [LDAP_RESULT_CONTROL_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_END.ordinal()].put( new Tag( DsmlLiterals.RESULT_CODE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_CONTROL_END, Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_START, ldapResultAddResultCode ) ); // State: [LDAP_RESULT_RESULT_CODE_START] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_START.ordinal()].put( new Tag( DsmlLiterals.RESULT_CODE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_START, Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END, null ) ); // State: [LDAP_RESULT_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.ERROR_MESSAGE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END, Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END, ldapResultAddErrorMessage ) ); // State: [LDAP_RESULT_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.REFERRAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END, Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, ldapResultAddReferral ) ); // State: [LDAP_RESULT_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.ADD_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.AUTH_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.COMPARE_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.DEL_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.MODIFY_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.MOD_DN_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_RESULT_CODE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_DONE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_RESULT_CODE_END, Dsmlv2StatesEnum.SEARCH_RESULT_DONE_END, null ) ); // State: [SEARCH_RESULT_DONE_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_DONE_END.ordinal()] .put( new Tag( DsmlLiterals.SEARCH_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_DONE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.REFERRAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END, Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, ldapResultAddReferral ) ); // State: [LDAP_RESULT_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.ADD_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.AUTH_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.COMPARE_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.DEL_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.MODIFY_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.MOD_DN_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_ERROR_MESSAGE_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_DONE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_ERROR_MESSAGE_END, Dsmlv2StatesEnum.SEARCH_RESULT_DONE_END, null ) ); // State: [LDAP_RESULT_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.REFERRAL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, ldapResultAddReferral ) ); // State: [LDAP_RESULT_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.ADD_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.AUTH_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.COMPARE_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.DEL_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.MODIFY_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.MOD_DN_RESPONSE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, null ) ); // State: [LDAP_RESULT_REFERRAL_END] - Tag: super.transitions[Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_DONE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.LDAP_RESULT_REFERRAL_END, Dsmlv2StatesEnum.SEARCH_RESULT_DONE_END, null ) ); //==================================================== // Transitions concerning : SEARCH RESPONSE //==================================================== super.transitions[Dsmlv2StatesEnum.SEARCH_RESPONSE.ordinal()] = new HashMap(); // State: [SEARCH_REPONSE] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESPONSE.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_ENTRY, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESPONSE, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY, searchResultEntryCreation ) ); // State: [SEARCH_REPONSE] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESPONSE.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_REFERENCE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESPONSE, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE, searchResultReferenceCreation ) ); // State: [SEARCH_REPONSE] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESPONSE.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_DONE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESPONSE, Dsmlv2StatesEnum.LDAP_RESULT, searchResultDoneCreation ) ); //==================================================== // Transitions concerning : SEARCH RESULT ENTRY //==================================================== super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_START.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_VALUE_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_START.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_VALUE_END.ordinal()] = new HashMap(); // State: [SEARCH_RESULT_ENTRY] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_START, searchResultEntryControlCreation ) ); // State: [SEARCH_RESULT_ENTRY] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY.ordinal()].put( new Tag( DsmlLiterals.ATTR, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_START, searchResultEntryAddAttr ) ); // State: [SEARCH_RESULT_ENTRY] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_ENTRY, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_LOOP, null ) ); // State: [SEARCH_RESULT_ENTRY_CONTROL_START] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_START.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_START, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_VALUE_END, searchResultEntryControlValueCreation ) ); // State: [SEARCH_RESULT_ENTRY_CONTROL_VALUE_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_VALUE_END.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_VALUE_END, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_END, null ) ); // State: [SEARCH_RESULT_ENTRY_CONTROL_START] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_START.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_START, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_END, null ) ); // State: [SEARCH_RESULT_ENTRY_CONTROL_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_END.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_END, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_START, searchResultEntryControlCreation ) ); // State: [SEARCH_RESULT_ENTRY_CONTROL_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_END.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_ENTRY, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_END, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_LOOP, null ) ); // State: [SEARCH_RESULT_ENTRY_CONTROL_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_END.ordinal()].put( new Tag( DsmlLiterals.ATTR, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_CONTROL_END, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_START, null ) ); // State: [SEARCH_RESULT_ENTRY_ATTR_START] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_START.ordinal()].put( new Tag( DsmlLiterals.ATTR, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_START, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_END, null ) ); // State: [SEARCH_RESULT_ENTRY_ATTR_START] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_START.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_START, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_VALUE_END, searchResultEntryAddValue ) ); // State: [SEARCH_RESULT_ENTRY_ATTR_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_END.ordinal()].put( new Tag( DsmlLiterals.ATTR, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_END, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_START, searchResultEntryAddAttr ) ); // State: [SEARCH_RESULT_ENTRY_ATTR_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_END.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_ENTRY, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_END, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_LOOP, null ) ); // State: [SEARCH_RESULT_ENTRY_VALUE_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_VALUE_END.ordinal()].put( new Tag( DsmlLiterals.VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_VALUE_END, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_VALUE_END, searchResultEntryAddValue ) ); // State: [SEARCH_RESULT_ENTRY_VALUE_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_VALUE_END.ordinal()].put( new Tag( DsmlLiterals.ATTR, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_VALUE_END, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_ATTR_END, null ) ); //==================================================== // Transitions concerning : SEARCH RESULT ENTRY LOOP //==================================================== super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_LOOP.ordinal()] = new HashMap(); // State: [SEARCH_RESULT_ENTRY_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_LOOP.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_ENTRY, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_LOOP, Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY, searchResultEntryCreation ) ); // State: [SEARCH_RESULT_ENTRY_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_LOOP.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_REFERENCE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_LOOP, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE, searchResultReferenceCreation ) ); // State: [SEARCH_RESULT_ENTRY_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_LOOP.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_DONE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_ENTRY_LOOP, Dsmlv2StatesEnum.LDAP_RESULT, searchResultDoneCreation ) ); //==================================================== // Transitions concerning : SEARCH RESULT REFERENCE //==================================================== super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_START.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_VALUE_END.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_REF_END.ordinal()] = new HashMap(); // State: [SEARCH_RESULT_REFERENCE] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_START, searchResultReferenceControlCreation ) ); // State: [SEARCH_RESULT_REFERENCE] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE.ordinal()].put( new Tag( DsmlLiterals.REF, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_REF_END, searchResultReferenceAddRef ) ); // State: [SEARCH_RESULT_REFERENCE_CONTROL_START] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_START.ordinal()].put( new Tag( DsmlLiterals.CONTROL_VALUE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_START, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_VALUE_END, searchResultReferenceControlValueCreation ) ); // State: [sEARCH_RESULT_REFERENCE_CONTROL_VALUE_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_VALUE_END.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_VALUE_END, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_END, null ) ); // State: [SEARCH_RESULT_REFERENCE_CONTROL_START] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_START.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_START, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_END, null ) ); // State: [SEARCH_RESULT_REFERENCE_CONTROL_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_END.ordinal()].put( new Tag( DsmlLiterals.CONTROL, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_END, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_START, searchResultReferenceControlCreation ) ); // State: [SEARCH_RESULT_REFERENCE_CONTROL_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_END.ordinal()].put( new Tag( DsmlLiterals.REF, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_CONTROL_END, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_REF_END, searchResultReferenceAddRef ) ); // State: [SEARCH_RESULT_REFERENCE_REF_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_REF_END.ordinal()].put( new Tag( DsmlLiterals.REF, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_REF_END, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_REF_END, searchResultReferenceAddRef ) ); // State: [SEARCH_RESULT_REFERENCE_REF_END] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_REF_END.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_REFERENCE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_REF_END, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_LOOP, null ) ); //========================================================== // Transitions concerning : SEARCH RESULT REFERENCE LOOP //========================================================== super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_LOOP.ordinal()] = new HashMap(); // State: [SEARCH_RESULT_REFERENCE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_LOOP.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_REFERENCE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_LOOP, Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE, searchResultReferenceCreation ) ); // State: [SEARCH_RESULT_REFERENCE_LOOP] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_LOOP.ordinal()].put( new Tag( DsmlLiterals.SEARCH_RESULT_DONE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_RESULT_REFERENCE_LOOP, Dsmlv2StatesEnum.LDAP_RESULT, searchResultDoneCreation ) ); //------------------------------------------ handle SOAP envelopes -------------------------- super.transitions[Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SOAP_BODY_START_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.SOAP_BODY_END_TAG.ordinal()] = new HashMap(); super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()] = new HashMap(); // State: [INIT_GRAMMAR_STATE] - Tag: super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE.ordinal()].put( new Tag( DsmlLiterals.ENVELOPE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE, Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG, null ) ); // state: [SOAP_ENVELOPE_START_TAG] -> Tag:
super.transitions[Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG.ordinal()].put( new Tag( DsmlLiterals.HEADER, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG, Dsmlv2StatesEnum.SOAP_HEADER_START_TAG, ParserUtils.READ_SOAP_HEADER ) ); // state: [SOAP_HEADER_START_TAG] -> Tag:
super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_START_TAG.ordinal()] .put( new Tag( DsmlLiterals.HEADER, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SOAP_HEADER_START_TAG, Dsmlv2StatesEnum.SOAP_HEADER_END_TAG, null ) ); // state: [SOAP_HEADER_END_TAG] -> Tag: super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_END_TAG.ordinal()].put( new Tag( DsmlLiterals.BODY, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SOAP_HEADER_END_TAG, Dsmlv2StatesEnum.SOAP_BODY_START_TAG, null ) ); // state: [SOAP_BODY_START_TAG] -> Tag: super.transitions[Dsmlv2StatesEnum.SOAP_BODY_START_TAG.ordinal()].put( new Tag( DsmlLiterals.BATCH_RESPONSE, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SOAP_BODY_START_TAG, Dsmlv2StatesEnum.BATCH_RESPONSE_LOOP, batchResponseCreation ) ); // the optional transition if no soap header is present // state: [SOAP_ENVELOPE_START_TAG] -> Tag: super.transitions[Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG.ordinal()] .put( new Tag( DsmlLiterals.BODY, Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG, Dsmlv2StatesEnum.SOAP_BODY_START_TAG, null ) ); // the below two transitions are a bit unconventional, technically the container's state is set to GRAMMAR_END // when the tag is encountered by the parser and the corresponding action gets executed but in // a SOAP envelop we still have two more end tags( and
) are left so we set those corresponding // current and next transition states always to GRAMMAR_END super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()].put( new Tag( DsmlLiterals.BODY, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.GRAMMAR_END, Dsmlv2StatesEnum.GRAMMAR_END, null ) ); super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()].put( new Tag( DsmlLiterals.ENVELOPE, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.GRAMMAR_END, Dsmlv2StatesEnum.GRAMMAR_END, null ) ); //------------------------------------------ } /** * Get the instance of this grammar * * @return * an instance on this grammar */ public static Dsmlv2ResponseGrammar getInstance() { return instance; } /** * Creates a Control Value parsing the current node and adds it to the given parent * @param container the DSMLv2Container * @param parent the parent * @throws XmlPullParserException When the parsing fails */ private void createAndAddControlValue( Dsmlv2Container container, AbstractDsmlMessageDecorator parent ) throws XmlPullParserException { DsmlControl control = parent.getCurrentControl(); XmlPullParser xpp = container.getParser(); try { // We have to catch the type Attribute Value before going to the next Text node String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp ); // Getting the value String nextText = xpp.nextText(); if ( !Strings.isEmpty( nextText ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { control.setValue( ParserUtils.base64Decode( xpp, nextText.trim() ) ); } else { control.setValue( Strings.getBytesUtf8( nextText.trim() ) ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe ); } } /** * Creates a Control parsing the current node and adds it to the given parent * @param container the DSMLv2Container * @param parent the parent * @throws XmlPullParserException When the parsing fails */ private void createAndAddControl( Dsmlv2Container container, AbstractDsmlMessageDecorator parent ) throws XmlPullParserException { Control control; XmlPullParser xpp = container.getParser(); // Checking and adding the Control's attributes String attributeValue; // TYPE attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.TYPE ); if ( attributeValue != null ) { if ( !Oid.isOid( attributeValue ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03006_INCORRECT_TYPE_ATTRIBUTE_VALUE ), xpp, null ); } ControlFactory factory = container.getLdapCodecService(). getRequestControlFactories().get( attributeValue ); if ( factory == null ) { control = new OpaqueControl( attributeValue ); } else { control = factory.newControl(); } parent.addControl( control ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03005_REQUIRE_ATTRIBUTE_TYPE ), xpp, null ); } // CRITICALITY attributeValue = xpp.getAttributeValue( Strings.EMPTY_STRING, DsmlLiterals.CRITICALITY ); if ( attributeValue != null ) { if ( DsmlLiterals.TRUE.equals( attributeValue ) ) { control.setCritical( true ); } else if ( DsmlLiterals.FALSE.equals( attributeValue ) ) { control.setCritical( false ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03007_INCORRECT_CRITICALITY_VALUE ), xpp, null ); } } } } ErrorResponse.java000066400000000000000000000167461525525160600374200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.dsmlv2.DsmlDecorator; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.AbstractResponse; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.Response; import org.apache.directory.api.util.Strings; import org.dom4j.Element; import org.dom4j.tree.DefaultElement; /** * Class representing Error Response. *
* An Error Response has a requestID, a message, and a type which can be : *
    *
  • NOT_ATTEMPTED,
  • *
  • COULD_NOT_CONNECT,
  • *
  • CONNECTION_CLOSED,
  • *
  • MALFORMED_REQUEST,
  • *
  • GATEWAY_INTERNAL_ERROR,
  • *
  • AUTHENTICATION_FAILED,
  • *
  • UNRESOLVABLE_URI,
  • *
  • OTHER
  • *
* * TODO review this class - maybe it should not be decorated and if it is * it should extend AbstractResultResponseDsml - by Alex * * @author Apache Directory Project */ public class ErrorResponse extends AbstractResponse implements Response, DsmlDecorator { /** * This enum represents the different types of error response * * @author Apache Directory Project */ public enum ErrorResponseType { /** Not attempted error response type. */ NOT_ATTEMPTED, /** Could not connect error response type. */ COULD_NOT_CONNECT, /** error response type. */ CONNECTION_CLOSED, /** Malformed request error response type. */ MALFORMED_REQUEST, /** Gateway internal error error response type. */ GATEWAY_INTERNAL_ERROR, /** Authentication failed error response type. */ AUTHENTICATION_FAILED, /** Unresolveable URI error response type. */ UNRESOLVABLE_URI, /** Other error response type. */ OTHER } /** The type of error response */ private ErrorResponseType errorType; /** The associated message */ private String message; /** The request ID */ private int requestID; /** * Creates a new instance of ErrorResponse. * * @param id the response eliciting this Request * @param type the message type of the response */ public ErrorResponse( int id, MessageTypeEnum type ) { super( id, type ); } /** * Creates a new instance of ErrorResponse. * * @param requestID * the requestID of the response * @param type * the type of the response * @param message * the associated message */ public ErrorResponse( int requestID, ErrorResponseType type, String message ) { super( requestID, null ); this.requestID = requestID; this.errorType = type; this.message = message; } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.ERROR_RESPONSE ); } else { element = new DefaultElement( DsmlLiterals.ERROR_RESPONSE ); } // RequestID if ( requestID != 0 ) { element.addAttribute( DsmlLiterals.REQUEST_ID, Integer.toString( requestID ) ); } // Type element.addAttribute( DsmlLiterals.TYPE, getTypeDescr( errorType ) ); // TODO Add Detail if ( Strings.isNotEmpty( message ) ) { Element messageElement = element.addElement( DsmlLiterals.MESSAGE ); messageElement.addText( message ); } return element; } /** * Returns the String associated to the error response type * * @param type * the error response type * @return * the corresponding String */ public String getTypeDescr( ErrorResponseType type ) { if ( type.equals( ErrorResponseType.NOT_ATTEMPTED ) ) { return "notAttempted"; } else if ( type.equals( ErrorResponseType.COULD_NOT_CONNECT ) ) { return "couldNotConnect"; } else if ( type.equals( ErrorResponseType.CONNECTION_CLOSED ) ) { return "connectionClosed"; } else if ( type.equals( ErrorResponseType.MALFORMED_REQUEST ) ) { return "malformedRequest"; } else if ( type.equals( ErrorResponseType.GATEWAY_INTERNAL_ERROR ) ) { return "gatewayInternalError"; } else if ( type.equals( ErrorResponseType.AUTHENTICATION_FAILED ) ) { return "authenticationFailed"; } else if ( type.equals( ErrorResponseType.UNRESOLVABLE_URI ) ) { return "unresolvableURI"; } else if ( type.equals( ErrorResponseType.OTHER ) ) { return "other"; } else { return "unknown"; } } /** * Gets the message * * @return * the message */ public String getMessage() { return message; } /** * Sets the message * * @param message * the message to set */ public void setMessage( String message ) { this.message = message; } /** * Gets the request ID * * @return * the request ID */ public int getRequestID() { return requestID; } /** * Sets the request ID * * @param requestID * the request ID to set */ public void setRequestID( int requestID ) { this.requestID = requestID; } /** * Gets the type of error response * * @return the type of error response */ public ErrorResponseType getErrorType() { return errorType; } /** * Sets the type of error response * * @param errorType the type of error response to set */ public void setErrorType( ErrorResponseType errorType ) { this.errorType = errorType; } /** * Get the LdapApiService instance * * @return The LdapApiService instance */ public LdapApiService getCodecService() { throw new IllegalArgumentException( I18n.err( I18n.ERR_03044_SHOULD_NOT_BE_A_DECORATOR ) ); } /** * {@inheritDoc} */ @Override public Response getDecorated() { return this; } } ExtendedResponseDsml.java000066400000000000000000000126711525525160600407000ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.commons.text.StringEscapeUtils; import org.apache.directory.api.asn1.util.Oid; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.ExtendedResponse; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.OpaqueExtendedResponse; import org.apache.directory.api.util.Strings; import org.dom4j.Element; import org.dom4j.Namespace; import org.dom4j.QName; import org.dom4j.tree.DefaultElement; /** * DSML Decorator for ExtendedResponse * * @author Apache Directory Project */ public class ExtendedResponseDsml extends AbstractResultResponseDsml implements ExtendedResponse { private byte[] response; /** * Creates a new getDecoratedMessage() of ExtendedResponseDsml. * * @param codec The LDAP Service to use */ public ExtendedResponseDsml( LdapApiService codec ) { super( codec, new OpaqueExtendedResponse( Strings.EMPTY_STRING ) ); } /** * Creates a new getDecoratedMessage() of ExtendedResponseDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public ExtendedResponseDsml( LdapApiService codec, ExtendedResponse ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.EXTENDED_RESPONSE ); } else { element = new DefaultElement( DsmlLiterals.EXTENDED_RESPONSE ); } ExtendedResponse extendedResponse = getDecorated(); // LDAP Result LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); // ResponseName String responseName = extendedResponse.getResponseName(); if ( responseName != null ) { element.addElement( DsmlLiterals.RESPONSE_NAME ).addText( responseName ); } // Response Object responseValue = getResponseValue(); if ( responseValue != null ) { if ( ParserUtils.needsBase64Encoding( responseValue ) ) { Namespace xsdNamespace = new Namespace( ParserUtils.XSD, ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( ParserUtils.XSI, ParserUtils.XML_SCHEMA_INSTANCE_URI ); element.getDocument().getRootElement().add( xsdNamespace ); element.getDocument().getRootElement().add( xsiNamespace ); Element responseElement = element.addElement( DsmlLiterals.RESPONSE ) .addText( ParserUtils.base64Encode( responseValue ) ); responseElement.addAttribute( new QName( DsmlLiterals.TYPE, xsiNamespace ), ParserUtils.XSD_COLON + ParserUtils.BASE64BINARY ); } else { element.addElement( DsmlLiterals.RESPONSE ).addText( StringEscapeUtils.escapeXml11( Strings.utf8ToString( ( byte[] ) responseValue ) ) ); } } return element; } /** * {@inheritDoc} */ @Override public void setResponseName( String oid ) { getDecorated().setResponseName( oid ); } /** * Get the extended response name * * @return Returns the name. */ @Override public String getResponseName() { return getDecorated().getResponseName(); } /** * Set the extended response name * * @param responseName The name to set. */ public void setResponseName( Oid responseName ) { getDecorated().setResponseName( responseName.toString() ); } /** * Get the extended response * * @return Returns the response. */ public byte[] getResponseValue() { return this.response; } /** * Set the extended response * * @param responseValue The response to set. */ public void setResponseValue( byte[] responseValue ) { this.response = responseValue; } } LdapResultDsml.java000066400000000000000000000144441525525160600375000ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import java.util.Collection; import java.util.List; import org.apache.directory.api.dsmlv2.DsmlDecorator; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.Message; import org.apache.directory.api.ldap.model.message.Referral; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.dom4j.Element; /** * DSML Decorator for the LdapResult class. * * @author Apache Directory Project */ public class LdapResultDsml implements DsmlDecorator, LdapResult { /** The LDAP Result to decorate */ private LdapResult result; /** The associated LDAP Message */ private Message message; /** The ldap codec service */ private LdapApiService codec; /** * Creates a new instance of LdapResultDsml. * * @param codec The LDAP Service to use * @param result the LdapResult to decorate * @param message the associated message */ public LdapResultDsml( LdapApiService codec, LdapResult result, Message message ) { this.codec = codec; this.result = result; this.message = message; } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { // RequestID int requestID = message.getMessageId(); if ( requestID > 0 ) { root.addAttribute( DsmlLiterals.REQUEST_ID, Integer.toString( requestID ) ); } // Matched Dn Dn matchedDn = result.getMatchedDn(); if ( !Dn.isNullOrEmpty( matchedDn ) ) { root.addAttribute( DsmlLiterals.MATCHED_DN, matchedDn.getName() ); } // Controls ParserUtils.addControls( codec, root, message.getControls().values(), false ); // ResultCode Element resultCodeElement = root.addElement( DsmlLiterals.RESULT_CODE ); resultCodeElement.addAttribute( DsmlLiterals.CODE, Integer.toString( result.getResultCode().getResultCode() ) ); resultCodeElement.addAttribute( DsmlLiterals.DESCR, result.getResultCode().getMessage() ); // ErrorMessage String errorMessage = result.getDiagnosticMessage(); if ( ( errorMessage != null ) && ( errorMessage.length() != 0 ) ) { Element errorMessageElement = root.addElement( DsmlLiterals.ERROR_MESSAGE ); errorMessageElement.addText( errorMessage ); } // Referrals Referral referral = result.getReferral(); if ( referral != null ) { Collection ldapUrls = referral.getLdapUrls(); if ( ldapUrls != null ) { for ( String ldapUrl : ldapUrls ) { Element referalElement = root.addElement( DsmlLiterals.REFERRAL ); referalElement.addText( ldapUrl ); } } } return root; } /** * {@inheritDoc} */ @Override public String getDiagnosticMessage() { return result.getDiagnosticMessage(); } /** * {@inheritDoc} */ @Override public void setDiagnosticMessage( String diagnosticMessage ) { result.setDiagnosticMessage( diagnosticMessage ); } /** * Get the matched Dn * * @return Returns the matchedDN. */ @Override public Dn getMatchedDn() { return result.getMatchedDn(); } /** * Set the Matched Dn * * @param matchedDn The matchedDn to set. */ @Override public void setMatchedDn( Dn matchedDn ) { result.setMatchedDn( matchedDn ); } /** * Get the referrals * * @return Returns the referrals. */ public List getReferrals() { return ( List ) result.getReferral().getLdapUrls(); } /** * Add a referral * * @param referral The referral to add. */ public void addReferral( LdapUrl referral ) { result.getReferral().addLdapUrl( referral.toString() ); } /** * Get the result code * * @return Returns the resultCode. */ @Override public ResultCodeEnum getResultCode() { return result.getResultCode(); } /** * Set the result code * * @param resultCode The resultCode to set. */ @Override public void setResultCode( ResultCodeEnum resultCode ) { result.setResultCode( resultCode ); } /** * {@inheritDoc} */ @Override public LdapResult getDecorated() { return result; } /** * {@inheritDoc} */ @Override public boolean isReferral() { return getDecorated().isReferral(); } /** * {@inheritDoc} */ @Override public Referral getReferral() { return getDecorated().getReferral(); } /** * {@inheritDoc} */ @Override public void setReferral( Referral referral ) { getDecorated().setReferral( referral ); } /** * {@inheritDoc} */ @Override public boolean isDefaultSuccess() { return false; } } ModDNResponseDsml.java000066400000000000000000000053631525525160600401010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.ModifyDnResponse; import org.apache.directory.api.ldap.model.message.ModifyDnResponseImpl; import org.dom4j.Element; import org.dom4j.tree.DefaultElement; /** * DSML Decorator for ModDNResponse * * @author Apache Directory Project */ public class ModDNResponseDsml extends AbstractResultResponseDsml implements ModifyDnResponse { /** * Creates a new getDecoratedMessage() of ModDNResponseDsml. * * @param codec The LDAP Service to use */ public ModDNResponseDsml( LdapApiService codec ) { super( codec, new ModifyDnResponseImpl() ); } /** * Creates a new getDecoratedMessage() of ModDNResponseDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public ModDNResponseDsml( LdapApiService codec, ModifyDnResponse ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.MOD_DN_RESPONSE ); } else { element = new DefaultElement( DsmlLiterals.MOD_DN_RESPONSE ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } } ModifyResponseDsml.java000066400000000000000000000053541525525160600403670ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.ModifyResponse; import org.apache.directory.api.ldap.model.message.ModifyResponseImpl; import org.dom4j.Element; import org.dom4j.tree.DefaultElement; /** * DSML Decorator for ModifyResponse * * @author Apache Directory Project */ public class ModifyResponseDsml extends AbstractResultResponseDsml implements ModifyResponse { /** * Creates a new getDecoratedMessage() of ModifyResponseDsml. * * @param codec The LDAP Service to use */ public ModifyResponseDsml( LdapApiService codec ) { super( codec, new ModifyResponseImpl() ); } /** * Creates a new getDecoratedMessage() of ModifyResponseDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public ModifyResponseDsml( LdapApiService codec, ModifyResponse ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.MODIFY_RESPONSE ); } else { element = new DefaultElement( DsmlLiterals.MODIFY_RESPONSE ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } } SearchResponse.java000066400000000000000000000127351525525160600375260ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import java.util.ArrayList; import java.util.List; import org.apache.directory.api.ldap.model.message.AbstractResponse; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; /** * This class represents the DSML Search Response * * @author Apache Directory Project */ public class SearchResponse extends AbstractResponse { /** The List of contained Search Result Entries */ private List searchResultEntryList = new ArrayList<>(); /** The List of contained Search Result References */ private List searchResultReferenceList = new ArrayList<>(); /** The Search Result Done object */ private SearchResultDoneDsml searchResultDone; /** * Creates a new instance of SearchResponse. */ public SearchResponse() { super( -1, null ); } /** * Creates a new instance of SearchResponse. * * @param messageId the response eliciting this Request */ public SearchResponse( int messageId ) { super( messageId, null ); } /** * Adds a Search Result Entry * * @param searchResultEntry * the Search Result Entry to add * @return * true (as per the general contract of the Collection.add method) */ public boolean addSearchResultEntry( SearchResultEntryDsml searchResultEntry ) { return searchResultEntryList.add( searchResultEntry ); } /** * Removes a Search Result Entry * * @param searchResultEntry * the Search Result Entry to remove * @return * true (as per the general contract of the Collection.remove method) */ public boolean removeSearchResultEntry( SearchResultEntryDsml searchResultEntry ) { return searchResultEntryList.remove( searchResultEntry ); } /** * Gets the Current Search Result Entry * * @return * the current Searche Result Entry */ public SearchResultEntryDsml getCurrentSearchResultEntry() { if ( !searchResultEntryList.isEmpty() ) { return searchResultEntryList.get( searchResultEntryList.size() - 1 ); } else { return null; } } /** * Gets the Search Result Entry List * * @return * the Search Result Entry List */ public List getSearchResultEntryList() { return searchResultEntryList; } /** * Adds a Search Result Reference * * @param searchResultReference * the Search Result Reference to add * @return * true (as per the general contract of the Collection.add method) */ public boolean addSearchResultReference( SearchResultReferenceDsml searchResultReference ) { return searchResultReferenceList.add( searchResultReference ); } /** * Removes a Search Result Reference * * @param searchResultReference * the Search Result Reference to remove * @return * true (as per the general contract of the Collection.remove method) */ public boolean removeSearchResultReference( SearchResultReferenceDsml searchResultReference ) { return searchResultReferenceList.remove( searchResultReference ); } /** * Gets the current Search Result Reference * * @return * the current Search Result Reference */ public SearchResultReferenceDsml getCurrentSearchResultReference() { if ( !searchResultReferenceList.isEmpty() ) { return searchResultReferenceList.get( searchResultReferenceList.size() - 1 ); } else { return null; } } /** * Gets the Search Result Reference List * * @return * the Search Result Reference List */ public List getSearchResultReferenceList() { return searchResultReferenceList; } /** * Gets the Search Result Entry * * @return * the Search Result Entry */ public SearchResultDoneDsml getSearchResultDone() { return searchResultDone; } /** * Sets the Search Result Entry * * @param searchResultDone * the Search Result Entry to set */ public void setSearchResultDone( SearchResultDoneDsml searchResultDone ) { this.searchResultDone = searchResultDone; } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return null; } } SearchResponseDsml.java000066400000000000000000000130211525525160600403330ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import java.util.ArrayList; import java.util.List; import org.apache.directory.api.dsmlv2.DsmlDecorator; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.i18n.I18n; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.Message; import org.apache.directory.api.ldap.model.message.Response; import org.apache.directory.api.ldap.model.message.SearchResultDone; import org.apache.directory.api.ldap.model.message.SearchResultEntry; import org.apache.directory.api.ldap.model.message.SearchResultReference; import org.dom4j.Element; import org.dom4j.tree.DefaultElement; /** * This class represents the Search Response Dsml Container. * It is used to store Search Responses (Search Result Entry, * Search Result Reference and SearchResultDone). * * @author Apache Directory Project */ public class SearchResponseDsml extends AbstractResponseDsml { /** The responses */ private List> responses = new ArrayList<>(); /** * Creates a new getDecoratedMessage() of SearchResponseDsml. * * @param codec The LDAP Service to use */ public SearchResponseDsml( LdapApiService codec ) { super( codec, new SearchResponse() ); } /** * Creates a new getDecoratedMessage() of SearchResponseDsml. * * @param codec The LDAP Service to use * @param response the LDAP response message to decorate */ public SearchResponseDsml( LdapApiService codec, Message response ) { super( codec, ( Response ) response ); } /** * Adds a response. * * @param response * the response to add * @return * true (as per the general contract of the Collection.add method). */ public boolean addResponse( DsmlDecorator response ) { if ( response instanceof SearchResultEntry ) { ( ( SearchResponse ) getDecorated() ).addSearchResultEntry( ( SearchResultEntryDsml ) response ); } else if ( response instanceof SearchResultReference ) { ( ( SearchResponse ) getDecorated() ).addSearchResultReference( ( SearchResultReferenceDsml ) response ); } else if ( response instanceof SearchResultDone ) { ( ( SearchResponse ) getDecorated() ).setSearchResultDone( ( SearchResultDoneDsml ) response ); } else { throw new IllegalArgumentException( I18n.err( I18n.ERR_03045_UNIDENTIFIED_RESPONSE_TYPE ) ); } return responses.add( response ); } /** * Removes a response. * * @param response * the response to remove * @return * true if this list contained the specified element. */ public boolean removeResponse( DsmlDecorator response ) { if ( response instanceof SearchResultEntry ) { ( ( SearchResponse ) getDecorated() ).removeSearchResultEntry( ( SearchResultEntryDsml ) response ); } else if ( response instanceof SearchResultReference ) { ( ( SearchResponse ) getDecorated() ).removeSearchResultReference( ( SearchResultReferenceDsml ) response ); } else if ( response instanceof SearchResultDone ) { if ( response.equals( ( ( SearchResponse ) getDecorated() ).getSearchResultDone() ) ) { ( ( SearchResponse ) getDecorated() ).setSearchResultDone( null ); } } else { throw new IllegalArgumentException( I18n.err( I18n.ERR_03045_UNIDENTIFIED_RESPONSE_TYPE ) ); } return responses.remove( response ); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.SEARCH_RESPONSE ); } else { element = new DefaultElement( DsmlLiterals.SEARCH_RESPONSE ); } // RequestID if ( getDecorated() != null ) { int requestID = getDecorated().getMessageId(); if ( requestID > 0 ) { element.addAttribute( DsmlLiterals.REQUEST_ID, Integer.toString( requestID ) ); } } for ( DsmlDecorator response : responses ) { response.toDsml( element ); } return element; } } SearchResultDoneDsml.java000066400000000000000000000054241525525160600406310ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.SearchResultDone; import org.apache.directory.api.ldap.model.message.SearchResultDoneImpl; import org.dom4j.Element; import org.dom4j.tree.DefaultElement; /** * DSML Decorator for SearchResultDone * * @author Apache Directory Project */ public class SearchResultDoneDsml extends AbstractResultResponseDsml implements SearchResultDone { /** * Creates a new getDecoratedMessage() of SearchResultDoneDsml. * * @param codec The LDAP Service to use */ public SearchResultDoneDsml( LdapApiService codec ) { super( codec, new SearchResultDoneImpl() ); } /** * Creates a new getDecoratedMessage() of SearchResultDoneDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public SearchResultDoneDsml( LdapApiService codec, SearchResultDone ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.SEARCH_RESULT_DONE ); } else { element = new DefaultElement( DsmlLiterals.SEARCH_RESULT_DONE ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } } SearchResultEntryDsml.java000066400000000000000000000151431525525160600410440ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.commons.text.StringEscapeUtils; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.entry.Attribute; import org.apache.directory.api.ldap.model.entry.DefaultAttribute; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.SearchResultEntry; import org.apache.directory.api.ldap.model.message.SearchResultEntryImpl; import org.apache.directory.api.ldap.model.name.Dn; import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.Namespace; import org.dom4j.QName; import org.dom4j.tree.DefaultElement; /** * DSML Decorator for SearchResultEntry * * @author Apache Directory Project */ public class SearchResultEntryDsml extends AbstractResponseDsml implements SearchResultEntry { /** The current attribute being processed */ private Attribute currentAttribute; /** * Creates a new getDecoratedMessage() of SearchResultEntryDsml. * * @param codec The LDAP Service to use */ public SearchResultEntryDsml( LdapApiService codec ) { super( codec, new SearchResultEntryImpl() ); } /** * Creates a new getDecoratedMessage() of SearchResultEntryDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public SearchResultEntryDsml( LdapApiService codec, SearchResultEntry ldapMessage ) { super( codec, ldapMessage ); } /** * Get the current attributeType * * @return The current AttributeType */ public Attribute getCurrentAttribute() { return currentAttribute; } /** * Create a new attribute * * @param type The attribute's type * @throws LdapException If we can't add the new attributeType */ public void addAttribute( String type ) throws LdapException { currentAttribute = new DefaultAttribute( type ); getDecorated().getEntry().put( currentAttribute ); } /** * Add a new value to the current attribute * * @param value The added value * @throws LdapException If we can't add the new attributeType */ public void addAttributeValue( Object value ) throws LdapException { if ( value instanceof String ) { currentAttribute.add( ( String ) value ); } else { currentAttribute.add( ( byte[] ) value ); } } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.SEARCH_RESULT_ENTRY ); } else { element = new DefaultElement( DsmlLiterals.SEARCH_RESULT_ENTRY ); } SearchResultEntry searchResultEntry = getDecorated(); element.addAttribute( DsmlLiterals.DN, searchResultEntry.getObjectName().getName() ); Entry entry = searchResultEntry.getEntry(); for ( Attribute attribute : entry ) { Element attributeElement = element.addElement( DsmlLiterals.ATTR ); attributeElement.addAttribute( DsmlLiterals.NAME, attribute.getUpId() ); for ( Value value : attribute ) { if ( value.isHumanReadable() ) { attributeElement.addElement( DsmlLiterals.VALUE ).addText( StringEscapeUtils.escapeXml11( value.getString() ) ); } else { Namespace xsdNamespace = new Namespace( ParserUtils.XSD, ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( ParserUtils.XSI, ParserUtils.XML_SCHEMA_INSTANCE_URI ); Document doc = attributeElement.getDocument(); if ( doc != null ) { Element docRoot = doc.getRootElement(); docRoot.add( xsdNamespace ); docRoot.add( xsiNamespace ); } Element valueElement = attributeElement.addElement( DsmlLiterals.VALUE ).addText( ParserUtils.base64Encode( value.getBytes() ) ); valueElement.addAttribute( new QName( DsmlLiterals.TYPE, xsiNamespace ), ParserUtils.XSD_COLON + ParserUtils.BASE64BINARY ); } } } return element; } /** * Get the entry Dn * * @return Returns the objectName. */ @Override public Dn getObjectName() { return getDecorated().getObjectName(); } /** * Set the entry Dn * * @param objectName The objectName to set. */ @Override public void setObjectName( Dn objectName ) { getDecorated().setObjectName( objectName ); } /** * Get the entry. * * @return Returns the entry. */ @Override public Entry getEntry() { return getDecorated().getEntry(); } /** * Initialize the entry. * * @param entry the entry */ @Override public void setEntry( Entry entry ) { getDecorated().setEntry( entry ); } } SearchResultReferenceDsml.java000066400000000000000000000074711525525160600416460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.response; import java.util.Collection; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; import org.apache.directory.api.ldap.model.message.Referral; import org.apache.directory.api.ldap.model.message.SearchResultReference; import org.apache.directory.api.ldap.model.message.SearchResultReferenceImpl; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.dom4j.Element; import org.dom4j.tree.DefaultElement; /** * DSML Decorator for SearchResultReference * * @author Apache Directory Project */ public class SearchResultReferenceDsml extends AbstractResponseDsml implements SearchResultReference { /** * Creates a new getDecoratedMessage() of SearchResultReferenceDsml. * * @param codec The LDAP Service to use */ public SearchResultReferenceDsml( LdapApiService codec ) { super( codec, new SearchResultReferenceImpl() ); } /** * Creates a new getDecoratedMessage() of SearchResultReferenceDsml. * * @param codec The LDAP Service to use * @param ldapMessage the message to decorate */ public SearchResultReferenceDsml( LdapApiService codec, SearchResultReference ldapMessage ) { super( codec, ldapMessage ); } /** * {@inheritDoc} */ @Override public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( DsmlLiterals.SEARCH_RESULT_REFERENCE ); } else { element = new DefaultElement( DsmlLiterals.SEARCH_RESULT_REFERENCE ); } // Adding References for ( String url : getDecorated().getReferral().getLdapUrls() ) { element.addElement( DsmlLiterals.REF ).addText( url ); } return element; } /** * Add a new reference to the list. * * @param searchResultReference The search result reference */ public void addSearchResultReference( LdapUrl searchResultReference ) { getDecorated().getReferral().addLdapUrl( searchResultReference.toString() ); } /** * Get the list of references * * @return An ArrayList of SearchResultReferences */ public Collection getSearchResultReferences() { return getDecorated().getReferral().getLdapUrls(); } /** * {@inheritDoc} */ @Override public Referral getReferral() { return getDecorated().getReferral(); } /** * {@inheritDoc} */ @Override public void setReferral( Referral referral ) { getDecorated().setReferral( referral ); } } apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/resources/000077500000000000000000000000001525525160600252455ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/resources/org/000077500000000000000000000000001525525160600260345ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/resources/org/apache/000077500000000000000000000000001525525160600272555ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/resources/org/apache/directory/000077500000000000000000000000001525525160600312615ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/resources/org/apache/directory/shared/000077500000000000000000000000001525525160600325275ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/resources/org/apache/directory/shared/dsmlv2/000077500000000000000000000000001525525160600337365ustar00rootroot00000000000000DSMLv2.xslt000066400000000000000000000032131525525160600356010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/main/resources/org/apache/directory/shared/dsmlv2 apache-directory-ldap-api-cfb3cee/dsml/parser/src/site/000077500000000000000000000000001525525160600232535ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/site/site.xml000066400000000000000000000025151525525160600247440ustar00rootroot00000000000000 apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/000077500000000000000000000000001525525160600232665ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/000077500000000000000000000000001525525160600242075ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/000077500000000000000000000000001525525160600247765ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/000077500000000000000000000000001525525160600262175ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/000077500000000000000000000000001525525160600302235ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/000077500000000000000000000000001525525160600307745ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/000077500000000000000000000000001525525160600322035ustar00rootroot00000000000000AbstractResponseTest.java000066400000000000000000000040171525525160600371130ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import org.xmlpull.v1.XmlPullParserException; /** * This class had to be used to create a Response TestCase * * @author Apache Directory Project */ public abstract class AbstractResponseTest extends AbstractTest { /** * Asserts that parsing throws a correct XmlPullParserException due to an incorrect file * * @param testClass * the Class of the TestCase * @param filename * the path of the xml file to parse */ public void testParsingFail( Class testClass, String filename ) { try { Dsmlv2ResponseParser parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( testClass.getResource( filename ).openStream(), "UTF-8" ); parser.parse(); } catch ( XmlPullParserException e ) { assertTrue( true, e.getMessage() ); return; } catch ( Exception e ) { fail( e.getMessage() ); } fail(); } } AbstractTest.java000066400000000000000000000052031525525160600353720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import org.apache.directory.api.dsmlv2.request.Dsmlv2Grammar; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory; import org.xmlpull.v1.XmlPullParserException; /** * This class had to be used to create a Request TestCase * * @author Apache Directory Project */ public abstract class AbstractTest { /** The LDAP encoder decoder service */ private LdapApiService codec = LdapApiServiceFactory.getSingleton(); private Dsmlv2Grammar grammar = new Dsmlv2Grammar(); public Dsmlv2Parser newParser() throws Exception { return new Dsmlv2Parser( grammar ); } public LdapApiService getCodec() { return codec; } /** * Asserts that parsing throws a correct XmlPullParserException due to an incorrect file * * @param testClass * the Class of the TestCase * @param filename * the path of the xml file to parse */ public void testParsingFail( Class testClass, String filename ) { try { Dsmlv2Parser parser = new Dsmlv2Parser( grammar ); parser.setInput( testClass.getResource( filename ).openStream(), "UTF-8" ); parser.parse(); } catch ( XmlPullParserException e ) { assertTrue( true, e.getMessage() ); return; } catch ( IllegalStateException e ) { assertTrue( true, e.getMessage() ); return; } catch ( Exception e ) { fail( e.getMessage() ); } fail(); } } ParserUtilsTest.java000066400000000000000000000077711525525160600361200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.directory.api.dsmlv2.batchRequest.BatchRequestTest; import org.apache.directory.api.dsmlv2.batchResponse.BatchResponseTest; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml; import org.apache.directory.api.dsmlv2.response.BatchResponseDsml; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for ParserUtils. * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class ParserUtilsTest extends AbstractTest { private static final Pattern NEW_LINE_PATTERN = Pattern.compile( "\n", Pattern.DOTALL ); private static final Pattern INDENTION_PATTERN = Pattern.compile( " ", Pattern.DOTALL ); /** * Test for DIRAPI-238: DSML pretty print does not work, prints error. * * Indirect test of ParserUtils.styleDocument() via BatchRequestDsml.toDsml(). * * @throws Exception If the test failed */ @Test public void testStyleDocumentWithBatchRequest() throws Exception { Dsmlv2Parser parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_2_AddRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); BatchRequestDsml batchRequest = parser.getBatchRequest(); String dsml = batchRequest.toDsml(); assertNotNull( dsml ); assertEquals( 20, countNewlines( dsml ), "Pretty printed DSML should contain newlines" ); assertEquals( 38, countIndention( dsml ), "Pretty printed DSML should contain indention" ); } /** * Test for DIRAPI-238: DSML pretty print does not work, prints error. * * Indirect test of ParserUtils.styleDocument() via BatchResponseDsml.toDsml() * * @throws Exception If the test failed */ @Test public void testStyleDocumentWithBatchResponse() throws Exception { Dsmlv2ResponseParser parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_2_SearchResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); BatchResponseDsml batchResponse = parser.getBatchResponse(); String dsml = batchResponse.toDsml(); assertNotNull( dsml ); assertEquals( 12, countNewlines( dsml ), "Pretty printed DSML should contain newlines" ); assertEquals( 18, countIndention( dsml ), "Pretty printed DSML should contain indention" ); } private int countNewlines( String dsml ) { return count( NEW_LINE_PATTERN, dsml ); } private int countIndention( String dsml ) { return count( INDENTION_PATTERN, dsml ); } private int count( Pattern p, String dsml ) { Matcher matcher = p.matcher( dsml ); int count = 0; while ( matcher.find() ) { count++; } return count; } } abandonRequest/000077500000000000000000000000001525525160600350775ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2AbandonRequestTest.java000066400000000000000000000251031525525160600415160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/abandonRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.abandonRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.dsmlv2.authRequest.AuthRequestTest; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml; import org.apache.directory.api.ldap.model.message.AbandonRequest; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Abandon Request parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class AbandonRequestTest extends AbstractTest { /** * Test parsing of a request without the abandonID attribute */ @Test public void testRequestWithoutAbandonId() { testParsingFail( AbandonRequestTest.class, "request_without_abandonID_attribute.xml" ); } /** * Test parsing of a request with the abandonID attribute */ @Test public void testRequestWithAbandonId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AbandonRequestTest.class.getResource( "request_with_abandonID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 123, abandonRequest.getAbandoned() ); } /** * Test parsing of a request with the (optional) requestID attribute below 0 */ @Test public void testRequestWithRequestIdBelow0() { testParsingFail( AbandonRequestTest.class, "request_with_requestID_below_0.xml" ); } /** * Test parsing of a request with the (optional) requestID attribute */ @Test public void testRequestWithRequestId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AbandonRequestTest.class.getResource( "request_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 456, abandonRequest.getMessageId() ); } /** * Test parsing of a request with a (optional) Control element */ @Test public void testRequestWith1Control() { Dsmlv2Parser parser = null; try { parser = newParser(); parser .setInput( AbandonRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = abandonRequest.getControls(); assertEquals( 1, abandonRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with a (optional) Control element with Base64 value */ @Test public void testRequestWith1ControlBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AbandonRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = abandonRequest.getControls(); assertEquals( 1, abandonRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of an abandon request with an attribute value carrying malformed Base64 : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_REQUEST error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1ControlMalformedBase64Value() { testParsingFail( AuthRequestTest.class, "request_with_1_control_malformed_base64_value.xml" ); } /** * Test parsing of a request with a (optional) Control element with empty value */ @Test public void testRequestWith1ControlEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AbandonRequestTest.class.getResource( "request_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = abandonRequest.getControls(); assertEquals( 1, abandonRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with 2 (optional) Control elements */ @Test public void testRequestWith2Controls() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AbandonRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = abandonRequest.getControls(); assertEquals( 2, abandonRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with 3 (optional) Control elements without value */ @Test public void testRequestWith3ControlsWithoutValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AbandonRequestTest.class.getResource( "request_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = abandonRequest.getControls(); assertEquals( 3, abandonRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with a needed requestID attribute * * DIRSTUDIO-1 */ @Test public void testRequestWithNeededRequestId() { testParsingFail( AbandonRequestTest.class, "request_with_needed_requestID.xml" ); } /** * Test parsing of a request without the abandonID attribute with a value of 0 */ @Test public void testRequestWithoutAbandonId0() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AbandonRequestTest.class.getResource( "request_with_0_abandonID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { e.printStackTrace(); fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 0, batchRequest.getRequestID() ); } } addRequest/000077500000000000000000000000001525525160600342255ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2AddRequestTest.java000066400000000000000000000427031525525160600377770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/addRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.addRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Iterator; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.ldap.model.entry.Attribute; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.message.AddRequest; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Add Request parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class AddRequestTest extends AbstractTest { /** * Test parsing of a request without the dn attribute */ @Test public void testRequestWithoutDn() { testParsingFail( AddRequestTest.class, "request_without_dn_attribute.xml" ); } /** * Test parsing of a request with an attribute value carrying malformed Base64 : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_REQUEST error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1AttrWithMalformedBase64Value() { testParsingFail( AddRequestTest.class, "request_with_1_attr_with_malformed_base64_value.xml" ); } /** * Test parsing of a request with the dn attribute */ @Test public void testRequestWithDn() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_dn_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( addRequest.getEntryDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a request with the (optional) requestID attribute */ @Test public void testRequestWithRequestId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_requestID_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 456, addRequest.getMessageId() ); } /** * Test parsing of a request with the (optional) requestID attribute below 0 */ @Test public void testRequestWithRequestIdEquals0() { testParsingFail( AddRequestTest.class, "request_with_requestID_below_0.xml" ); } /** * Test parsing of a request with a (optional) Control element */ @Test public void testRequestWith1Control() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = addRequest.getControls(); assertEquals( 1, addRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with a (optional) Control element with Base64 value */ @Test public void testRequestWith1ControlBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = addRequest.getControls(); assertEquals( 1, addRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with an attribute value carrying malformed Base64 : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_REQUEST error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1ControlMalformedBase64Value() { testParsingFail( AddRequestTest.class, "request_with_1_control_malformed_base64_value.xml" ); } /** * Test parsing of a request with a (optional) Control element with empty value */ @Test public void testRequestWith1ControlEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_1_control_empty_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = addRequest.getControls(); assertEquals( 1, addRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with 2 (optional) Control elements */ @Test public void testRequestWith2Controls() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = addRequest.getControls(); assertEquals( 2, addRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with 3 (optional) Control elements without value */ @Test public void testRequestWith3ControlsWithoutValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = addRequest.getControls(); assertEquals( 3, addRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with an Attr elements with value */ @Test public void testRequestWith1AttrWithoutValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_1_attr_without_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Entry entry = addRequest.getEntry(); assertEquals( 1, entry.size() ); // Getting the Attribute Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "objectclass", attribute.getUpId() ); // Getting the Value Iterator valueIterator = attribute.iterator(); assertFalse( valueIterator.hasNext() ); } /** * Test parsing of a request with an Attr elements with empty value */ @Test public void testRequestWith1AttrEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_1_attr_empty_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Entry entry = addRequest.getEntry(); assertEquals( 1, entry.size() ); // Getting the Attribute Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "objectclass", attribute.getUpId() ); // Getting the Value Iterator valueIterator = attribute.iterator(); assertFalse( valueIterator.hasNext() ); } /** * Test parsing of a request with an Attr elements with value */ @Test public void testRequestWith1AttrWithValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_1_attr_with_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Entry entry = addRequest.getEntry(); assertEquals( 1, entry.size() ); // Getting the Attribute Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "objectclass", attribute.getUpId() ); // Getting the Value Iterator valueIterator = attribute.iterator(); assertTrue( valueIterator.hasNext() ); Value value = valueIterator.next(); assertEquals( "top", value.getString() ); } /** * Test parsing of a request with an Attr elements with value */ @Test public void testRequestWith1AttrWithBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_1_attr_with_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Entry entry = addRequest.getEntry(); assertEquals( 1, entry.size() ); // Getting the Attribute Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "objectclass", attribute.getUpId() ); // Getting the Value Iterator valueIterator = attribute.iterator(); assertTrue( valueIterator.hasNext() ); Value value = valueIterator.next(); assertFalse( value.isHumanReadable() ); assertEquals( "DSMLv2.0 rocks!!", value.getString() ); } /** * Test parsing of a request with 2 Attr elements with value */ @Test public void testRequestWith2AttrWithValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_2_attr_with_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Entry entry = addRequest.getEntry(); assertEquals( 1, entry.size() ); // Getting the Attribute Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "objectclass", attribute.getUpId() ); // Getting the Value Iterator valueIterator = attribute.iterator(); assertTrue( valueIterator.hasNext() ); Value value = valueIterator.next(); assertEquals( "top", value.getString() ); assertTrue( valueIterator.hasNext() ); value = valueIterator.next(); assertEquals( "person", value.getString() ); assertFalse( valueIterator.hasNext() ); } /** * Test parsing of a request with 1 Attr element without attribute value */ @Test public void testRequestWith1AttrWithoutNameAttribute() { testParsingFail( AddRequestTest.class, "request_with_1_attr_without_name_attribute.xml" ); } /** * Test parsing of a request with 1 Attr element with 2 Values */ @Test public void testRequestWith1AttrWith2Values() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AddRequestTest.class.getResource( "request_with_1_attr_with_2_values.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest(); Entry entry = addRequest.getEntry(); assertEquals( 1, entry.size() ); // Getting the Attribute Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "objectclass", attribute.getUpId() ); // Getting the Value Iterator valueIterator = attribute.iterator(); assertTrue( valueIterator.hasNext() ); Value value = valueIterator.next(); assertEquals( "top", value.getString() ); assertTrue( valueIterator.hasNext() ); value = valueIterator.next(); assertEquals( "person", value.getString() ); assertFalse( valueIterator.hasNext() ); } /** * Test parsing of a request with a needed requestID attribute * * DIRSTUDIO-1 */ @Test public void testRequestWithNeededRequestId() { testParsingFail( AddRequestTest.class, "request_with_needed_requestID.xml" ); } } addResponse/000077500000000000000000000000001525525160600343735ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2AddResponseTest.java000066400000000000000000000362371525525160600403200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/addResponse/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.addResponse; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Collection; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException; import org.apache.directory.api.ldap.model.message.AddResponse; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Add Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class AddResponseTest extends AbstractResponseTest { /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_requestID_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( 456, addResponse.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( AddResponseTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response with a (optional) Control element */ @Test public void testResponseWith1Control() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = addResponse.getControls(); assertEquals( 1, addResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with a (optional) Control element with emptyValue */ @Test public void testResponseWith1ControlEmptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = addResponse.getControls(); assertEquals( 1, addResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response with 2 (optional) Control elements */ @Test public void testResponseWith2Controls() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = addResponse.getControls(); assertEquals( 2, addResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with 3 (optional) Control elements without value */ @Test public void testResponseWith3ControlsWithoutValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = addResponse.getControls(); assertEquals( 3, addResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response without Result Code element */ @Test public void testResponseWithoutResultCode() { testParsingFail( AddResponseTest.class, "response_without_result_code.xml" ); } /** * Test parsing of a response with Result Code element but a not integer value */ @Test public void testResponseWithResultCodeNotInteger() { testParsingFail( AddResponseTest.class, "response_with_result_code_not_integer.xml" ); } /** * Test parsing of a response with Result Code */ @Test public void testResponseWithResultCode() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser .setInput( AddResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = addResponse.getLdapResult(); assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() ); } /** * Test parsing of a response with Error Message */ @Test public void testResponseWithErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = addResponse.getLdapResult(); assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult .getDiagnosticMessage() ); } /** * Test parsing of a response with empty Error Message */ @Test public void testResponseWithEmptyErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_empty_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = addResponse.getLdapResult(); assertNull( ldapResult.getDiagnosticMessage() ); } /** * Test parsing of a response with a Referral */ @Test public void testResponseWith1Referral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_1_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = addResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); assertTrue( referrals.contains( "ldap://www.apache.org/" ) ); } /** * Test parsing of a response with an empty Referral */ @Test public void testResponseWith1EmptyReferral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = addResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 0, referrals.size() ); } /** * Test parsing of a response with 2 Referral elements */ @Test public void testResponseWith2Referrals() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser .setInput( AddResponseTest.class.getResource( "response_with_2_referrals.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = addResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 2, referrals.size() ); assertTrue( referrals.contains( "ldap://www.apache.org/" ) ); assertTrue( referrals.contains( "ldap://www.apple.com/" ) ); } /** * Test parsing of a response with a Referral and an Error Message */ @Test public void testResponseWith1ReferralAndAnErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = addResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with MatchedDN attribute */ @Test public void testResponseWithMatchedDNAttribute() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AddResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = addResponse.getLdapResult(); assertTrue( ldapResult.getMatchedDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a response with wrong matched Dn */ @Test public void testResponseWithWrongMatchedDN() { testParsingFail( AddResponseTest.class, "response_with_wrong_matchedDN_attribute.xml" ); } /** * Test parsing of a response with wrong Descr attribute */ @Test public void testResponseWithWrongDescr() { testParsingFail( AddResponseTest.class, "response_with_wrong_descr.xml" ); } } authRequest/000077500000000000000000000000001525525160600344365ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2AuthRequestTest.java000066400000000000000000000232171525525160600404200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/authRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.authRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.ldap.model.message.BindRequest; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Auth Request parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class AuthRequestTest extends AbstractTest { /** * Test parsing of a request without the principal attribute */ @Test public void testRequestWithoutPrincipal() { testParsingFail( AuthRequestTest.class, "request_without_principal_attribute.xml" ); } /** * Test parsing of a request with the principal attribute */ @Test public void testRequestWithPrincipal() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AuthRequestTest.class.getResource( "request_with_principal_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindRequest bindRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( "CN=Bob Rush,OU=Dev,DC=Example,DC=COM", bindRequest.getName() ); } /** * Test parsing of a request with the (optional) requestID attribute */ @Test public void testRequestWithRequestId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AuthRequestTest.class.getResource( "request_with_requestID_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 456, abandonRequest.getMessageId() ); } /** * Test parsing of a request with the (optional) requestID attribute below 0 */ @Test public void testRequestWithRequestIdBelow0() { testParsingFail( AuthRequestTest.class, "request_with_requestID_below_0.xml" ); } /** * Test parsing of a request with a (optional) Control element */ @Test public void testRequestWith1Control() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AuthRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = abandonRequest.getControls(); assertEquals( 1, abandonRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with a (optional) Control element with Base64 value */ @Test public void testRequestWith1ControlBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AuthRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = abandonRequest.getControls(); assertEquals( 1, abandonRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with an attribute value carrying malformed Base64 : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_REQUEST error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1ControlMalformedBase64Value() { testParsingFail( AuthRequestTest.class, "request_with_1_control_malformed_base64_value.xml" ); } /** * Test parsing of a request with a (optional) Control element with empty value */ @Test public void testRequestWith1ControlEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AuthRequestTest.class.getResource( "request_with_1_control_empty_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = abandonRequest.getControls(); assertEquals( 1, abandonRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with 2 (optional) Control elements */ @Test public void testRequestWith2Controls() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AuthRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = abandonRequest.getControls(); assertEquals( 2, abandonRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with 3 (optional) Control elements without value */ @Test public void testRequestWith3ControlsWithoutValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( AuthRequestTest.class.getResource( "request_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = abandonRequest.getControls(); assertEquals( 3, abandonRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with a needed requestID attribute * * DIRSTUDIO-1 */ @Test public void testRequestWithNeededRequestId() { testParsingFail( AuthRequestTest.class, "request_with_needed_requestID.xml" ); } } authResponse/000077500000000000000000000000001525525160600346045ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2AuthResponseTest.java000066400000000000000000000373251525525160600407410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/authResponse/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.authResponse; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Collection; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException; import org.apache.directory.api.ldap.model.message.BindResponse; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Auth Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class AuthResponseTest extends AbstractResponseTest { /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_requestID_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( 456, bindResponse.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( AuthResponseTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response with a (optional) Control element */ @Test public void testResponseWith1Control() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = bindResponse.getControls(); assertEquals( 1, bindResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with a (optional) Control element with empty value */ @Test public void testResponseWith1ControlEmptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = bindResponse.getControls(); assertEquals( 1, bindResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response with 2 (optional) Control elements */ @Test public void testResponseWith2Controls() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser .setInput( AuthResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = bindResponse.getControls(); assertEquals( 2, bindResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with 3 (optional) Control elements without value */ @Test public void testResponseWith3ControlsWithoutValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = bindResponse.getControls(); assertEquals( 3, bindResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response without Result Code element */ @Test public void testResponseWithoutResultCode() { testParsingFail( AuthResponseTest.class, "response_without_result_code.xml" ); } /** * Test parsing of a response with Result Code element but a not integer value */ @Test public void testResponseWithResultCodeNotInteger() { testParsingFail( AuthResponseTest.class, "response_with_result_code_not_integer.xml" ); } /** * Test parsing of a response with Result Code */ @Test public void testResponseWithResultCode() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = bindResponse.getLdapResult(); assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() ); } /** * Test parsing of a response with Error Message */ @Test public void testResponseWithErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = bindResponse.getLdapResult(); assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult .getDiagnosticMessage() ); } /** * Test parsing of a response with Empty Error Message */ @Test public void testResponseWithEmptyErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_empty_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = bindResponse.getLdapResult(); assertNull( ldapResult.getDiagnosticMessage() ); } /** * Test parsing of a response with a Referral */ @Test public void testResponseWith1Referral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser .setInput( AuthResponseTest.class.getResource( "response_with_1_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = bindResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with an empty Referral */ @Test public void testResponseWith1EmptyReferral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = bindResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 0, referrals.size() ); } /** * Test parsing of a response with 2 Referral elements */ @Test public void testResponseWith2Referrals() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_2_referrals.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = bindResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 2, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apple.com/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with a Referral and an Error Message */ @Test public void testResponseWith1ReferralAndAnErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = bindResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with MatchedDN attribute */ @Test public void testResponseWithMatchedDNAttribute() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( AuthResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = bindResponse.getLdapResult(); assertTrue( ldapResult.getMatchedDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a response with wrong matched Dn */ @Test public void testResponseWithWrongMatchedDN() { testParsingFail( AuthResponseTest.class, "response_with_wrong_matchedDN_attribute.xml" ); } /** * Test parsing of a response with wrong Descr attribute */ @Test public void testResponseWithWrongDescr() { testParsingFail( AuthResponseTest.class, "response_with_wrong_matchedDN_attribute.xml" ); } } batchRequest/000077500000000000000000000000001525525160600345565ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2BatchRequestTest.java000066400000000000000000000451241525525160600406610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/batchRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.batchRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.List; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.DsmlDecorator; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml; import org.apache.directory.api.ldap.model.message.AbandonRequest; import org.apache.directory.api.ldap.model.message.AddRequest; import org.apache.directory.api.ldap.model.message.BindRequest; import org.apache.directory.api.ldap.model.message.CompareRequest; import org.apache.directory.api.ldap.model.message.DeleteRequest; import org.apache.directory.api.ldap.model.message.ExtendedRequest; import org.apache.directory.api.ldap.model.message.ModifyDnRequest; import org.apache.directory.api.ldap.model.message.ModifyRequest; import org.apache.directory.api.ldap.model.message.Request; import org.apache.directory.api.ldap.model.message.SearchRequest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Compare Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class BatchRequestTest extends AbstractTest { /** * Test parsing of a Request with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_requestID_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 1234567890, batchRequest.getRequestID() ); } /** * Test parsing of a request with the (optional) requestID attribute below 0 */ @Test public void testRequestWithRequestIdBelow0() { testParsingFail( BatchRequestTest.class, "request_with_requestID_below_0.xml" ); } /** * Test parsing of a Request with the (optional) requestID attribute */ @Test public void testResponseWith0Request() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_requestID_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 0, batchRequest.getRequests().size() ); } /** * Test parsing of a Request with 1 AuthRequest */ @Test public void testResponseWith1AuthRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_1_AuthRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 1, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof BindRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 1 AddRequest */ @Test public void testResponseWith1AddRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_1_AddRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 1, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof AddRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 1 CompareRequest */ @Test public void testResponseWith1CompareRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_1_CompareRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 1, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof CompareRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 1 AbandonRequest */ @Test public void testResponseWith1AbandonRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_1_AbandonRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 1, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof AbandonRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 1 DelRequest */ @Test public void testResponseWith1DelRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_1_DelRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 1, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof DeleteRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 1 ExtendedRequest */ @Test public void testResponseWith1ExtendedRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_1_ExtendedRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 1, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof ExtendedRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 1 ModDNRequest */ @Test public void testResponseWith1ModDNRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_1_ModDNRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 1, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof ModifyDnRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 1 ModifyRequest */ @Test public void testResponseWith1ModifyRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_1_ModifyRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 1, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof ModifyRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 1 SearchRequest */ @Test public void testResponseWith1SearchRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_1_SearchRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 1, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof SearchRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 2 AddRequest */ @Test public void testResponseWith2AddRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_2_AddRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 2, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof AddRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 2 CompareRequest */ @Test public void testResponseWith2CompareRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_2_CompareRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 2, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof CompareRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 2 AbandonRequest */ @Test public void testResponseWith2AbandonRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_2_AbandonRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 2, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof AbandonRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 2 DelRequest */ @Test public void testResponseWith2DelRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_2_DelRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 2, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof DeleteRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 2 ExtendedRequest */ @Test public void testResponseWith2ExtendedRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_2_ExtendedRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 2, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof ExtendedRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 2 ModDNRequest */ @Test public void testResponseWith2ModDNRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_2_ModDNRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 2, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof ModifyDnRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 2 ModifyRequest */ @Test public void testResponseWith2ModifyRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_2_ModifyRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 2, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof ModifyRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 2 SearchRequest */ @Test public void testResponseWith2SearchRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_2_SearchRequest.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); assertEquals( 2, batchRequest.getRequests().size() ); if ( batchRequest.getCurrentRequest() instanceof SearchRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Request with 1 AuthRequest and 1 AddRequest */ @Test public void testResponseWith1AuthRequestAnd1AddRequest() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( BatchRequestTest.class.getResource( "request_with_1_AuthRequest_1_AddRequest.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchRequestDsml batchRequest = parser.getBatchRequest(); List> requests = batchRequest.getRequests(); assertEquals( 2, requests.size() ); if ( requests.get( 0 ) instanceof BindRequest ) { assertTrue( true ); } else { fail(); } if ( requests.get( 1 ) instanceof AddRequest ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a request with 1 wrong placed AuthRequest */ @Test public void testRequestWithWrongPlacedAuthRequest() { testParsingFail( BatchRequestTest.class, "request_with_wrong_placed_AuthRequest.xml" ); } } batchResponse/000077500000000000000000000000001525525160600347245ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2BatchResponseTest.java000066400000000000000000000525321525525160600411760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/batchResponse/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.batchResponse; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlDecorator; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.dsmlv2.response.BatchResponseDsml; import org.apache.directory.api.dsmlv2.response.ErrorResponse; import org.apache.directory.api.dsmlv2.response.ErrorResponse.ErrorResponseType; import org.apache.directory.api.dsmlv2.response.SearchResponse; import org.apache.directory.api.ldap.model.message.AddResponse; import org.apache.directory.api.ldap.model.message.BindResponse; import org.apache.directory.api.ldap.model.message.CompareResponse; import org.apache.directory.api.ldap.model.message.DeleteResponse; import org.apache.directory.api.ldap.model.message.ExtendedResponse; import org.apache.directory.api.ldap.model.message.ModifyDnResponse; import org.apache.directory.api.ldap.model.message.ModifyResponse; import org.apache.directory.api.ldap.model.message.Response; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Compare Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class BatchResponseTest extends AbstractResponseTest { /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1234567890, batchResponse.getRequestID() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( BatchResponseTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a Response with 0 Response */ @Test public void testResponseWith0Reponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_0_response.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 0, batchResponse.getResponses().size() ); } /** * Test parsing of a Response with the 1 AddResponse */ @Test public void testResponseWith1AddResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_1_AddResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof AddResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 1 AuthResponse */ @Test public void testResponseWith1AuthResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_1_AuthResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof BindResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 1 CompareResponse */ @Test public void testResponseWith1CompareResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_1_CompareResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof CompareResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 1 DelResponse */ @Test public void testResponseWith1DelResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_1_DelResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof DeleteResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 1 ErrorResponse */ @Test public void testResponseWith1ErrorResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_1_ErrorResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof ErrorResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 1 ExtendedResponse */ @Test public void testResponseWith1ExtendedResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_1_ExtendedResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof ExtendedResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 1 ModDNResponse */ @Test public void testResponseWith1ModDNResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_1_ModDNResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof ModifyDnResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 1 ModifyResponse */ @Test public void testResponseWith1ModifyResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_1_ModifyResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof ModifyResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 1 SearchResponse */ @Test public void testResponseWith1SearchResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_1_SearchResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response.getDecorated() instanceof SearchResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 2 AddResponse */ @Test public void testResponseWith2AddResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_2_AddResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 2, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof AddResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 2 AuthResponse */ @Test public void testResponseWith2AuthResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_2_AuthResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 2, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof BindResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 2 CompareResponse */ @Test public void testResponseWith2CompareResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_2_CompareResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 2, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof CompareResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 2 DelResponse */ @Test public void testResponseWith2DelResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_2_DelResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 2, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof DeleteResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 2 ErrorResponse */ @Test public void testResponseWith2ErrorResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_2_ErrorResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 2, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof ErrorResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 2 ExtendedResponse */ @Test public void testResponseWith2ExtendedResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_2_ExtendedResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 2, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof ExtendedResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 2 ModDNResponse */ @Test public void testResponseWith2ModDNResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_2_ModDNResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 2, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof ModifyDnResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 2 ModifyResponse */ @Test public void testResponseWith2ModifyResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_2_ModifyResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 2, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof ModifyResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 2 SearchResponse */ @Test public void testResponseWith2SearchResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_2_SearchResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 2, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response.getDecorated() instanceof SearchResponse ) { assertTrue( true ); } else { fail(); } } /** * Test parsing of a Response with the 2 SearchResponse */ @Test public void testResponseWithEmptyIDErrorResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( BatchResponseTest.class.getResource( "response_with_empty_ID_ErrorResponse.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { e.printStackTrace(); fail( e.getMessage() ); } BatchResponseDsml batchResponse = parser.getBatchResponse(); assertEquals( 1, batchResponse.getResponses().size() ); DsmlDecorator response = batchResponse.getCurrentResponse(); if ( response instanceof ErrorResponse ) { assertTrue( true ); assertEquals( ErrorResponseType.COULD_NOT_CONNECT, ((ErrorResponse)response).getErrorType()); } else { fail(); } } } compareRequest/000077500000000000000000000000001525525160600351235ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2CompareRequestTest.java000066400000000000000000000333161525525160600415730ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/compareRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.compareRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.ldap.model.message.CompareRequest; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Compare Request parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class CompareRequestTest extends AbstractTest { /** * Test parsing of a request without the dn attribute */ @Test public void testRequestWithoutDn() { testParsingFail( CompareRequestTest.class, "request_without_dn_attribute.xml" ); } /** * Test parsing of a request with the dn attribute */ @Test public void testRequestWithDn() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( CompareRequestTest.class.getResource( "request_with_dn_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( compareRequest.getName().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a request with the (optional) requestID attribute */ @Test public void testRequestWithRequestId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( CompareRequestTest.class.getResource( "request_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 456, compareRequest.getMessageId() ); } /** * Test parsing of a request with the (optional) requestID attribute below 0 */ @Test public void testRequestWithRequestIdBelow0() { testParsingFail( CompareRequestTest.class, "request_with_requestID_below_0.xml" ); } /** * Test parsing of a request with a (optional) Control element */ @Test public void testRequestWith1Control() { Dsmlv2Parser parser = null; try { parser = newParser(); parser .setInput( CompareRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = compareRequest.getControls(); assertEquals( 1, compareRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with a (optional) Control element with Base64 value */ @Test public void testRequestWith1ControlBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser .setInput( CompareRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = compareRequest.getControls(); assertEquals( 1, compareRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with a (optional) Control element with empty value */ @Test public void testRequestWith1ControlEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( CompareRequestTest.class.getResource( "request_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = compareRequest.getControls(); assertEquals( 1, compareRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with 2 (optional) Control elements */ @Test public void testRequestWith2Controls() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( CompareRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = compareRequest.getControls(); assertEquals( 2, compareRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with 3 (optional) Control elements without value */ @Test public void testRequestWith3ControlsWithoutValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( CompareRequestTest.class.getResource( "request_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = compareRequest.getControls(); assertEquals( 3, compareRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with an Attr elements with value */ @Test public void testRequestWith1CompleteAssertion() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( CompareRequestTest.class.getResource( "request_with_1_complete_assertion.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( compareRequest.getName().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); assertEquals( "sn", compareRequest.getAttributeId() ); assertEquals( "Johnson", compareRequest.getAssertionValue().getString() ); } /** * Test parsing of a request with a complete assertion with base64 value */ @Test public void testRequestWith1CompleteAssertionBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( CompareRequestTest.class .getResource( "request_with_1_complete_assertion_base64_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( compareRequest.getName().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); assertEquals( "sn", compareRequest.getAttributeId() ); assertEquals( "DSMLv2.0 rocks!!", compareRequest.getAssertionValue().getString() ); } /** * Test parsing of a request with an attribute value carrying malformed Base64 : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_REQUEST error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1CompleteAssertionMalformedBase64Value() { testParsingFail( CompareRequestTest.class, "request_with_1_complete_assertion_malformed_base64_value.xml" ); } /** * Test parsing of a request with an Attr elements with empty value */ @Test public void testRequestWith1AssertionEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( CompareRequestTest.class.getResource( "request_with_1_assertion_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( compareRequest.getName().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); assertEquals( "sn", compareRequest.getAttributeId() ); assertNull( compareRequest.getAssertionValue() ); } /** * Test parsing of a request without the Assertion element */ @Test public void testRequestWithoutAssertion() { testParsingFail( CompareRequestTest.class, "request_without_assertion.xml" ); } /** * Test parsing of a request with 2 complete Assertion element */ @Test public void testRequestWith2CompleteAssertions() { testParsingFail( CompareRequestTest.class, "request_with_2_complete_assertions.xml" ); } /** * Test parsing of a request with 1 Assertion element without the name attribute */ @Test public void testRequestWith1AssertionWithoutNameAttribute() { testParsingFail( CompareRequestTest.class, "request_with_1_assertion_without_name_attribute.xml" ); } /** * Test parsing of a request with 1 Assertion element without the Value element */ @Test public void testRequestWith1AssertionWithoutValue() { testParsingFail( CompareRequestTest.class, "request_with_1_assertion_without_value.xml" ); } /** * Test parsing of a request with 1 Assertion element with 2 Value elements */ @Test public void testRequestWith1AssertionWith2Value() { testParsingFail( CompareRequestTest.class, "request_with_1_assertion_with_2_values.xml" ); } /** * Test parsing of a request with a needed requestID attribute * * DIRSTUDIO-1 */ @Test public void testRequestWithNeededRequestId() { testParsingFail( CompareRequestTest.class, "request_with_needed_requestID.xml" ); } } compareResponse/000077500000000000000000000000001525525160600352715ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2CompareResponseTest.java000066400000000000000000000377021525525160600421120ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/compareResponse/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.compareResponse; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Collection; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException; import org.apache.directory.api.ldap.model.message.CompareResponse; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Compare Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class CompareResponseTest extends AbstractResponseTest { /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( 456, compareResponse.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdbelow0() { testParsingFail( CompareResponseTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response with a (optional) Control element */ @Test public void testResponseWith1Control() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = compareResponse.getControls(); assertEquals( 1, compareResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with a (optional) Control element with empty value */ @Test public void testResponseWith1ControlEmptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = compareResponse.getControls(); assertEquals( 1, compareResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response with 2 (optional) Control elements */ @Test public void testResponseWith2Controls() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = compareResponse.getControls(); assertEquals( 2, compareResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with 3 (optional) Control elements without value */ @Test public void testResponseWith3ControlsWithoutValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = compareResponse.getControls(); assertEquals( 3, compareResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response without Result Code element */ @Test public void testResponseWithoutResultCode() { testParsingFail( CompareResponseTest.class, "response_without_result_code.xml" ); } /** * Test parsing of a response with Result Code element but a not integer value */ @Test public void testResponseWithResultCodeNotInteger() { testParsingFail( CompareResponseTest.class, "response_with_result_code_not_integer.xml" ); } /** * Test parsing of a response with Result Code */ @Test public void testResponseWithResultCode() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = compareResponse.getLdapResult(); assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() ); } /** * Test parsing of a response with Error Message */ @Test public void testResponseWithErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = compareResponse.getLdapResult(); assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult .getDiagnosticMessage() ); } /** * Test parsing of a response with empty Error Message */ @Test public void testResponseWithEmptyErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_empty_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = compareResponse.getLdapResult(); assertNull( ldapResult.getDiagnosticMessage() ); } /** * Test parsing of a response with a Referral */ @Test public void testResponseWith1Referral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_1_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = compareResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with an empty Referral */ @Test public void testResponseWith1EmptyReferral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = compareResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 0, referrals.size() ); } /** * Test parsing of a response with 2 Referral elements */ @Test public void testResponseWith2Referrals() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_2_referrals.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = compareResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 2, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apple.com/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with a Referral and an Error Message */ @Test public void testResponseWith1ReferralAndAnErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = compareResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with MatchedDN attribute */ @Test public void testResponseWithMatchedDNAttribute() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( CompareResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = compareResponse.getLdapResult(); assertTrue( ldapResult.getMatchedDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a response with wrong matched Dn */ @Test public void testResponseWithWrongMatchedDN() { testParsingFail( CompareResponseTest.class, "response_with_wrong_matchedDN_attribute.xml" ); } /** * Test parsing of a response with wrong Descr attribute */ @Test public void testResponseWithWrongDescr() { testParsingFail( CompareResponseTest.class, "response_with_wrong_descr.xml" ); } } delRequest/000077500000000000000000000000001525525160600342415ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2DelRequestTest.java000066400000000000000000000230571525525160600400300ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/delRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.delRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.DeleteRequest; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Del Request parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class DelRequestTest extends AbstractTest { /** * Test parsing of a request without the dn attribute */ @Test public void testRequestWithoutDn() { testParsingFail( DelRequestTest.class, "request_without_dn_attribute.xml" ); } /** * Test parsing of a request with the dn attribute */ @Test public void testRequestWithDn() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( DelRequestTest.class.getResource( "request_with_dn_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( delRequest.getName().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a request with the (optional) requestID attribute */ @Test public void testRequestWithRequestId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( DelRequestTest.class.getResource( "request_with_requestID_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 456, delRequest.getMessageId() ); } /** * Test parsing of a request with the (optional) requestID attribute below 0 */ @Test public void testRequestWithRequestIdBelow0() { testParsingFail( DelRequestTest.class, "request_with_requestID_below_0.xml" ); } /** * Test parsing of a request with a (optional) Control element */ @Test public void testRequestWith1Control() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( DelRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = delRequest.getControls(); assertEquals( 1, delRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with an attribute value carrying malformed Base64 : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_REQUEST error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1controlMalformedBase64() { testParsingFail( DelRequestTest.class, "request_with_1_control_malformed_base64_value.xml" ); } /** * Test parsing of a request with a (optional) Control element */ @Test public void testRequestWith1ControlBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( DelRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = delRequest.getControls(); assertEquals( 1, delRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with a (optional) Control element with empty value */ @Test public void testRequestWith1ControlEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( DelRequestTest.class.getResource( "request_with_1_control_empty_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = delRequest.getControls(); assertEquals( 1, delRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with 2 (optional) Control elements */ @Test public void testRequestWith2Controls() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( DelRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { e.printStackTrace(); fail( e.getMessage() ); } DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = delRequest.getControls(); assertEquals( 2, delRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with 3 (optional) Control elements without value */ @Test public void testRequestWith3ControlsWithoutValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( DelRequestTest.class.getResource( "request_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = delRequest.getControls(); assertEquals( 3, delRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with a needed requestID attribute * * DIRSTUDIO-1 */ @Test public void testRequestWithNeededRequestId() { testParsingFail( DelRequestTest.class, "request_with_needed_requestID.xml" ); } } delResponse/000077500000000000000000000000001525525160600344075ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2DelResponseTest.java000066400000000000000000000372521525525160600403460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/delResponse/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.delResponse; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Collection; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.DeleteResponse; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Del Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class DelResponseTest extends AbstractResponseTest { /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_requestID_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( 456, delResponse.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( DelResponseTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response with a (optional) Control element */ @Test public void testResponseWith1Control() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = delResponse.getControls(); assertEquals( 1, delResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with a (optional) Control element with empty value */ @Test public void testResponseWith1ControlemptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = delResponse.getControls(); assertEquals( 1, delResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response with 2 (optional) Control elements */ @Test public void testResponseWith2Controls() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = delResponse.getControls(); assertEquals( 2, delResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with 3 (optional) Control elements without value */ @Test public void testResponseWith3ControlsWithoutValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = delResponse.getControls(); assertEquals( 3, delResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response without Result Code element */ @Test public void testResponseWithoutResultCode() { testParsingFail( DelResponseTest.class, "response_without_result_code.xml" ); } /** * Test parsing of a response with Result Code element but a not integer value */ @Test public void testResponseWithResultCodeNotInteger() { testParsingFail( DelResponseTest.class, "response_with_result_code_not_integer.xml" ); } /** * Test parsing of a response with Result Code */ @Test public void testResponseWithResultCode() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser .setInput( DelResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = delResponse.getLdapResult(); assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() ); } /** * Test parsing of a response with Error Message */ @Test public void testResponseWithErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = delResponse.getLdapResult(); assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult .getDiagnosticMessage() ); } /** * Test parsing of a response with empty Error Message */ @Test public void testResponseWithEmptyErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_empty_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = delResponse.getLdapResult(); assertNull( ldapResult.getDiagnosticMessage() ); } /** * Test parsing of a response with a Referral */ @Test public void testResponseWith1Referral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_1_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = delResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with an empty Referral */ @Test public void testResponseWith1EmptyReferral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = delResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 0, referrals.size() ); } /** * Test parsing of a response with 2 Referral elements */ @Test public void testResponseWith2Referrals() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser .setInput( DelResponseTest.class.getResource( "response_with_2_referrals.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = delResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 2, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apple.com/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with a Referral and an Error Message */ @Test public void testResponseWith1ReferralAndAnErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = delResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with MatchedDN attribute */ @Test public void testResponseWithMatchedDNAttribute() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( DelResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = delResponse.getLdapResult(); assertTrue( ldapResult.getMatchedDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a response with wrong matched Dn */ @Test public void testResponseWithWrongMatchedDN() { testParsingFail( DelResponseTest.class, "response_with_wrong_matchedDN_attribute.xml" ); } /** * Test parsing of a response with wrong Descr attribute */ @Test public void testResponseWithWrongDescr() { testParsingFail( DelResponseTest.class, "response_with_wrong_descr.xml" ); } } errorResponse/000077500000000000000000000000001525525160600347745ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2ErrorResponseTest.java000066400000000000000000000244751525525160600413230ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/errorResponse/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.errorResponse; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.fail; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.dsmlv2.response.ErrorResponse; import org.apache.directory.api.dsmlv2.response.ErrorResponse.ErrorResponseType; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Error Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class ErrorResponseTest extends AbstractResponseTest { /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( 456, errorResponse.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( ErrorResponseTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response without Type attribute */ @Test public void testResponseWithoutType() { testParsingFail( ErrorResponseTest.class, "response_without_type.xml" ); } /** * Test parsing of a response with type == notAttempted */ @Test public void testResponseWithTypeNotAttempted() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_type_notAttempted.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( ErrorResponseType.NOT_ATTEMPTED, errorResponse.getErrorType() ); } /** * Test parsing of a response with type == couldNotConnect */ @Test public void testResponseWithTypeCouldNotConnect() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_type_couldNotConnect.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( ErrorResponseType.COULD_NOT_CONNECT, errorResponse.getErrorType() ); } /** * Test parsing of a response with type == connectionClosed */ @Test public void testResponseWithTypeConnectionClosed() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_type_connectionClosed.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( ErrorResponseType.CONNECTION_CLOSED, errorResponse.getErrorType() ); } /** * Test parsing of a response with type == malformedRequest */ @Test public void testResponseWithTypeMalformedRequest() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_type_malformedRequest.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( ErrorResponseType.MALFORMED_REQUEST, errorResponse.getErrorType() ); } /** * Test parsing of a response with type == gatewayInternalError */ @Test public void testResponseWithTypeGatewayInternalError() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_type_gatewayInternalError.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( ErrorResponseType.GATEWAY_INTERNAL_ERROR, errorResponse.getErrorType() ); } /** * Test parsing of a response with type == authenticationFailed */ @Test public void testResponseWithTypeAuthenticationFailed() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_type_authenticationFailed.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( ErrorResponseType.AUTHENTICATION_FAILED, errorResponse.getErrorType() ); } /** * Test parsing of a response with type == unresolvableURI */ @Test public void testResponseWithTypeUnresolvableURI() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_type_unresolvableURI.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( ErrorResponseType.UNRESOLVABLE_URI, errorResponse.getErrorType() ); } /** * Test parsing of a response with type == other */ @Test public void testResponseWithTypeOther() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_type_other.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( ErrorResponseType.OTHER, errorResponse.getErrorType() ); } /** * Test parsing of a response with type in error */ @Test public void testResponseWithTypeError() { testParsingFail( ErrorResponseTest.class, "response_with_type_inError.xml" ); } /** * Test parsing of a response with Message */ @Test public void testResponseWithMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( "Connection refused", errorResponse.getMessage() ); } /** * Test parsing of a response with empty Message */ @Test public void testResponseWithEmptyMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ErrorResponseTest.class.getResource( "response_with_empty_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ErrorResponse errorResponse = ( ErrorResponse ) parser.getBatchResponse().getCurrentResponse(); assertNull( errorResponse.getMessage() ); } } extendedRequest/000077500000000000000000000000001525525160600352755ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2ExtendedRequestTest.java000066400000000000000000000277771525525160600421350ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/extendedRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.extendedRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.dsmlv2.request.ExtendedRequestDsml; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Extended Request parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class ExtendedRequestTest extends AbstractTest { /** * Test parsing of a request with the (optional) requestID attribute */ @Test public void testRequestWithRequestId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ExtendedRequestTest.class.getResource( "request_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 456, extendedRequest.getMessageId() ); } /** * Test parsing of a request with the (optional) requestID attribute below 0 */ @Test public void testRequestWithRequestIdBelow0() { testParsingFail( ExtendedRequestTest.class, "request_with_requestID_below_0.xml" ); } /** * Test parsing of a request with a (optional) Control element */ @Test public void testRequestWith1Control() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ExtendedRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest(); Map controls = extendedRequest.getControls(); assertEquals( 1, extendedRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with a (optional) Control element with Base64 value */ @Test public void testRequestWith1ControlBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ExtendedRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest(); Map controls = extendedRequest.getControls(); assertEquals( 1, extendedRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with an attribute value carrying malformed Base64 : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_REQUEST error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1AttrMalformedBase64Value() { testParsingFail( ExtendedRequestTest.class, "request_with_1_attr_malformed_base64_value.xml" ); } /** * Test parsing of a request with a (optional) Control element with empty value */ @Test public void testRequestWith1ControlEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ExtendedRequestTest.class.getResource( "request_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest(); Map controls = extendedRequest.getControls(); assertEquals( 1, extendedRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with 2 (optional) Control elements */ @Test public void testRequestWith2Controls() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ExtendedRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest(); Map controls = extendedRequest.getControls(); assertEquals( 2, extendedRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with 3 (optional) Control elements without value */ @Test public void testRequestWith3ControlsWithoutValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ExtendedRequestTest.class.getResource( "request_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest(); Map controls = extendedRequest.getControls(); assertEquals( 3, extendedRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with a RequestValue element */ @Test public void testRequestWithRequestValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ExtendedRequestTest.class.getResource( "request_with_requestValue.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest(); assertEquals( "foobar", Strings.utf8ToString( extendedRequest.getRequestValue() ) ); } /** * Test parsing of a request with a RequestValue element with Base64 value */ @Test public void testRequestWithBase64RequestValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ExtendedRequestTest.class.getResource( "request_with_base64_requestValue.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest(); assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( extendedRequest.getRequestValue() ) ); } /** * Test parsing of a request with 2 requestValue Elements */ @Test public void testRequestWith2RequestValue() { testParsingFail( ExtendedRequestTest.class, "request_with_2_requestValue.xml" ); } /** * Test parsing of a request with 2 requestName Elements */ @Test public void testRequestWith2RequestName() { testParsingFail( ExtendedRequestTest.class, "request_with_2_requestName.xml" ); } /** * Test parsing of a request with an empty requestName */ @Test public void testRequestWithEmptyRequestName() { testParsingFail( ExtendedRequestTest.class, "request_with_empty_requestName.xml" ); } /** * Test parsing of a request with an empty RequestValue */ @Test public void testRequestWithEmptyRequestValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ExtendedRequestTest.class.getResource( "request_with_empty_requestValue.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest(); assertNull( extendedRequest.getRequestValue() ); } /** * Test parsing of a request with a needed requestID attribute * * DIRSTUDIO-1 */ @Test public void testRequestWithNeededRequestId() { testParsingFail( ExtendedRequestTest.class, "request_with_needed_requestID.xml" ); } } extendedResponse/000077500000000000000000000000001525525160600354435ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2ExtendedResponseTest.java000066400000000000000000000533731525525160600424400ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/extendedResponse/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.extendedResponse; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Collection; import java.util.Map; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.asn1.util.Oid; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.dsmlv2.response.ExtendedResponseDsml; import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.ExtendedResponse; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Extended Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class ExtendedResponseTest extends AbstractResponseTest { /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( 456, extendedResponse.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( ExtendedResponseTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response with a (optional) Control element */ @Test public void testResponseWith1Control() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = extendedResponse.getControls(); assertEquals( 1, extendedResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with a (optional) Control element with empty value */ @Test public void testResponseWith1ControlEmptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = extendedResponse.getControls(); assertEquals( 1, extendedResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response with 2 (optional) Control elements */ @Test public void testResponseWith2Controls() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = extendedResponse.getControls(); assertEquals( 2, extendedResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with 3 (optional) Control elements without value */ @Test public void testResponseWith3ControlsWithoutValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = extendedResponse.getControls(); assertEquals( 3, extendedResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response without Result Code element */ @Test public void testResponseWithoutResultCode() { testParsingFail( ExtendedResponseTest.class, "response_without_result_code.xml" ); } /** * Test parsing of a response with Result Code element but a not integer value */ @Test public void testResponseWithResultCodeNotInteger() { testParsingFail( ExtendedResponseTest.class, "response_with_result_code_not_integer.xml" ); } /** * Test parsing of a response with Result Code */ @Test public void testResponseWithResultCode() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = extendedResponse.getLdapResult(); assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() ); } /** * Test parsing of a response with Error Message */ @Test public void testResponseWithErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = extendedResponse.getLdapResult(); assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult .getDiagnosticMessage() ); } /** * Test parsing of a response with empty Error Message */ @Test public void testResponseWithEmptyErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_empty_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = extendedResponse.getLdapResult(); assertNull( ldapResult.getDiagnosticMessage() ); } /** * Test parsing of a response with a Referral */ @Test public void testResponseWith1Referral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_1_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = extendedResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with a empty Referral */ @Test public void testResponseWith1EmptyReferral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_1_empty_referral.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = extendedResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 0, referrals.size() ); } /** * Test parsing of a response with 2 Referral elements */ @Test public void testResponseWith2Referrals() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_2_referrals.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = extendedResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 2, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apple.com/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with a Referral and an Error Message */ @Test public void testResponseWith1ReferralAndAnErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = extendedResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with MatchedDN attribute */ @Test public void testResponseWithMatchedDNAttribute() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = extendedResponse.getLdapResult(); assertTrue( ldapResult.getMatchedDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a response with wrong matched Dn */ @Test public void testResponseWithWrongMatchedDN() { testParsingFail( ExtendedResponseTest.class, "response_with_wrong_matchedDN_attribute.xml" ); } /** * Test parsing of a response with Response Name */ @Test public void testResponseWithResponseName() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_responseName.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); try { assertEquals( Oid.fromString( "1.2.3.4.5.6.7.8.9.0" ).toString(), extendedResponse.getResponseName().toString() ); } catch ( DecoderException e ) { fail(); } } /** * Test parsing of a response with empty Response Name */ @Test public void testResponseWithEmptyResponseName() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_empty_responseName.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( "", extendedResponse.getResponseName().toString() ); } /** * Test parsing of a response with wrong Response Name */ @Test public void testResponseWithWrongResponseName() { testParsingFail( ExtendedResponseTest.class, "response_with_wrong_responseName.xml" ); } /** * Test parsing of a response with Response */ @Test public void testResponseWithResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_response.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponseDsml extendedResponse = ( ExtendedResponseDsml ) parser.getBatchResponse().getCurrentResponse(); assertEquals( "This is a response", Strings.utf8ToString( extendedResponse.getResponseValue() ) ); } /** * Test parsing of a response with Base64 Response */ @Test public void testResponseWithBase64Response() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_base64_response.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponseDsml extendedResponse = ( ExtendedResponseDsml ) parser.getBatchResponse().getCurrentResponse(); assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( extendedResponse.getResponseValue() ) ); } /** * Test parsing of a response with an malformed Base64 response : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testResponseWithMalformedBase64Response() { testParsingFail( ExtendedResponseTest.class, "response_with_malformed_base64_response.xml" ); } /** * Test parsing of a response with empty Response */ @Test public void testResponseWithEmptyResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_empty_response.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponseDsml extendedResponse = ( ExtendedResponseDsml ) parser.getBatchResponse().getCurrentResponse(); assertEquals( "", Strings.utf8ToString( extendedResponse.getResponseValue() ) ); } /** * Test parsing of a response with Response Name and Response */ @Test public void testResponseWithResponseNameAndResponse() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ExtendedResponseTest.class.getResource( "response_with_responseName_and_response.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ExtendedResponseDsml extendedResponse = ( ExtendedResponseDsml ) parser.getBatchResponse().getCurrentResponse(); assertEquals( "This is a response", Strings.utf8ToString( extendedResponse.getResponseValue() ) ); try { assertEquals( Oid.fromString( "1.2.3.4.5.6.7.8.9.0" ).toString(), extendedResponse.getResponseName().toString() ); } catch ( DecoderException e ) { fail(); } } /** * Test parsing of a response with wrong Descr attribute */ @Test public void testResponseWithWrongDescr() { testParsingFail( ExtendedResponseTest.class, "response_with_wrong_descr.xml" ); } } modDNRequest/000077500000000000000000000000001525525160600344765ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2ModifyDNRequestTest.java000066400000000000000000000333671525525160600412370ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modDNRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.modDNRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.ModifyDnRequest; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Modify Dn Request parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class ModifyDNRequestTest extends AbstractTest { /** * Test parsing of a request with the (optional) requestID attribute */ @Test public void testRequestWithRequestId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 456, modifyDNRequest.getMessageId() ); } /** * Test parsing of a request with the (optional) requestID attribute below 0 */ @Test public void testRequestWithRequestIdbelowBelow0() { testParsingFail( ModifyDNRequestTest.class, "request_with_requestID_below_0.xml" ); } /** * Test parsing of a request with a (optional) Control element */ @Test public void testRequestWith1Control() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = modifyDNRequest.getControls(); assertEquals( 1, modifyDNRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with a (optional) Control element with Base64 Value */ @Test public void testRequestWith1ControlBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = modifyDNRequest.getControls(); assertEquals( 1, modifyDNRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with an malformed Base64 control : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1ControlMalformedBase64Value() { testParsingFail( ModifyDNRequestTest.class, "request_with_1_control_malformed_base64_value.xml" ); } /** * Test parsing of a request with a (optional) Control element with empty value */ @Test public void testRequestWith1ControlEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = modifyDNRequest.getControls(); assertEquals( 1, modifyDNRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with 2 (optional) Control elements */ @Test public void testRequestWith2Controls() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = modifyDNRequest.getControls(); assertEquals( 2, modifyDNRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with 3 (optional) Control elements without value */ @Test public void testRequestWith3ControlsWithoutValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = modifyDNRequest.getControls(); assertEquals( 3, modifyDNRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request without dn attribute */ @Test public void testRequestWithoutDnAttribute() { testParsingFail( ModifyDNRequestTest.class, "request_without_dn_attribute.xml" ); } /** * Test parsing of a request without newrdn attribute */ @Test public void testRequestWithoutNewRdnAttribute() { testParsingFail( ModifyDNRequestTest.class, "request_without_newrdn_attribute.xml" ); } /** * Test parsing of a request without dn and newrdn attributes */ @Test public void testRequestWithDnAndNewRdnAttributes() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_dn_and_newrdn_attributes.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( modifyDNRequest.getName().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); assertEquals( "CN=Steve Jobs", modifyDNRequest.getNewRdn().getName() ); } /** * Test parsing of a request with deleteoldrdn to true */ @Test public void testRequestWithDeleteOldRdnTrue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_true.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( modifyDNRequest.getDeleteOldRdn() ); } /** * Test parsing of a request with deleteoldrdn to 1 */ @Test public void testRequestWithDeleteOldRdn1() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_1.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( modifyDNRequest.getDeleteOldRdn() ); } /** * Test parsing of a request with deleteoldrdn to false */ @Test public void testRequestWithDeleteOldRdnFalse() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_false.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); assertFalse( modifyDNRequest.getDeleteOldRdn() ); } /** * Test parsing of a request with deleteoldrdn to 0 */ @Test public void testRequestWithDeleteOldRdn0() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_0.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); assertFalse( modifyDNRequest.getDeleteOldRdn() ); } /** * Test parsing of a request with deleteoldrdn to an error value */ @Test public void testRequestWithDeleteOldRdnError() { testParsingFail( ModifyDNRequestTest.class, "request_with_deleteoldrdn_error.xml" ); } /** * Test parsing of a request with newSuperior attribute */ @Test public void testRequestWithNewSuperior() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_newSuperior_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( modifyDNRequest.getNewSuperior().equals( "cn=Steve Jobs,ou=Dev,dc=apple,dc=com" ) ); } /** * Test parsing of a request with a needed requestID attribute * * DIRSTUDIO-1 */ @Test public void testRequestWithNeededRequestId() { testParsingFail( ModifyDNRequestTest.class, "request_with_needed_requestID.xml" ); } } modDNResponse/000077500000000000000000000000001525525160600346445ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2ModifyDNResponseTest.java000066400000000000000000000400171525525160600415410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modDNResponse/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.modDNResponse; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Collection; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.ModifyDnResponse; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Modify Dn Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class ModifyDNResponseTest extends AbstractResponseTest { /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( 456, modifyDNResponse.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( ModifyDNResponseTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response with a (optional) Control element */ @Test public void testResponseWith1Control() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = modifyDNResponse.getControls(); assertEquals( 1, modifyDNResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with a (optional) Control element with empty value */ @Test public void testResponseWith1ControlEmptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = modifyDNResponse.getControls(); assertEquals( 1, modifyDNResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response with 2 (optional) Control elements */ @Test public void testResponseWith2Controls() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = modifyDNResponse.getControls(); assertEquals( 2, modifyDNResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with 3 (optional) Control elements without value */ @Test public void testResponseWith3ControlsWithoutValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = modifyDNResponse.getControls(); assertEquals( 3, modifyDNResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response without Result Code element */ @Test public void testResponseWithoutResultCode() { testParsingFail( ModifyDNResponseTest.class, "response_without_result_code.xml" ); } /** * Test parsing of a response with Result Code element but a not integer value */ @Test public void testResponseWithResultCodeNotInteger() { testParsingFail( ModifyDNResponseTest.class, "response_with_result_code_not_integer.xml" ); } /** * Test parsing of a response with Result Code */ @Test public void testResponseWithResultCode() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyDNResponse.getLdapResult(); assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() ); } /** * Test parsing of a response with Error Message */ @Test public void testResponseWithErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyDNResponse.getLdapResult(); assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult .getDiagnosticMessage() ); } /** * Test parsing of a response with empty Error Message */ @Test public void testResponseWithEmptyErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_empty_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyDNResponse.getLdapResult(); assertNull( ldapResult.getDiagnosticMessage() ); } /** * Test parsing of a response with a Referral */ @Test public void testResponseWith1Referral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyDNResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with an empty Referral */ @Test public void testResponseWith1EmptyReferral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_empty_referral.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyDNResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 0, referrals.size() ); } /** * Test parsing of a response with 2 Referral elements */ @Test public void testResponseWith2Referrals() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_2_referrals.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyDNResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 2, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apple.com/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with a Referral and an Error Message */ @Test public void testResponseWith1ReferralAndAnErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyDNResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with MatchedDN attribute */ @Test public void testResponseWithMatchedDNAttribute() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyDNResponse.getLdapResult(); assertTrue( ldapResult.getMatchedDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a response with wrong matched Dn */ @Test public void testResponseWithWrongMatchedDN() { testParsingFail( ModifyDNResponseTest.class, "response_with_wrong_matchedDN_attribute.xml" ); } /** * Test parsing of a response with wrong Descr attribute */ @Test public void testResponseWithWrongDescr() { testParsingFail( ModifyDNResponseTest.class, "response_with_wrong_descr.xml" ); } } modifyRequest/000077500000000000000000000000001525525160600347645ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2ModifyRequestTest.java000066400000000000000000000552161525525160600413000ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modifyRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.modifyRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.Iterator; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.ldap.model.entry.Attribute; import org.apache.directory.api.ldap.model.entry.Modification; import org.apache.directory.api.ldap.model.entry.ModificationOperation; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.ModifyRequest; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Modify Request parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class ModifyRequestTest extends AbstractTest { /** * Test parsing of a request with the (optional) requestID attribute */ @Test public void testRequestWithRequestId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_requestID_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 456, modifyRequest.getMessageId() ); } /** * Test parsing of a request with the (optional) requestID attribute below 0 */ @Test public void testRequestWithRequestIdBelow0() { testParsingFail( ModifyRequestTest.class, "request_with_requestID_below_0.xml" ); } /** * Test parsing of a request with a (optional) Control element */ @Test public void testRequestWith1Control() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = modifyRequest.getControls(); assertEquals( 1, modifyRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with a (optional) Control element with Base64 Value */ @Test public void testRequestWith1ControlBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = modifyRequest.getControls(); assertEquals( 1, modifyRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with an malformed Base64 control : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1ControlMalformedBase64Value() { testParsingFail( ModifyRequestTest.class, "request_with_1_control_malformed_base64_value.xml" ); } /** * Test parsing of a request with a (optional) Control element with empty value */ @Test public void testRequestWith1ControlEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = modifyRequest.getControls(); assertEquals( 1, modifyRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with 2 (optional) Control elements */ @Test public void testRequestWith2Controls() { Dsmlv2Parser parser = null; try { parser = newParser(); parser .setInput( ModifyRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = modifyRequest.getControls(); assertEquals( 2, modifyRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with 3 (optional) Control elements without value */ @Test public void testRequestWith3ControlsWithoutValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = modifyRequest.getControls(); assertEquals( 3, modifyRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request without dn attribute */ @Test public void testRequestWithoutDnAttribute() { testParsingFail( ModifyRequestTest.class, "request_without_dn_attribute.xml" ); } /** * Test parsing of a request with a Modification element * @throws LdapException If the test failed */ @Test public void testRequestWith1Modification() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_modification.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Collection modifications = modifyRequest.getModifications(); assertEquals( 1, modifications.size() ); Modification modification = modifications.iterator().next(); assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() ); Attribute attribute = modification.getAttribute(); assertEquals( "directreport", attribute.getId() ); assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get().getString() ); } /** * Test parsing of a request with a Modification element and Increment operation * @throws LdapException If the test failed */ @Test public void testRequestWith1ModificationIncrement() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_modification_increment.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Collection modifications = modifyRequest.getModifications(); assertEquals( 1, modifications.size() ); Modification modification = modifications.iterator().next(); assertEquals( ModificationOperation.INCREMENT_ATTRIBUTE, modification.getOperation() ); Attribute attribute = modification.getAttribute(); assertEquals( "uidnumber", attribute.getId() ); assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get().getString() ); } /** * Test parsing of a request with a Modification element with Base64 Value * @throws LdapException If the test failed */ @Test public void testRequestWith1ModificationBase64Value() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_modification_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Collection modifications = modifyRequest.getModifications(); assertEquals( 1, modifications.size() ); Modification modification = modifications.iterator().next(); Attribute attribute = modification.getAttribute(); assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() ); assertEquals( "directreport", attribute.getId() ); String expected = new String( new byte[] { 'c', 'n', '=', 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', 'L', ( byte ) 0xc3, ( byte ) 0xa9, 'c', 'h', 'a', 'r', 'n', 'y', ',', ' ', 'o', 'u', '=', 'p', 'e', 'o', 'p', 'l', 'e', ',', ' ', 'd', 'c', '=', 'e', 'x', 'a', 'm', 'p', 'l', 'e', ',', ' ', 'd', 'c', '=', 'c', 'o', 'm' }, StandardCharsets.UTF_8 ); assertEquals( expected, attribute.get().getString() ); } /** * Test parsing of a request with an malformed Base64 control : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1ModificationMalformedBase64Value() { testParsingFail( ModifyRequestTest.class, "request_with_1_modification_malformed_base64_value.xml" ); } /** * Test parsing of a request with 2 Modification elements * @throws LdapException If the test failed */ @Test public void testRequestWith2Modifications() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_2_modifications.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Collection modifications = modifyRequest.getModifications(); assertEquals( 2, modifications.size() ); Iterator iter = modifications.iterator(); Modification modification = iter.next(); assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() ); Attribute attribute = modification.getAttribute(); assertEquals( "directreport", attribute.getId() ); assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get().getString() ); modification = iter.next(); attribute = modification.getAttribute(); assertEquals( "sn", attribute.getId() ); assertEquals( ModificationOperation.REPLACE_ATTRIBUTE, modification.getOperation() ); assertEquals( "CN=Steve Jobs, DC=apple, DC=com", attribute.get().getString() ); } /** * Test parsing of a request without name attribute to the Modification element */ @Test public void testRequestWithoutNameAttribute() { testParsingFail( ModifyRequestTest.class, "request_without_name_attribute.xml" ); } /** * Test parsing of a request without operation attribute to the Modification element */ @Test public void testRequestWithoutOperationAttribute() { testParsingFail( ModifyRequestTest.class, "request_without_operation_attribute.xml" ); } /** * Test parsing of a request with operation attribute to Add value * @throws LdapException If the test failed */ @Test public void testRequestWithOperationAdd() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_operation_add.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Collection modifications = modifyRequest.getModifications(); assertEquals( 1, modifications.size() ); Modification modification = modifications.iterator().next(); assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() ); } /** * Test parsing of a request with operation attribute to Delete value * @throws LdapException If the test failed */ @Test public void testRequestWithOperationDelete() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_operation_delete.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Collection modifications = modifyRequest.getModifications(); assertEquals( 1, modifications.size() ); Modification modification = modifications.iterator().next(); assertEquals( ModificationOperation.REMOVE_ATTRIBUTE, modification.getOperation() ); } /** * Test parsing of a request with operation attribute to Replace value * @throws LdapException If the test failed */ @Test public void testRequestWithOperationReplace() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_operation_replace.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Collection modifications = modifyRequest.getModifications(); assertEquals( 1, modifications.size() ); Modification modification = modifications.iterator().next(); assertEquals( ModificationOperation.REPLACE_ATTRIBUTE, modification.getOperation() ); } /** * Test parsing of a request without operation attribute to the Modification element */ @Test public void testRequestWithOperationError() { testParsingFail( ModifyRequestTest.class, "request_with_operation_error.xml" ); } /** * Test parsing of a request with a Modification element without Value element * @throws LdapException If the test failed */ @Test public void testRequestWithModificationWithoutValue() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_modification_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Collection modifications = modifyRequest.getModifications(); assertEquals( 1, modifications.size() ); Modification modification = modifications.iterator().next(); assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() ); Attribute attribute = modification.getAttribute(); assertEquals( "directreport", attribute.getId() ); assertEquals( 0, attribute.size() ); } /** * Test parsing of a request with a Modification element * @throws LdapException If the test failed */ @Test public void testRequestWithModificationWith2Values() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_modification_with_2_values.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Collection modifications = modifyRequest.getModifications(); assertEquals( 1, modifications.size() ); Modification modification = modifications.iterator().next(); assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() ); Attribute attribute = modification.getAttribute(); assertEquals( "directreport", attribute.getId() ); assertEquals( 2, attribute.size() ); assertTrue( attribute.contains( "CN=John Smith, DC=microsoft, DC=com" ) ); assertTrue( attribute.contains( "CN=Steve Jobs, DC=apple, DC=com" ) ); } /** * Test parsing of a request with a Modification element with an empty value * @throws LdapException If the test failed */ @Test public void testRequestWithModificationWithEmptyValue() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( ModifyRequestTest.class.getResource( "request_with_modification_with_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest(); Collection modifications = modifyRequest.getModifications(); assertEquals( 1, modifications.size() ); Modification modification = modifications.iterator().next(); assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() ); Attribute attribute = modification.getAttribute(); assertEquals( "directreport", attribute.getId() ); assertEquals( 1, attribute.size() ); assertEquals( "", attribute.get().getString() ); } /** * Test parsing of a request with a needed requestID attribute * * DIRSTUDIO-1 */ @Test public void testRequestWithNeededRequestId() { testParsingFail( ModifyRequestTest.class, "request_with_needed_requestID.xml" ); } } modifyResponse/000077500000000000000000000000001525525160600351325ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2ModifyResponseTest.java000066400000000000000000000375641525525160600416220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modifyResponse/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.modifyResponse; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Collection; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.ModifyResponse; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Modify Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class ModifyResponseTest extends AbstractResponseTest { /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); assertEquals( 456, modifyResponse.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( ModifyResponseTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response with a (optional) Control element */ @Test public void testResponseWith1Control() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = modifyResponse.getControls(); assertEquals( 1, modifyResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with a (optional) Control element with empty value */ @Test public void testResponseWith1ControlEmptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = modifyResponse.getControls(); assertEquals( 1, modifyResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response with 2 (optional) Control elements */ @Test public void testResponseWith2Controls() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = modifyResponse.getControls(); assertEquals( 2, modifyResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with 3 (optional) Control elements without value */ @Test public void testResponseWith3ControlsWithoutValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); Map controls = modifyResponse.getControls(); assertEquals( 3, modifyResponse.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response without Result Code element */ @Test public void testResponseWithoutResultCode() { testParsingFail( ModifyResponseTest.class, "response_without_result_code.xml" ); } /** * Test parsing of a response with Result Code element but a not integer value */ @Test public void testResponseWithResultCodeNotInteger() { testParsingFail( ModifyResponseTest.class, "response_with_result_code_not_integer.xml" ); } /** * Test parsing of a response with Result Code */ @Test public void testResponseWithResultCode() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() ); } /** * Test parsing of a response with Error Message */ @Test public void testResponseWithErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult .getDiagnosticMessage() ); } /** * Test parsing of a response with empty Error Message */ @Test public void testResponseWithEmptyErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_empty_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); assertNull( ldapResult.getDiagnosticMessage() ); } /** * Test parsing of a response with a Referral */ @Test public void testResponseWith1Referral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with an empty Referral */ @Test public void testResponseWith1EmptyReferral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 0, referrals.size() ); } /** * Test parsing of a response with 2 Referral elements */ @Test public void testResponseWith2Referrals() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_2_referrals.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 2, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apple.com/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with a Referral and an Error Message */ @Test public void testResponseWith1ReferralAndAnErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with MatchedDN attribute */ @Test public void testResponseWithMatchedDNAttribute() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); assertTrue( ldapResult.getMatchedDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a response with wrong matched Dn */ @Test public void testResponseWithWrongMatchedDN() { testParsingFail( ModifyResponseTest.class, "response_with_wrong_matchedDN_attribute.xml" ); } /** * Test parsing of a response with wrong Descr attribute */ @Test public void testResponseWithWrongDescr() { testParsingFail( ModifyResponseTest.class, "response_with_wrong_descr.xml" ); } } searchRequest/000077500000000000000000000000001525525160600347425ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2SearchRequestFilterDepthTest.java000066400000000000000000000072241525525160600433630ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.searchRequest; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.dsmlv2.request.SearchRequestDsml; import org.apache.directory.api.ldap.model.message.SearchRequest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; import org.xmlpull.v1.XmlPullParserException; /** * Tests that the depth of a searchRequest filter, which is fully driven by * the incoming DSML document, is bounded : a deeply nested filter must be * rejected with an XmlPullParserException instead of triggering a * StackOverflowError. * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class SearchRequestFilterDepthTest extends AbstractTest { /** * Build a batchRequest whose searchRequest filter is depth * nested <not> elements around a present filter. */ private String buildRequestWithNestedNot( int depth ) { StringBuilder sb = new StringBuilder(); sb.append( "" ); sb.append( "" ); sb.append( "" ); for ( int i = 0; i < depth; i++ ) { sb.append( "" ); } sb.append( "" ); for ( int i = 0; i < depth; i++ ) { sb.append( "" ); } sb.append( "" ); sb.append( "" ); sb.append( "" ); return sb.toString(); } /** * A filter nested deeper than the default limit must be rejected with an * XmlPullParserException, not a StackOverflowError. */ @Test public void testDeeplyNestedFilterIsRejected() throws Exception { Dsmlv2Parser parser = newParser(); parser.setInput( buildRequestWithNestedNot( SearchRequestDsml.DEFAULT_MAX_FILTER_DEPTH + 10 ) ); assertThrows( XmlPullParserException.class, parser::parse ); } /** * A reasonably nested filter must still parse fine. */ @Test public void testReasonablyNestedFilterIsAccepted() throws Exception { Dsmlv2Parser parser = newParser(); parser.setInput( buildRequestWithNestedNot( 10 ) ); parser.parse(); SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertNotNull( searchRequest.getFilter() ); } } SearchRequestTest.java000066400000000000000000002166721525525160600412410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchRequest/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.searchRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.List; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.DsmlLiterals; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.dsmlv2.request.SearchRequestDsml; import org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.filter.AndNode; import org.apache.directory.api.ldap.model.filter.ApproximateNode; import org.apache.directory.api.ldap.model.filter.EqualityNode; import org.apache.directory.api.ldap.model.filter.ExprNode; import org.apache.directory.api.ldap.model.filter.ExtensibleNode; import org.apache.directory.api.ldap.model.filter.GreaterEqNode; import org.apache.directory.api.ldap.model.filter.LessEqNode; import org.apache.directory.api.ldap.model.filter.NotNode; import org.apache.directory.api.ldap.model.filter.OrNode; import org.apache.directory.api.ldap.model.filter.PresenceNode; import org.apache.directory.api.ldap.model.filter.SubstringNode; import org.apache.directory.api.ldap.model.message.AliasDerefMode; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.SearchRequest; import org.apache.directory.api.ldap.model.message.SearchScope; import org.apache.directory.api.util.Strings; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Search Request parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class SearchRequestTest extends AbstractTest { /** * Test parsing of a request without the dn attribute */ @Test public void testRequestWithoutDn() { testParsingFail( SearchRequestTest.class, "request_without_dn_attribute.xml" ); } /** * Test parsing of a request with the dn attribute */ @Test public void testRequestWithDn() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_dn_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( "ou=marketing,dc=microsoft,dc=com", searchRequest.getBase().getName() ); } /** * Test parsing of a request with the (optional) requestID attribute */ @Test public void testRequestWithRequestId() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_requestID_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 456, searchRequest.getMessageId() ); } /** * Test parsing of a request with the (optional) requestID attribute below 0 */ @Test public void testRequestWithRequestIdBelow0() { testParsingFail( SearchRequestTest.class, "request_with_requestID_below_0.xml" ); } /** * Test parsing of a request with a (optional) Control element */ @Test public void testRequestWith1Control() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = searchRequest.getControls(); assertEquals( 1, searchRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with a (optional) Control element with Base64 value */ @Test public void testRequestWith1ControlBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = searchRequest.getControls(); assertEquals( 1, searchRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with an malformed Base64 control : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWith1ControlMalformedBase64Value() { testParsingFail( SearchRequestTest.class, "request_with_1_control_malformed_base64_value.xml" ); } /** * Test parsing of a request with a (optional) Control element with empty value */ @Test public void testRequestWith1ControlEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = searchRequest.getControls(); assertEquals( 1, searchRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request with 2 (optional) Control elements */ @Test public void testRequestWith2Controls() { Dsmlv2Parser parser = null; try { parser = newParser(); parser .setInput( SearchRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = searchRequest.getControls(); assertEquals( 2, searchRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a request with 3 (optional) Control elements without value */ @Test public void testRequestWith3ControlsWithoutValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); Map controls = searchRequest.getControls(); assertEquals( 3, searchRequest.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a request without the Filter element */ @Test public void testRequestWithoutFilter() { testParsingFail( SearchRequestTest.class, "request_without_filter.xml" ); } /** * Test parsing of a request without scope attribute */ @Test public void testRequestWithoutScopeAttribute() { testParsingFail( SearchRequestTest.class, "request_without_scope_attribute.xml" ); } /** * Test parsing of a request with scope attribute to BaseObject value */ @Test public void testRequestWithScopeBaseObject() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_scope_baseObject.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( SearchScope.OBJECT, searchRequest.getScope() ); } /** * Test parsing of a request with scope attribute to SingleLevel value */ @Test public void testRequestWithScopeSingleLevel() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_scope_singleLevel.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() ); } /** * Test parsing of a request with scope attribute to WholeSubtree value */ @Test public void testRequestWithScopeWholeSubtree() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_scope_wholeSubtree.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( SearchScope.SUBTREE, searchRequest.getScope() ); } /** * Test parsing of a request with scope attribute to Error value */ @Test public void testRequestWithScopeError() { testParsingFail( SearchRequestTest.class, "request_with_scope_error.xml" ); } /** * Test parsing of a request without derefAliases attribute */ @Test public void testRequestWithoutDerefAliasesAttribute() { testParsingFail( SearchRequestTest.class, "request_without_derefAliases_attribute.xml" ); } /** * Test parsing of a request with derefAliases attribute to derefAlways value */ @Test public void testRequestWithDerefAliasesDerefAlways() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_derefAliases_derefAlways.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( AliasDerefMode.DEREF_ALWAYS, searchRequest.getDerefAliases() ); } /** * Test parsing of a request with derefAliases attribute to derefFindingBaseObj value */ @Test public void testRequestWithDerefAliasesDerefFindingBaseObj() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_derefAliases_derefFindingBaseObj.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( AliasDerefMode.DEREF_FINDING_BASE_OBJ, searchRequest.getDerefAliases() ); } /** * Test parsing of a request with derefAliases attribute to derefinSearching value */ @Test public void testRequestWithDerefAliasesDerefinSearching() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_derefAliases_derefInSearching.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( AliasDerefMode.DEREF_IN_SEARCHING, searchRequest.getDerefAliases() ); } /** * Test parsing of a request with derefAliases attribute to neverDerefAliases value */ @Test public void testRequestWithDerefAliasesNeverDerefAliases() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_derefAliases_neverDerefAliases.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( AliasDerefMode.NEVER_DEREF_ALIASES, searchRequest.getDerefAliases() ); } /** * Test parsing of a request with derefAliases attribute to Error value */ @Test public void testRequestWithDerefAliasesError() { testParsingFail( SearchRequestTest.class, "request_with_derefAliases_error.xml" ); } /** * Test parsing of a request with the sizeLimit (optional) attribute */ @Test public void testRequestWithSizeLimitAttribute() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_sizeLimit_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 1000, searchRequest.getSizeLimit() ); } /** * Test parsing of a request with sizeLimit attribute to Error value */ @Test public void testRequestWithSizeLimitError() { testParsingFail( SearchRequestTest.class, "request_with_sizeLimit_error.xml" ); } /** * Test parsing of a request with the timeLimit (optional) attribute */ @Test public void testRequestWithTimeLimitAttribute() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_timeLimit_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertEquals( 60, searchRequest.getTimeLimit() ); } /** * Test parsing of a request with timeLimit attribute to Error value */ @Test public void testRequestWithTimeLimitError() { testParsingFail( SearchRequestTest.class, "request_with_timeLimit_error.xml" ); } /** * Test parsing of a request with typesOnly to true */ @Test public void testRequestWithTypesOnlyTrue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_typesOnly_true.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( searchRequest.getTypesOnly() ); } /** * Test parsing of a request with typesOnly to 1 */ @Test public void testRequestWithTypesOnly1() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_typesOnly_1.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( searchRequest.getTypesOnly() ); } /** * Test parsing of a request with typesOnly to false */ @Test public void testRequestWithTypesOnlyFalse() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_typesOnly_false.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertFalse( searchRequest.getTypesOnly() ); } /** * Test parsing of a request with typesOnly to 0 */ @Test public void testRequestWithTypesOnlyRdn0() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_typesOnly_0.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertFalse( searchRequest.getTypesOnly() ); } /** * Test parsing of a request with typesOnly to an error value */ @Test public void testRequestWithTypesOnlyError() { testParsingFail( SearchRequestTest.class, "request_with_typesOnly_error.xml" ); } /** * Test parsing of a request with 2 Filter elements */ @Test public void testRequestWith2Filters() { testParsingFail( SearchRequestTest.class, "request_with_2_filters.xml" ); } /** * Test parsing of a request with Attibutes Element but not any Attribute element */ @Test public void testRequestWithAttributesButNoAttribute() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_attributes_but_no_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } assertTrue( true ); } /** * Test parsing of a request with 2 Attributes elements */ @Test public void testRequestWith2AttributesElements() { testParsingFail( SearchRequestTest.class, "request_with_2_attributes_elements.xml" ); } /** * Test parsing of a request with an Attributes element with 1 Attribute element * @throws LdapException If the test failed */ @Test public void testRequestWithAttributes1Attribute() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_attributes_1_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); List attributes = searchRequest.getAttributes(); assertEquals( 1, attributes.size() ); String attribute = attributes.get( 0 ); assertEquals( "sn", attribute ); } /** * Test parsing of a request with an Attributes element with 2 Attribute elements * @throws LdapException If the test failed */ @Test public void testRequestWithAttributes2Attribute() throws LdapException { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "request_with_attributes_2_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); List attributes = searchRequest.getAttributes(); assertEquals( 2, attributes.size() ); String attribute1 = attributes.get( 0 ); assertEquals( "sn", attribute1 ); String attribute2 = attributes.get( 1 ); assertEquals( "givenName", attribute2 ); } /** * Test parsing of a request with 1 Attribute without name attribute */ @Test public void testRequestWithAttributeWithoutNameAttribute() { testParsingFail( SearchRequestTest.class, "request_with_attribute_without_name_attribute.xml" ); } /** * Test parsing of a request with empty Filter element */ @Test public void testRequestWithEmptyFilter() { testParsingFail( SearchRequestTest.class, "request_with_empty_filter.xml" ); } /** * Test parsing of a request with an And Filter */ @Test public void testRequestWithAndFilter() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_and.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof AndNode ); } /** * Test parsing of a request with an Or Filter */ @Test public void testRequestWithOrFilter() { Dsmlv2Parser parser = null; try { parser = newParser(); parser .setInput( SearchRequestTest.class.getResource( "filters/request_with_or.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof OrNode ); } /** * Test parsing of a request with an Or Filter */ @Test public void testRequestWithNotFilter() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_not.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof NotNode ); } /** * Test parsing of a request with empty Filter element */ @Test public void testRequestWithNotFilterWith2Children() { testParsingFail( SearchRequestTest.class, "filters/request_with_not_with_2_children.xml" ); } /** * Test parsing of a request with an approxMatch Filter */ @Test public void testRequestWithApproxMatchFilter() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_approxMatch.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ApproximateNode ); ApproximateNode approxMatchFilter = ( ApproximateNode ) filter; assertEquals( "sn", approxMatchFilter.getAttribute() ); assertEquals( "foobar", approxMatchFilter.getValue().getString() ); } /** * Test parsing of a request with an approxMatch Filter with base64 value */ @Test public void testRequestWithApproxMatchFilterBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_approxMatch_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ApproximateNode ); ApproximateNode approxMatchFilter = ( ApproximateNode ) filter; assertEquals( "sn", approxMatchFilter.getAttribute() ); assertEquals( "DSMLv2.0 rocks!!", approxMatchFilter.getValue().getString() ); } /** * Test parsing of a request with an malformed Base64 filter : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWithApproxMatchMalformedBase64Value() { testParsingFail( SearchRequestTest.class, "filters/request_with_approxMatch_malformed_base64_value.xml" ); } /** * Test parsing of a request with an approxMatch Filter with empty value */ @Test public void testRequestWithApproxMatchFilterEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_approxMatch_with_empty_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ApproximateNode ); ApproximateNode approxMatchFilter = ( ApproximateNode ) filter; assertEquals( "sn", approxMatchFilter.getAttribute() ); assertEquals( "", approxMatchFilter.getValue().getString() ); } /** * Test parsing of a request with approxMatch Filter but no name attribute */ @Test public void testRequestWithApproxMatchFilterWithoutName() { testParsingFail( SearchRequestTest.class, "filters/request_with_approxMatch_without_name.xml" ); } /** * Test parsing of a request with approxMatch Filter but no value element */ @Test public void testRequestWithApproxMatchFilterWithoutValue() { testParsingFail( SearchRequestTest.class, "filters/request_with_approxMatch_without_value.xml" ); } /** * Test parsing of a request with approxMatch Filter with 2 Value elements */ @Test public void testRequestWithApproxMatchFilterWith2Values() { testParsingFail( SearchRequestTest.class, "filters/request_with_approxMatch_with_2_values.xml" ); } /** * Test parsing of a request with an greaterOrEqual Filter */ @Test public void testRequestWithGreaterOrEqualFilter() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_greaterOrEqual.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof GreaterEqNode ); GreaterEqNode greaterEqFilter = ( GreaterEqNode ) filter; assertEquals( "sn", greaterEqFilter.getAttribute() ); assertEquals( "foobar", greaterEqFilter.getValue().getString() ); } /** * Test parsing of a request with an greaterOrEqual Filter with base64 value */ @Test public void testRequestWithGreaterOrEqualFilterBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_greaterOrEqual_base64_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof GreaterEqNode ); GreaterEqNode greaterEqFilter = ( GreaterEqNode ) filter; assertEquals( "sn", greaterEqFilter.getAttribute() ); assertEquals( "DSMLv2.0 rocks!!", greaterEqFilter.getValue().getString() ); } /** * Test parsing of a request with an malformed Base64 filter : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWithGreaterOrEqualFilterMalformedBase64Value() { testParsingFail( SearchRequestTest.class, "filters/request_with_greaterOrEqual_malformed_base64_value.xml" ); } /** * Test parsing of a request with an greaterOrEqual Filter with an empty value */ @Test public void testRequestWithGreaterOrEqualFilterEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_greaterOrEqual_with_empty_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof GreaterEqNode ); GreaterEqNode greaterEqFilter = ( GreaterEqNode ) filter; assertEquals( "sn", greaterEqFilter.getAttribute() ); assertEquals( "", greaterEqFilter.getValue().getString() ); } /** * Test parsing of a request with greaterOrEqual Filter but no name attribute */ @Test public void testRequestWithGreaterOrEqualFilterWithoutName() { testParsingFail( SearchRequestTest.class, "filters/request_with_greaterOrEqual_without_name.xml" ); } /** * Test parsing of a request with greaterOrEqual Filter but no value element */ @Test public void testRequestWithGreaterOrEqualFilterWithoutValue() { testParsingFail( SearchRequestTest.class, "filters/request_with_greaterOrEqual_without_value.xml" ); } /** * Test parsing of a request with greaterOrEqual Filter with 2 Value elements */ @Test public void testRequestWithGreaterOrEqualFilterWith2Values() { testParsingFail( SearchRequestTest.class, "filters/request_with_greaterOrEqual_with_2_values.xml" ); } /** * Test parsing of a request with an lessOrEqual Filter */ @Test public void testRequestWithLessOrEqualFilter() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_lessOrEqual.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof LessEqNode ); LessEqNode lessOrEqFilter = ( LessEqNode ) filter; assertEquals( "sn", lessOrEqFilter.getAttribute() ); assertEquals( "foobar", lessOrEqFilter.getValue().getString() ); } /** * Test parsing of a request with an lessOrEqual Filter with Base64 value */ @Test public void testRequestWithLessOrEqualFilterBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_lessOrEqual_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof LessEqNode ); LessEqNode lessOrEqFilter = ( LessEqNode ) filter; assertEquals( "sn", lessOrEqFilter.getAttribute() ); assertEquals( "DSMLv2.0 rocks!!", lessOrEqFilter.getValue().getString() ); } /** * Test parsing of a request with an malformed Base64 filter : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWithLessOrEqualFilterMalformedBase64Value() { testParsingFail( SearchRequestTest.class, "filters/request_with_lessOrEqual_malformed_base64_value.xml" ); } /** * Test parsing of a request with an lessOrEqual Filter */ @Test public void testRequestWithLessOrEqualFilterEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_lessOrEqual_with_empty_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof LessEqNode ); LessEqNode lessOrEqFilter = ( LessEqNode ) filter; assertEquals( "sn", lessOrEqFilter.getAttribute() ); assertEquals( "", lessOrEqFilter.getValue().getString() ); } /** * Test parsing of a request with lessOrEqual Filter but no name attribute */ @Test public void testRequestWithLessOrEqualFilterWithoutName() { testParsingFail( SearchRequestTest.class, "filters/request_with_lessOrEqual_without_name.xml" ); } /** * Test parsing of a request with lessOrEqual Filter but no value element */ @Test public void testRequestWithLessOrEqualFilterWithoutValue() { testParsingFail( SearchRequestTest.class, "filters/request_with_lessOrEqual_without_value.xml" ); } /** * Test parsing of a request with lessOrEqual Filter with 2 Value elements */ @Test public void testRequestWithLessOrEqualFilterWith2Values() { testParsingFail( SearchRequestTest.class, "filters/request_with_lessOrEqual_with_2_values.xml" ); } /** * Test parsing of a request with an Equality Filter */ @Test public void testRequestWithEqualityMatchFilter() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_equalityMatch.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof EqualityNode ); EqualityNode equalityFilter = ( EqualityNode ) filter; assertEquals( "sn", equalityFilter.getAttribute() ); assertEquals( "foobar", equalityFilter.getValue().getString() ); } /** * Test parsing of a request with an malformed Base64 filter : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWithEqualityMatchFilterMalformedBase64Value() { testParsingFail( SearchRequestTest.class, "filters/request_with_equalityMatch_malformed_base64_value.xml" ); } /** * Test parsing of a request with an Equality Filter with an empty value */ @Test public void testRequestWithEqualityMatchFilterWithEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_equalityMatch_with_empty_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof EqualityNode ); EqualityNode equalityFilter = ( EqualityNode ) filter; assertEquals( "sn", equalityFilter.getAttribute() ); assertEquals( "", equalityFilter.getValue().getString() ); } /** * Test parsing of a request with EqualityMatch Filter but no name attribute */ @Test public void testRequestWithEqualityMatchFilterWithoutName() { testParsingFail( SearchRequestTest.class, "filters/request_with_equalityMatch_without_name.xml" ); } /** * Test parsing of a request with EqualityMatch Filter but no value element */ @Test public void testRequestWithEqualityMatchFilterWithoutValue() { testParsingFail( SearchRequestTest.class, "filters/request_with_equalityMatch_without_value.xml" ); } /** * Test parsing of a request with EqualityMatch Filter with 2 Value elements */ @Test public void testRequestWithEqualityMatchFilterWith2Values() { testParsingFail( SearchRequestTest.class, "filters/request_with_equalityMatch_with_2_values.xml" ); } /** * Test parsing of a request with an Present Filter */ @Test public void testRequestWithPresentFilter() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_present.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof PresenceNode ); PresenceNode presentFilter = ( PresenceNode ) filter; assertEquals( "givenName", presentFilter.getAttribute() ); } /** * Test parsing of a request with Present Filter without name attribute */ @Test public void testRequestWithPresentWithoutName() { testParsingFail( SearchRequestTest.class, "filters/request_with_present_without_name.xml" ); } /** * Test parsing of a request with an ExtensibleMatch Filter */ @Test public void testRequestWithExtensibleMatchFilter() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ExtensibleNode ); ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter; assertEquals( "A Value", extensibleMatchFilter.getValue().getString() ); assertEquals( false, extensibleMatchFilter.hasDnAttributes() ); } /** * Test parsing of a request with an ExtensibleMatch Filter */ @Test public void testRequestWithExtensibleMatchFilterBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch_base64_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ExtensibleNode ); ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter; assertEquals( "DSMLv2.0 rocks!!", extensibleMatchFilter.getValue().getString() ); assertEquals( false, extensibleMatchFilter.hasDnAttributes() ); } /** * Test parsing of a request with an malformed Base64 filter : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWithExtensibleMatchFilterMalformedBase64Value() { testParsingFail( SearchRequestTest.class, "filters/request_with_extensibleMatch_malformed_base64_value.xml" ); } /** * Test parsing of a request with an ExtensibleMatch Filter with empty value */ @Test public void testRequestWithExtensibleMatchWithEmptyValue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch_with_empty_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ExtensibleNode ); ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter; assertNull( extensibleMatchFilter.getValue() ); assertEquals( false, extensibleMatchFilter.hasDnAttributes() ); } /** * Test parsing of a request with ExtensibleMatch Filter without Value element */ @Test public void testRequestWithExtensibleMatchWithoutValue() { testParsingFail( SearchRequestTest.class, "filters/request_with_extensibleMatch_without_value.xml" ); } /** * Test parsing of a request with ExtensibleMatch Filter with 2 Value elements */ @Test public void testRequestWithExtensibleMatchWith2Values() { testParsingFail( SearchRequestTest.class, "filters/request_with_extensibleMatch_with_2_values.xml" ); } /** * Test parsing of a request with typesOnly to true */ @Test public void testRequestWithExtensibleMatchWithDnAttributesTrue() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch_with_dnAttributes_true.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ExtensibleNode ); ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter; assertTrue( extensibleMatchFilter.hasDnAttributes() ); } /** * Test parsing of a request with typesOnly to 1 */ @Test public void testRequestWithExtensibleMatchWithDnAttributes1() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch_with_dnAttributes_1.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ExtensibleNode ); ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter; assertTrue( extensibleMatchFilter.hasDnAttributes() ); } /** * Test parsing of a request with typesOnly to false */ @Test public void testRequestWithExtensibleMatchWithDnAttributesFalse() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch_with_dnAttributes_false.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ExtensibleNode ); ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter; assertFalse( extensibleMatchFilter.hasDnAttributes() ); } /** * Test parsing of a request with typesOnly to 0 */ @Test public void testRequestWithExtensibleMatchWithDnAttributes0() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch_with_dnAttributes_0.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ExtensibleNode ); ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter; assertFalse( extensibleMatchFilter.hasDnAttributes() ); } /** * Test parsing of a request with typesOnly to an error value */ @Test public void testRequestWithExtensibleMatchWithDnAttributesError() { testParsingFail( SearchRequestTest.class, "filters/request_with_extensibleMatch_with_dnAttributes_error.xml" ); } /** * Test parsing of a request with a matchingRule attribute */ @Test public void testRequestWithExtensibleMatchWithMatchingRule() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch_with_matchingRule.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ExtensibleNode ); ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter; assertEquals( "AMatchingRuleName", extensibleMatchFilter.getMatchingRuleId() ); } /** * Test parsing of a request with a name attribute */ @Test public void testRequestWithExtensibleMatchWithName() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch_with_name.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof ExtensibleNode ); ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter; assertEquals( "givenName", extensibleMatchFilter.getAttribute() ); } /** * Test parsing of a request with an Substrings Filter */ @Test public void testRequestWithSubstringsFilter() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; assertEquals( "sn", substringFilter.getAttribute() ); } /** * Test parsing of a request with Substrings Filter without name */ @Test public void testRequestWithSubstringsWithoutName() { testParsingFail( SearchRequestTest.class, "filters/request_with_substrings_without_name.xml" ); } /** * Test parsing of a request with a Substrings Filter with 1 Initial element */ @Test public void testRequestWithSubstrings1Initial() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_initial.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; assertEquals( "jack", substringFilter.getInitial().toString() ); } /** * Test parsing of a request with a Substrings Filter with 1 Initial element with Base64 value */ @Test public void testRequestWithSubstrings1Base64Initial() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_base64_initial.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; assertEquals( "DSMLv2.0 rocks!!", substringFilter.getInitial().toString() ); } /** * Test parsing of a request with an malformed Base64 filter : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWithSubstrings1MalformedBase64Initial() { testParsingFail( SearchRequestTest.class, "filters/request_with_substrings_1_malformed_base64_initial.xml" ); } /** * Test parsing of a request with a Substrings Filter with 1 emptyInitial element */ @Test public void testRequestWithSubstrings1EmptyInitial() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class .getResource( "filters/request_with_substrings_1_empty_initial.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; assertNull( substringFilter.getInitial() ); } /** * Test parsing of a request with a Substrings Filter with 1 Initial and 1 Any elements */ @Test public void testRequestWithSubstrings1Initial1Any() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class .getResource( "filters/request_with_substrings_1_initial_1_any.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; assertEquals( "jack", substringFilter.getInitial() ); List initials = substringFilter.getAny(); assertEquals( 1, initials.size() ); assertEquals( "kate", initials.get( 0 ).toString() ); } /** * Test parsing of a request with a Substrings Filter with 1 Initial and 1 Final elements */ @Test public void testRequestWithSubstrings1Initial1Final() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_initial_1_final.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; assertEquals( "jack", substringFilter.getInitial() ); assertEquals( "john", substringFilter.getFinal() ); } /** * Test parsing of a request with a Substrings Filter with 1 Any element */ @Test public void testRequestWithSubstrings1Any() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_any.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; List initials = substringFilter.getAny(); assertEquals( 1, initials.size() ); assertEquals( "kate", initials.get( 0 ) ); } /** * Test parsing of a request with a Substrings Filter with 1 Any element */ @Test public void testRequestWithSubstrings1Base64Any() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_base64_any.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; List initials = substringFilter.getAny(); assertEquals( 1, initials.size() ); assertEquals( "DSMLv2.0 rocks!!", initials.get( 0 ) ); } /** * Test parsing of a request with an malformed Base64 filter : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWithSubstrings1MalformedBase64Any() { testParsingFail( SearchRequestTest.class, "filters/request_with_substrings_1_malformed_base64_any.xml" ); } /** * Test parsing of a request with a Substrings Filter with 1 empty Any element */ @Test public void testRequestWithSubstrings1EmptyAny() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_empty_any.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; List initials = substringFilter.getAny(); assertEquals( 0, initials.size() ); } /** * Test parsing of a request with a Substrings Filter with 1 Any element */ @Test public void testRequestWithSubstrings2Any() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_2_any.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; List initials = substringFilter.getAny(); assertEquals( 2, initials.size() ); assertEquals( "kate", initials.get( 0 ) ); assertEquals( "sawyer", initials.get( 1 ) ); } /** * Test parsing of a request with a Substrings Filter with 1 Any and 1 Final elements */ @Test public void testRequestWithSubstrings1Any1Final() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_any_1_final.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; List initials = substringFilter.getAny(); assertEquals( 1, initials.size() ); assertEquals( "kate", initials.get( 0 ) ); assertEquals( "john", substringFilter.getFinal() ); } /** * Test parsing of a request with a Substrings Filter with 1 Final element */ @Test public void testRequestWithSubstrings1Final() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_final.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; assertEquals( "john", substringFilter.getFinal().toString() ); } /** * Test parsing of a request with a Substrings Filter with 1 Final element */ @Test public void testRequestWithSubstrings1Base64Final() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_base64_final.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; assertEquals( "DSMLv2.0 rocks!!", substringFilter.getFinal().toString() ); } /** * Test parsing of a request with an malformed Base64 filter : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testRequestWithSubstrings1MalformedBase64Final() { testParsingFail( SearchRequestTest.class, "filters/request_with_substrings_1_malformed_base64_final.xml" ); } /** * Test parsing of a request with a Substrings Filter with 1 empty Final element */ @Test public void testRequestWithSubstrings1EmptyFinal() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_empty_final.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof SubstringNode ); SubstringNode substringFilter = ( SubstringNode ) filter; assertNull( substringFilter.getFinal() ); } /** * Test parsing of a request with a needed requestID attribute * * DIRSTUDIO-1 */ @Test public void testRequestWithNeededRequestId() { testParsingFail( SearchRequestTest.class, "request_with_needed_requestID.xml" ); } /** * Test parsing of a request with a nested nodes DIRSHARED-137 */ @Test public void testRequestWithNestedNodes() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_nested_connector_nodes.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequestDsml searchRequest = ( SearchRequestDsml ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof AndNode ); assertEquals( "(&(|(sn=*foo*)(cn=*foo*))(|(ou=*josopuram*)(o=*k*)))", filter.toString() ); //System.out.println( searchRequest.toDsml( new DefaultElement( "root" ) ).asXML() ); } @Test public void testGenerateWithBase64() throws LdapException { Document document = DocumentHelper.createDocument(); Element element = document.addElement( DsmlLiterals.BATCH_RESPONSE ); element.add( ParserUtils.DSML_NAMESPACE ); element.add( ParserUtils.XSD_NAMESPACE ); element.add( ParserUtils.XSI_NAMESPACE ); SearchRequestDsml searchRequest = new SearchRequestDsml( LdapApiServiceFactory.getSingleton() ); searchRequest.setFilter( "(memberOf=cn=MercyCenterHospitalGroup,ou=Relationship,dc=HPD,o=IHE-Europe,c=FRA)" ); System.out.println( searchRequest.toDsml( element ).asXML() ); } /** * Test parsing of a request with an Equality Filter with base64 value */ @Test public void testRequestWithEqualityMatchFilterBase64Value() { Dsmlv2Parser parser = null; try { parser = newParser(); parser.setInput( SearchRequestTest.class .getResource( "filters/request_with_equalityMatch_base64_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); ExprNode filter = searchRequest.getFilter(); assertTrue( filter instanceof EqualityNode ); EqualityNode equalityFilter = ( EqualityNode ) filter; assertEquals( "sn", equalityFilter.getAttribute() ); assertEquals( "DSMLv2.0 rocks!!", equalityFilter.getValue().getString() ); } } searchResponse/000077500000000000000000000000001525525160600351105ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2SearchResponseTest.java000066400000000000000000000240121525525160600415360ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.searchResponse; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.fail; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.dsmlv2.response.SearchResponse; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Search Result Done Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class SearchResponseTest extends AbstractResponseTest { /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResponseTest.class.getResource( "response_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated(); assertEquals( 456, searchResponse.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( SearchResponseTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a Response with a Search Result Done */ @Test public void testResponseWithSRD() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResponseTest.class.getResource( "response_with_1_SRD.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated(); assertNotNull( searchResponse.getSearchResultDone() ); } /** * Test parsing of a Response with 1 Search Result Entry and a Search Result Done */ @Test public void testResponseWith1SRE1SRD() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResponseTest.class.getResource( "response_with_1_SRE_1_SRD.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated(); assertEquals( 1, searchResponse.getSearchResultEntryList().size() ); assertNotNull( searchResponse.getSearchResultDone() ); } /** * Test parsing of a Response with 1 Search Result Entry and a Search Result Done */ @Test public void testResponseWith0SRE1SRD() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResponseTest.class.getResource( "response_with_0_SRE_1_SRD.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated(); assertEquals( 0, searchResponse.getSearchResultEntryList().size() ); assertNotNull( searchResponse.getSearchResultDone() ); } /** * Test parsing of a Response with 1 Search Result Reference and a Search Result Done */ @Test public void testResponseWith1SRR1SRD() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResponseTest.class.getResource( "response_with_1_SRR_1_SRD.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated(); assertEquals( 1, searchResponse.getSearchResultReferenceList().size() ); assertNotNull( searchResponse.getSearchResultDone() ); } /** * Test parsing of a Response with 1 Search Result Entry, 1 Search Result Reference and a Search Result Done */ @Test public void testResponseWith1SRE1SRR1SRD() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResponseTest.class.getResource( "response_with_1_SRE_1_SRR_1_SRD.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated(); assertEquals( 1, searchResponse.getSearchResultEntryList().size() ); assertEquals( 1, searchResponse.getSearchResultReferenceList().size() ); assertNotNull( searchResponse.getSearchResultDone() ); } /** * Test parsing of a Response with 2 Search Result Entry and a Search Result Done */ @Test public void testResponseWith2SRE1SRD() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResponseTest.class.getResource( "response_with_2_SRE_1_SRD.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated(); assertEquals( 2, searchResponse.getSearchResultEntryList().size() ); assertNotNull( searchResponse.getSearchResultDone() ); } /** * Test parsing of a Response with 2 Search Result Reference and a Search Result Done */ @Test public void testResponseWith2SRR1SRD() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResponseTest.class.getResource( "response_with_2_SRR_1_SRD.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated(); assertEquals( 2, searchResponse.getSearchResultReferenceList().size() ); assertNotNull( searchResponse.getSearchResultDone() ); } /** * Test parsing of a Response with 2 Search Result Entry, 2 Search Result Reference and a Search Result Done */ @Test public void testResponseWith2SRE2SRR1SRD() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResponseTest.class.getResource( "response_with_2_SRE_2_SRR_1_SRD.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated(); assertEquals( 2, searchResponse.getSearchResultEntryList().size() ); assertEquals( 2, searchResponse.getSearchResultReferenceList().size() ); assertNotNull( searchResponse.getSearchResultDone() ); } /** * Test parsing of a response with no Search Result Done */ @Test public void testResponseWith0SRD() { testParsingFail( SearchResponseTest.class, "response_with_0_SRD.xml" ); } /** * Test parsing of a response with 1 Search Result Entry but no Search Result Done */ @Test public void testResponseWith1SRE0SRD() { testParsingFail( SearchResponseTest.class, "response_with_1_SRE_0_SRD.xml" ); } /** * Test parsing of a response with 1 Search Result Reference but no Search Result Done */ @Test public void testResponseWith1SRR0SRD() { testParsingFail( SearchResponseTest.class, "response_with_1_SRR_0_SRD.xml" ); } } searchResultDone/000077500000000000000000000000001525525160600403625ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponseSearchResultDoneTest.java000066400000000000000000000417021525525160600453030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.searchResponse.searchResultDone; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Collection; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.dsmlv2.response.SearchResponse; import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.message.SearchResultDone; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Search Result Done Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class SearchResultDoneTest extends AbstractResponseTest { /** * Test parsing of a response with a (optional) Control element */ @Test public void testResponseWith1Control() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getSearchResultDone(); Map controls = searchResultDone.getControls(); assertEquals( 1, searchResultDone.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with a (optional) Control element with empty value */ @Test public void testResponseWith1ControlEmptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getSearchResultDone(); Map controls = searchResultDone.getControls(); assertEquals( 1, searchResultDone.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response with 2 (optional) Control elements */ @Test public void testResponseWith2Controls() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getSearchResultDone(); Map controls = searchResultDone.getControls(); assertEquals( 2, searchResultDone.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with 3 (optional) Control elements without value */ @Test public void testResponseWith3ControlsWithoutValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated() ) .getSearchResultDone(); Map controls = searchResultDone.getControls(); assertEquals( 3, searchResultDone.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getSearchResultDone(); assertEquals( 456, searchResultDone.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( SearchResultDoneTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response without Result Code element */ @Test public void testResponseWithoutResultCode() { testParsingFail( SearchResultDoneTest.class, "response_without_result_code.xml" ); } /** * Test parsing of a response with Result Code element but a not integer value */ @Test public void testResponseWithResultCodeNotInteger() { testParsingFail( SearchResultDoneTest.class, "response_with_result_code_not_integer.xml" ); } /** * Test parsing of a response with Result Code */ @Test public void testResponseWithResultCode() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_result_code.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated() ) .getSearchResultDone(); LdapResult ldapResult = searchResultDone.getLdapResult(); assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() ); } /** * Test parsing of a response with Error Message */ @Test public void testResponseWithErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getSearchResultDone(); LdapResult ldapResult = searchResultDone.getLdapResult(); assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult .getDiagnosticMessage() ); } /** * Test parsing of a response with empty Error Message */ @Test public void testResponseWithEmptyErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_empty_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getSearchResultDone(); LdapResult ldapResult = searchResultDone.getLdapResult(); assertNull( ldapResult.getDiagnosticMessage() ); } /** * Test parsing of a response with a Referral */ @Test public void testResponseWith1Referral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated() ) .getSearchResultDone(); LdapResult ldapResult = searchResultDone.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with an empty Referral */ @Test public void testResponseWith1EmptyReferral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_empty_referral.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated() ) .getSearchResultDone(); LdapResult ldapResult = searchResultDone.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 0, referrals.size() ); } /** * Test parsing of a response with 2 Referral elements */ @Test public void testResponseWith2Referrals() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_2_referrals.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getSearchResultDone(); LdapResult ldapResult = searchResultDone.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 2, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apple.com/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with a Referral and an Error Message */ @Test public void testResponseWith1ReferralAndAnErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_referral_and_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getSearchResultDone(); LdapResult ldapResult = searchResultDone.getLdapResult(); Collection referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 1, referrals.size() ); try { assertTrue( referrals.contains( new LdapUrl( "ldap://www.apache.org/" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with MatchedDN attribute */ @Test public void testResponseWithMatchedDNAttribute() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultDoneTest.class.getResource( "response_with_matchedDN_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getSearchResultDone(); LdapResult ldapResult = searchResultDone.getLdapResult(); assertTrue( ldapResult.getMatchedDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); } /** * Test parsing of a response with wrong matched Dn */ @Test public void testResponseWithWrongMatchedDN() { testParsingFail( SearchResultDoneTest.class, "response_with_wrong_matchedDN_attribute.xml" ); } /** * Test parsing of a response with wrong Descr attribute */ @Test public void testResponseWithWrongDescr() { testParsingFail( SearchResultDoneTest.class, "response_with_wrong_descr.xml" ); } } searchResultEntry/000077500000000000000000000000001525525160600405765ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponseSearchResultEntryTest.java000066400000000000000000000453731525525160600457430ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.searchResponse.searchResultEntry; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.nio.charset.StandardCharsets; import java.util.Iterator; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.dsmlv2.response.SearchResponse; import org.apache.directory.api.dsmlv2.response.SearchResponseDsml; import org.apache.directory.api.ldap.model.entry.Attribute; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.SearchResultEntry; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Search Result Entry Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class SearchResultEntryTest extends AbstractResponseTest { /** * Test parsing of a response with a (optional) Control element */ @Test public void testResponseWith1Control() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated(); SearchResultEntry searchResultEntry = searchResponse.getCurrentSearchResultEntry(); Map controls = searchResponse.getCurrentSearchResultEntry().getControls(); assertEquals( 1, searchResultEntry.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with a (optional) Control element with empty value */ @Test public void testResponseWith1ControlEmptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated(); SearchResultEntry searchResultEntry = searchResponse.getCurrentSearchResultEntry(); Map controls = searchResultEntry.getControls(); assertEquals( 1, searchResultEntry.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response with 2 (optional) Control elements */ @Test public void testResponseWith2Controls() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated(); SearchResultEntry searchResultEntry = searchResponse.getCurrentSearchResultEntry(); Map controls = searchResultEntry.getControls(); assertEquals( 2, searchResultEntry.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertFalse( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with 3 (optional) Control elements without value */ @Test public void testResponseWith3ControlsWithoutValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated(); SearchResultEntry searchResultEntry = searchResponse.getCurrentSearchResultEntry(); Map controls = searchResultEntry.getControls(); assertEquals( 3, searchResultEntry.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response without dn Attribute */ @Test public void testResponseWithoutDnAttribute() { testParsingFail( SearchResultEntryTest.class, "response_without_dn_attribute.xml" ); } /** * Test parsing of a response with wrong dn Attribute */ @Test public void testResponseWithWrongDnAttribute() { testParsingFail( SearchResultEntryTest.class, "response_with_wrong_dn_attribute.xml" ); } /** * Test parsing of a response with dn Attribute */ @Test public void testResponseWithDnAttribute() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_dn_attribute.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResponseDsml searchResponseDsml = ( SearchResponseDsml ) parser.getBatchResponse().getCurrentResponse(); SearchResponse response = ( SearchResponse ) searchResponseDsml.getDecorated(); SearchResultEntry searchResultEntry = response.getSearchResultEntryList().get( 0 ); assertEquals( "dc=example,dc=com", searchResultEntry.getObjectName().toString() ); } /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getCurrentSearchResultEntry(); assertEquals( 456, searchResultEntry.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( SearchResultEntryTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response with 0 Attr */ @Test public void testResponseWith0Attr() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_0_attr.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } assertTrue( true ); } /** * Test parsing of a response with 1 Attr 0 Value */ @Test public void testResponseWith1Attr0Value() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_0_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getCurrentSearchResultEntry(); Entry entry = searchResultEntry.getEntry(); assertEquals( 1, entry.size() ); Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "dc", attribute.getUpId() ); } /** * Test parsing of a response with 1 Attr 1 Value */ @Test public void testResponseWith1Attr1Value() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getCurrentSearchResultEntry(); Entry entry = searchResultEntry.getEntry(); assertEquals( 1, entry.size() ); Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "dc", attribute.getUpId() ); Iterator valueIterator = attribute.iterator(); assertTrue( valueIterator.hasNext() ); Value value = valueIterator.next(); assertEquals( "example", value.getString() ); } /** * Test parsing of a response with 1 Attr 1 Base64 Value */ @Test public void testResponseWith1Attr1Base64Value() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_base64_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getCurrentSearchResultEntry(); Entry entry = searchResultEntry.getEntry(); assertEquals( 1, entry.size() ); Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "cn", attribute.getUpId() ); assertEquals( 1, attribute.size() ); Iterator valueIterator = attribute.iterator(); assertTrue( valueIterator.hasNext() ); Value value = valueIterator.next(); String expected = new String( new byte[] { 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', 'L', ( byte ) 0xc3, ( byte ) 0xa9, 'c', 'h', 'a', 'r', 'n', 'y' }, StandardCharsets.UTF_8 ); assertEquals( expected, value.getString() ); } /** * Test parsing of a response with an attribute with a malformed Base64 value : * the parser must fail through the declared XmlPullParserException error channel * (which the Dsmlv2Engine turns into a MALFORMED_RESPONSE error response), not * with an uncaught IllegalArgumentException */ @Test public void testResponseWith_1_attr_1_base64_MalformedBase64Response() { testParsingFail( SearchResultEntryTest.class, "response_with_1_attr_1_base64_malformed_value.xml" ); } /** * Test parsing of a response with 1 Attr 1 empty Value */ @Test public void testResponseWith1Attr1EmptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getCurrentSearchResultEntry(); Entry entry = searchResultEntry.getEntry(); assertEquals( 1, entry.size() ); Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "dc", attribute.getUpId() ); assertEquals( 1, attribute.size() ); Iterator valueIterator = attribute.iterator(); assertTrue( valueIterator.hasNext() ); Value value = valueIterator.next(); assertEquals( "", value.getString() ); } /** * Test parsing of a response with 1 Attr 2 Value */ @Test public void testResponseWith1Attr2Value() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_2_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getCurrentSearchResultEntry(); Entry entry = searchResultEntry.getEntry(); assertEquals( 1, entry.size() ); Iterator attributeIterator = entry.iterator(); Attribute attribute = attributeIterator.next(); assertEquals( "objectclass", attribute.getUpId() ); assertEquals( 2, attribute.size() ); Iterator valueIterator = attribute.iterator(); assertTrue( valueIterator.hasNext() ); Value value = valueIterator.next(); assertEquals( "top", value.getString() ); assertTrue( valueIterator.hasNext() ); value = valueIterator.next(); assertEquals( "domain", value.getString() ); assertFalse( valueIterator.hasNext() ); } /** * Test parsing of a response with 2 Attr 1 Value */ @Test public void testResponseWith2Attr1Value() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultEntryTest.class.getResource( "response_with_2_attr_1_value.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() .getDecorated() ) .getCurrentSearchResultEntry(); Entry entry = searchResultEntry.getEntry(); assertEquals( 2, entry.size() ); Attribute objectClassAttribute = entry.get( "objectclass" ); assertEquals( 1, objectClassAttribute.size() ); Iterator valueIterator = objectClassAttribute.iterator(); assertTrue( valueIterator.hasNext() ); Value value = valueIterator.next(); assertEquals( "top", value.getString() ); assertFalse( valueIterator.hasNext() ); Attribute dcAttribute = entry.get( "dc" ); assertEquals( 1, objectClassAttribute.size() ); valueIterator = dcAttribute.iterator(); assertTrue( valueIterator.hasNext() ); value = valueIterator.next(); assertEquals( "example", value.getString() ); assertFalse( valueIterator.hasNext() ); } /** * Test parsing of a response with 1 Attr without name Attribute */ @Test public void testResponseWith1AttrWithoutNameAttribute() { testParsingFail( SearchResultEntryTest.class, "response_with_1_attr_without_name_attribute.xml" ); } } searchResultReference/000077500000000000000000000000001525525160600413735ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponseSearchResultReferenceTest.java000066400000000000000000000267411525525160600473330ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.searchResponse.searchResultReference; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Collection; import java.util.Map; import org.apache.directory.api.dsmlv2.AbstractResponseTest; import org.apache.directory.api.dsmlv2.DsmlControl; import org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser; import org.apache.directory.api.dsmlv2.response.SearchResponse; import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.SearchResultReference; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.apache.directory.api.util.Strings; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Tests for the Search Result Reference Response parsing * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class SearchResultReferenceTest extends AbstractResponseTest { /** * Test parsing of a response with a (optional) Control element */ @Test public void testResponseWith1Control() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_control.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultReference searchResultReference = ( ( SearchResponse ) parser.getBatchResponse() .getCurrentResponse().getDecorated() ).getCurrentSearchResultReference(); Map controls = searchResultReference.getControls(); assertEquals( 1, searchResultReference.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with a (optional) Control element with empty value */ @Test public void testResponseWith1ControlEmptyValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_control_empty_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultReference searchResultReference = ( ( SearchResponse ) parser.getBatchResponse() .getCurrentResponse().getDecorated() ).getCurrentSearchResultReference(); Map controls = searchResultReference.getControls(); assertEquals( 1, searchResultReference.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.643" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.643", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a response with 2 (optional) Control elements */ @Test public void testResponseWith2Controls() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultReference searchResultReference = ( ( SearchResponse ) parser.getBatchResponse() .getCurrentResponse().getDecorated() ).getCurrentSearchResultReference(); Map controls = searchResultReference.getControls(); assertEquals( 2, searchResultReference.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.789" ); assertNotNull( control ); assertEquals( "1.2.840.113556.1.4.789", control.getOid() ); assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl ) control ).getValue() ) ); } /** * Test parsing of a response with 3 (optional) Control elements without value */ @Test public void testResponseWith3ControlsWithoutValue() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_3_controls_without_value.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultReference searchResultReference = ( ( SearchResponse ) parser.getBatchResponse() .getCurrentResponse().getDecorated() ).getCurrentSearchResultReference(); Map controls = searchResultReference.getControls(); assertEquals( 3, searchResultReference.getControls().size() ); Control control = controls.get( "1.2.840.113556.1.4.456" ); assertNotNull( control ); assertTrue( control.isCritical() ); assertEquals( "1.2.840.113556.1.4.456", control.getOid() ); assertFalse( ( ( DsmlControl ) control ).hasValue() ); } /** * Test parsing of a Response with the (optional) requestID attribute */ @Test public void testResponseWithRequestId() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_requestID_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultReference searchResultReference = ( ( SearchResponse ) parser.getBatchResponse() .getCurrentResponse().getDecorated() ).getCurrentSearchResultReference(); assertEquals( 456, searchResultReference.getMessageId() ); } /** * Test parsing of a Response with the (optional) requestID attribute below 0 */ @Test public void testResponseWithRequestIdBelow0() { testParsingFail( SearchResultReferenceTest.class, "response_with_requestID_below_0.xml" ); } /** * Test parsing of a response with 0 Ref */ @Test public void testResponseWith0Ref() { testParsingFail( SearchResultReferenceTest.class, "response_with_0_ref.xml" ); } /** * Test parsing of a Response with 1 Ref */ @Test public void testResponseWith1Ref() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_ref.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultReference searchResultReference = ( ( SearchResponse ) parser.getBatchResponse() .getCurrentResponse().getDecorated() ).getCurrentSearchResultReference(); Collection references = searchResultReference.getReferral().getLdapUrls(); assertEquals( 1, references.size() ); try { assertTrue( references.contains( new LdapUrl( "ldap://localhost" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a Response with 1 Ref */ @Test public void testResponseWith1EmptyRef() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_empty_ref.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultReference searchResultReference = ( ( SearchResponse ) parser.getBatchResponse() .getCurrentResponse().getDecorated() ).getCurrentSearchResultReference(); Collection references = searchResultReference.getReferral().getLdapUrls(); assertEquals( 0, references.size() ); } /** * Test parsing of a Response with 2 Ref */ @Test public void testResponseWith2Ref() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_2_ref.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchResultReference searchResultReference = ( ( SearchResponse ) parser.getBatchResponse() .getCurrentResponse().getDecorated() ).getCurrentSearchResultReference(); Collection references = searchResultReference.getReferral().getLdapUrls(); assertEquals( 2, references.size() ); try { assertTrue( references.contains( new LdapUrl( "ldap://localhost" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } try { assertTrue( references.contains( new LdapUrl( "ldap://www.apache.org" ).toString() ) ); } catch ( LdapURLEncodingException e ) { fail(); } } /** * Test parsing of a response with 1 wrong Ref */ @Test public void testResponseWith1WrongRef() { testParsingFail( SearchResultReferenceTest.class, "response_with_1_wrong_ref.xml" ); } } apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/soap/000077500000000000000000000000001525525160600331455ustar00rootroot00000000000000SoapDsmlParsingTest.java000066400000000000000000000102051525525160600376350ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/soap/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.dsmlv2.soap; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import org.apache.directory.api.dsmlv2.Dsmlv2Parser; import org.apache.directory.api.dsmlv2.request.BatchRequestDsml; import org.apache.directory.api.ldap.model.message.SearchRequest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; /** * Class which tests the parsing of DSML documents embedded in a SOAP envelope. * * @author Apache Directory Project */ @Execution( ExecutionMode.CONCURRENT) public class SoapDsmlParsingTest { @Test public void testParsingRequestsOneByOne() throws Exception { Dsmlv2Parser parser = new Dsmlv2Parser( false ); parser.setInput( SoapDsmlParsingTest.class.getResource( "soap-dsml-multiple-operation-requests.xml" ) .openStream(), "UTF-8" ); parser.parseBatchRequest(); BatchRequestDsml batchReq = parser.getBatchRequest(); assertNotNull( batchReq ); assertFalse( batchReq.isStoringRequests() ); assertTrue( batchReq.getRequests().isEmpty() ); SearchRequest searchRequest = ( SearchRequest ) parser.getNextRequest(); assertTrue( searchRequest.getTypesOnly() ); // assert again that the batch request object is not storing requests assertTrue( batchReq.getRequests().isEmpty() ); searchRequest = ( SearchRequest ) parser.getNextRequest(); assertFalse( searchRequest.getTypesOnly() ); assertNull( parser.getNextRequest() ); // assert again that the batch request object is not storing requests assertTrue( batchReq.getRequests().isEmpty() ); assertNotNull( batchReq.getCurrentRequest() ); } /** * Test parsing of a request without a SOAP header */ @Test public void testBatchRequestWithoutSoapHeader() { Dsmlv2Parser parser = null; try { parser = new Dsmlv2Parser(); parser.setInput( SoapDsmlParsingTest.class.getResource( "soap-dsml-req-without-header.xml" ).openStream(), "UTF-8" ); SearchRequest searchRequest = ( SearchRequest ) parser.getNextRequest(); assertTrue( searchRequest.getTypesOnly() ); } catch ( Exception e ) { fail( e.getMessage() ); } } /** * Test parsing of a request *with* a SOAP header */ @Test public void testBatchRequestWithSoapHeader() { Dsmlv2Parser parser = null; try { parser = new Dsmlv2Parser(); parser.setInput( SoapDsmlParsingTest.class.getResource( "soap-dsml-req-with-header.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest(); assertTrue( searchRequest.getTypesOnly() ); } } apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/000077500000000000000000000000001525525160600253005ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/log4j.properties000066400000000000000000000022561525525160600304420ustar00rootroot00000000000000############################################################################# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ############################################################################# log4j.rootCategory=OFF, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/000077500000000000000000000000001525525160600260675ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/000077500000000000000000000000001525525160600273105ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/000077500000000000000000000000001525525160600313145ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/000077500000000000000000000000001525525160600320655ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/000077500000000000000000000000001525525160600332745ustar00rootroot00000000000000abandonRequest/000077500000000000000000000000001525525160600361705ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2request_with_0_abandonID_attribute.xml000066400000000000000000000017151525525160600456420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest request_with_1_control.xml000066400000000000000000000021331525525160600434140ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest Some text request_with_1_control_base64_value.xml000066400000000000000000000023451525525160600457610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest RFNNTHYyLjAgcm9ja3MhIQ== request_with_1_control_empty_value.xml000066400000000000000000000020621525525160600460270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest request_with_1_control_malformed_base64_value.xml000066400000000000000000000023351525525160600500060ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest !!!Not Base64!!! request_with_2_controls.xml000066400000000000000000000023751525525160600436100ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest Some text Some other text request_with_3_controls_without_value.xml000066400000000000000000000022601525525160600465610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest request_with_abandonID_attribute.xml000066400000000000000000000017001525525160600454150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest request_with_needed_requestID.xml000066400000000000000000000017601525525160600447320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest request_with_requestID_attribute.xml000066400000000000000000000017201525525160600455050ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest request_with_requestID_below_0.xml000066400000000000000000000017171525525160600450370ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest request_without_abandonID_attribute.xml000066400000000000000000000016601525525160600461520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest addRequest/000077500000000000000000000000001525525160600353165ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2request_with_1_attr_empty_value.xml000066400000000000000000000020061525525160600444450ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest request_with_1_attr_with_2_values.xml000066400000000000000000000020361525525160600446710ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest topperson request_with_1_attr_with_base64_value.xml000066400000000000000000000023051525525160600454300ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest RFNNTHYyLjAgcm9ja3MhIQ== request_with_1_attr_with_malformed_base64_value.xml000066400000000000000000000022751525525160600474640ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest !!!Not Base64!!! request_with_1_attr_with_value.xml000066400000000000000000000020111525525160600442560ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest top request_with_1_attr_without_name_attribute.xml000066400000000000000000000017661525525160600467150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest top request_with_1_attr_without_value.xml000066400000000000000000000017671525525160600450270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest request_with_1_control.xml000066400000000000000000000021551525525160600425460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest Some text request_with_1_control_base64_value.xml000066400000000000000000000023671525525160600451130ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest RFNNTHYyLjAgcm9ja3MhIQ== request_with_1_control_empty_value.xml000066400000000000000000000021041525525160600451520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest request_with_1_control_malformed_base64_value.xml000066400000000000000000000023571525525160600471400ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest !!!Not Base64!!! request_with_2_attr_with_value.xml000066400000000000000000000021031525525160600442610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest top person request_with_2_controls.xml000066400000000000000000000024171525525160600427330ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest Some text Some other text request_with_3_controls_without_value.xml000066400000000000000000000022751525525160600457150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest request_with_dn_attribute.xml000066400000000000000000000017221525525160600433310ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest request_with_needed_requestID.xml000066400000000000000000000020021525525160600440460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest request_with_requestID_attribute.xml000066400000000000000000000017421525525160600446370ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest request_with_requestID_below_0.xml000066400000000000000000000017411525525160600441620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest request_without_dn_attribute.xml000066400000000000000000000016501525525160600440610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest addResponse/000077500000000000000000000000001525525160600354645ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2response_with_1_control.xml000066400000000000000000000022311525525160600430550ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse Some text response_with_1_control_empty_value.xml000066400000000000000000000021601525525160600454700ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_with_1_empty_referral.xml000066400000000000000000000020401525525160600444130ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_with_1_referral.xml000066400000000000000000000020651525525160600432040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse ldap://www.apache.org response_with_1_referral_and_error_message.xml000066400000000000000000000022431525525160600467410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org response_with_2_controls.xml000066400000000000000000000024541525525160600432500ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse Some text Some other text response_with_2_referrals.xml000066400000000000000000000021451525525160600433670ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse ldap://www.apache.org ldap://www.apple.com response_with_3_controls_without_value.xml000066400000000000000000000023511525525160600462240ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_with_empty_error_message.xml000066400000000000000000000020461525525160600452340ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_with_error_message.xml000066400000000000000000000021621525525160600440150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 response_with_matchedDN_attribute.xml000066400000000000000000000020621525525160600450710ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_with_requestID_attribute.xml000066400000000000000000000020011525525160600451400ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_with_requestID_below_0.xml000066400000000000000000000020001525525160600444630ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_with_result_code.xml000066400000000000000000000020041525525160600434630ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_with_result_code_not_integer.xml000066400000000000000000000020101525525160600460550ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_with_wrong_descr.xml000066400000000000000000000017751525525160600435050ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_with_wrong_matchedDN_attribute.xml000066400000000000000000000020441525525160600463050ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse response_without_result_code.xml000066400000000000000000000017231525525160600442220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse authRequest/000077500000000000000000000000001525525160600355275ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2request_with_1_control.xml000066400000000000000000000021661525525160600427610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest Some text request_with_1_control_base64_value.xml000066400000000000000000000024001525525160600453100ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest RFNNTHYyLjAgcm9ja3MhIQ== request_with_1_control_empty_value.xml000066400000000000000000000021151525525160600453650ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest request_with_1_control_malformed_base64_value.xml000066400000000000000000000023701525525160600473440ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest !!!Not Base64!!! request_with_2_controls.xml000066400000000000000000000024301525525160600431370ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest Some text Some other text request_with_3_controls_without_value.xml000066400000000000000000000023061525525160600461210ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest request_with_needed_requestID.xml000066400000000000000000000020131525525160600442610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest request_with_principal_attribute.xml000066400000000000000000000017331525525160600451240ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest request_with_requestID_attribute.xml000066400000000000000000000017531525525160600450520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest request_with_requestID_below_0.xml000066400000000000000000000017521525525160600443750ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest request_without_principal_attribute.xml000066400000000000000000000016521525525160600456540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest authResponse/000077500000000000000000000000001525525160600356755ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2response_with_1_control.xml000066400000000000000000000022331525525160600432700ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse Some text response_with_1_control_empty_value.xml000066400000000000000000000021621525525160600457030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_with_1_empty_referral.xml000066400000000000000000000020421525525160600446260ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_with_1_referral.xml000066400000000000000000000020671525525160600434170ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse ldap://www.apache.org response_with_1_referral_and_error_message.xml000066400000000000000000000022451525525160600471540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org response_with_2_controls.xml000066400000000000000000000024561525525160600434630ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse Some text Some other text response_with_2_referrals.xml000066400000000000000000000021471525525160600436020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse ldap://www.apache.org ldap://www.apple.com response_with_3_controls_without_value.xml000066400000000000000000000023531525525160600464370ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_with_empty_error_message.xml000066400000000000000000000020521525525160600454420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_with_error_message.xml000066400000000000000000000021661525525160600442320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 response_with_matchedDN_attribute.xml000066400000000000000000000020641525525160600453040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_with_requestID_attribute.xml000066400000000000000000000020031525525160600453530ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_with_requestID_below_0.xml000066400000000000000000000020021525525160600446760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_with_result_code.xml000066400000000000000000000020061525525160600436760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_with_result_code_not_integer.xml000066400000000000000000000020121525525160600462700ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_with_wrong_descr.xml000066400000000000000000000017771525525160600437200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_with_wrong_matchedDN_attribute.xml000066400000000000000000000020461525525160600465200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse response_without_result_code.xml000066400000000000000000000017251525525160600444350ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse batchRequest/000077500000000000000000000000001525525160600356475ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2request_with_0_request.xml000066400000000000000000000016111525525160600431020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest request_with_1_AbandonRequest.xml000066400000000000000000000017271525525160600443360ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest request_with_1_AddRequest.xml000066400000000000000000000022231525525160600434540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest top person snvalue request_with_1_AuthRequest.xml000066400000000000000000000017621525525160600436740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest request_with_1_AuthRequest_1_AddRequest.xml000066400000000000000000000023451525525160600462330ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest top person snvalue request_with_1_CompareRequest.xml000066400000000000000000000021301525525160600443470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest CN=Michael Scofield, DC=prisonbreak, Dc=com request_with_1_DelRequest.xml000066400000000000000000000017601525525160600434750ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest request_with_1_ExtendedRequest.xml000066400000000000000000000020251525525160600445240ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest 1.2.6.1.4.1.18060.1.1.1.100.2 request_with_1_ModDNRequest.xml000066400000000000000000000020341525525160600437250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest request_with_1_ModifyRequest.xml000066400000000000000000000022621525525160600442160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest CN=John Smith, DC=microsoft, DC=com CN=Michael Scofield, DC=prisonbreak, DC=com request_with_1_SearchRequest.xml000066400000000000000000000022611525525160600441730ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest o request_with_2_AbandonRequest.xml000066400000000000000000000020161525525160600443270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest request_with_2_AddRequest.xml000066400000000000000000000026061525525160600434620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest top person snvalue top person snvalue request_with_2_CompareRequest.xml000066400000000000000000000024201525525160600443520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest CN=Michael Scofield, DC=prisonbreak, Dc=com CN=Michael Scofield, DC=prisonbreak, Dc=com request_with_2_DelRequest.xml000066400000000000000000000021001525525160600434630ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest request_with_2_ExtendedRequest.xml000066400000000000000000000022121525525160600445230ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest 1.2.6.1.4.1.18060.1.1.1.100.2 1.2.6.1.4.1.18060.1.1.1.100.2 request_with_2_ModDNRequest.xml000066400000000000000000000022301525525160600437240ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest request_with_2_ModifyRequest.xml000066400000000000000000000027041525525160600442200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest CN=John Smith, DC=microsoft, DC=com CN=Michael Scofield, DC=prisonbreak, DC=com CN=John Smith, DC=microsoft, DC=com CN=Michael Scofield, DC=prisonbreak, DC=com request_with_2_SearchRequest.xml000066400000000000000000000027021525525160600441740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest o o request_with_requestID_attribute.xml000066400000000000000000000016401525525160600451650ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest request_with_requestID_below_0.xml000066400000000000000000000016301525525160600445100ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest request_with_wrong_placed_AuthRequest.xml000066400000000000000000000023451525525160600461760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest top person snvalue batchResponse/000077500000000000000000000000001525525160600360155ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2response_with_0_response.xml000066400000000000000000000016131525525160600435660ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_1_AddResponse.xml000066400000000000000000000017461525525160600441470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_1_AuthResponse.xml000066400000000000000000000017501525525160600443530ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_1_CompareResponse.xml000066400000000000000000000017561525525160600450460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_1_DelResponse.xml000066400000000000000000000017461525525160600441630ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_1_ErrorResponse.xml000066400000000000000000000020001525525160600445300ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse Connection refused response_with_1_ExtendedResponse.xml000066400000000000000000000023011525525160600452030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 1.2.3.4.5.6.7.8.9.0 A response response_with_1_ModDNResponse.xml000066400000000000000000000017521525525160600444150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_1_ModifyResponse.xml000066400000000000000000000017541525525160600447050ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_1_SearchResponse.xml000066400000000000000000000020351525525160600446540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_2_AddResponse.xml000066400000000000000000000021011525525160600441320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_2_AuthResponse.xml000066400000000000000000000021051525525160600443470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_2_CompareResponse.xml000066400000000000000000000021211525525160600450320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_2_DelResponse.xml000066400000000000000000000021011525525160600441460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_2_ErrorResponse.xml000066400000000000000000000021651525525160600445450ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse Connection refused Connection refused response_with_2_ExtendedResponse.xml000066400000000000000000000027671525525160600452240ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 1.2.3.4.5.6.7.8.9.0 A response Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 1.2.3.4.5.6.7.8.9.0 A response response_with_2_ModDNResponse.xml000066400000000000000000000021111525525160600444040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_2_ModifyResponse.xml000066400000000000000000000021151525525160600446760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_2_SearchResponse.xml000066400000000000000000000022571525525160600446630ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_empty_ID_ErrorResponse.xml000066400000000000000000000034051525525160600461140ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse urn:ihe:iti:2010:ProviderInformationFeedResponse urn:uuid:e7b4def8-0ad7-46d9-b9db-3389b6c3c7f7 http://www.w3.org/2005/08/addressing/anonymous urn:uuid:e529d797-d54f-41c0-8cea-d5e2c194afbf ERR_04110_CANNOT_CONNECT_TO_SERVER Cannot connect to the server: Connection refused response_with_requestID_attribute.xml000066400000000000000000000016421525525160600455030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse response_with_requestID_below_0.xml000066400000000000000000000016321525525160600450260ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse compareRequest/000077500000000000000000000000001525525160600362145ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2request_with_1_assertion_empty_value.xml000066400000000000000000000020171525525160600464020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest request_with_1_assertion_with_2_values.xml000066400000000000000000000021221525525160600466200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson Johnson request_with_1_assertion_without_name_attribute.xml000066400000000000000000000020141525525160600506330ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson request_with_1_assertion_without_value.xml000066400000000000000000000017651525525160600467600ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest request_with_1_complete_assertion.xml000066400000000000000000000020261525525160600456600ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson request_with_1_complete_assertion_base64_value.xml000066400000000000000000000023161525525160600502220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest RFNNTHYyLjAgcm9ja3MhIQ== request_with_1_complete_assertion_malformed_base64_value.xml000066400000000000000000000023061525525160600522470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest !!!Not BAse64!!! request_with_1_control.xml000066400000000000000000000022611525525160600434420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Some text Johnson request_with_1_control_base64_value.xml000066400000000000000000000024731525525160600460070ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest RFNNTHYyLjAgcm9ja3MhIQ== Johnson request_with_1_control_empty_value.xml000066400000000000000000000022101525525160600460460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson request_with_2_complete_assertions.xml000066400000000000000000000021221525525160600460410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson Thomson request_with_2_controls.xml000066400000000000000000000025231525525160600436270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Some text Some other text Johnson request_with_3_controls_without_value.xml000066400000000000000000000024061525525160600466070ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson request_with_dn_attribute.xml000066400000000000000000000020261525525160600442250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson request_with_needed_requestID.xml000066400000000000000000000021061525525160600447510ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson request_with_requestID_attribute.xml000066400000000000000000000020461525525160600455330ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson request_with_requestID_below_0.xml000066400000000000000000000020451525525160600450560ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson request_without_assertion.xml000066400000000000000000000017321525525160600443030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest request_without_dn_attribute.xml000066400000000000000000000017541525525160600447640ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest Johnson compareResponse/000077500000000000000000000000001525525160600363625ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2response_with_1_control.xml000066400000000000000000000022411525525160600437540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse Some text response_with_1_control_empty_value.xml000066400000000000000000000021701525525160600463670ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_with_1_empty_referral.xml000066400000000000000000000020501525525160600453120ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_with_1_referral.xml000066400000000000000000000020751525525160600441030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse ldap://www.apache.org response_with_1_referral_and_error_message.xml000066400000000000000000000022531525525160600476400ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org response_with_2_controls.xml000066400000000000000000000024641525525160600441470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse Some text Some other text response_with_2_referrals.xml000066400000000000000000000021551525525160600442660ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse ldap://www.apache.org ldap://www.apple.com response_with_3_controls_without_value.xml000066400000000000000000000023611525525160600471230ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_with_empty_error_message.xml000066400000000000000000000020601525525160600461260ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_with_error_message.xml000066400000000000000000000021741525525160600447160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 response_with_matchedDN_attribute.xml000066400000000000000000000020721525525160600457700ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_with_requestID_attribute.xml000066400000000000000000000020111525525160600460370ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_with_requestID_below_0.xml000066400000000000000000000020101525525160600453620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_with_result_code.xml000066400000000000000000000020141525525160600443620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_with_result_code_not_integer.xml000066400000000000000000000020201525525160600467540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_with_wrong_descr.xml000066400000000000000000000020051525525160600443660ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_with_wrong_matchedDN_attribute.xml000066400000000000000000000020541525525160600472040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse response_without_result_code.xml000066400000000000000000000017331525525160600451210ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse delRequest/000077500000000000000000000000001525525160600353325ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2request_with_1_control.xml000066400000000000000000000021551525525160600425620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest Some text request_with_1_control_base64_value.xml000066400000000000000000000023671525525160600451270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest RFNNTHYyLjAgcm9ja3MhIQ== request_with_1_control_empty_value.xml000066400000000000000000000021041525525160600451660ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest request_with_1_control_malformed_base64_value.xml000066400000000000000000000023661525525160600471540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest !!!not-base64!!! request_with_2_controls.xml000066400000000000000000000024171525525160600427470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest Some text Some other text request_with_3_controls_without_value.xml000066400000000000000000000022751525525160600457310ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest request_with_dn_attribute.xml000066400000000000000000000017221525525160600433450ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest request_with_needed_requestID.xml000066400000000000000000000020021525525160600440620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest request_with_requestID_attribute.xml000066400000000000000000000017421525525160600446530ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest request_with_requestID_below_0.xml000066400000000000000000000017411525525160600441760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest request_without_dn_attribute.xml000066400000000000000000000016501525525160600440750ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest delResponse/000077500000000000000000000000001525525160600355005ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2response_with_1_control.xml000066400000000000000000000022311525525160600430710ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse Some text response_with_1_control_empty_value.xml000066400000000000000000000021601525525160600455040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_with_1_empty_referral.xml000066400000000000000000000020401525525160600444270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_with_1_referral.xml000066400000000000000000000020651525525160600432200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse ldap://www.apache.org response_with_1_referral_and_error_message.xml000066400000000000000000000022431525525160600467550ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org response_with_2_controls.xml000066400000000000000000000024541525525160600432640ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse Some text Some other text response_with_2_referrals.xml000066400000000000000000000021451525525160600434030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse ldap://www.apache.org ldap://www.apple.com response_with_3_controls_without_value.xml000066400000000000000000000023511525525160600462400ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_with_empty_error_message.xml000066400000000000000000000020501525525160600452430ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_with_error_message.xml000066400000000000000000000021641525525160600440330ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 response_with_matchedDN_attribute.xml000066400000000000000000000020621525525160600451050ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_with_requestID_attribute.xml000066400000000000000000000020011525525160600451540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_with_requestID_below_0.xml000066400000000000000000000020001525525160600444770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_with_result_code.xml000066400000000000000000000020041525525160600434770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_with_result_code_not_integer.xml000066400000000000000000000020101525525160600460710ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_with_wrong_descr.xml000066400000000000000000000017751525525160600435210ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_with_wrong_matchedDN_attribute.xml000066400000000000000000000020441525525160600463210ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse response_without_result_code.xml000066400000000000000000000017231525525160600442360ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse errorResponse/000077500000000000000000000000001525525160600360655ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2response_with_empty_message.xml000066400000000000000000000020111525525160600444140ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_message.xml000066400000000000000000000020331525525160600432020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse Connection refused response_with_requestID_attribute.xml000066400000000000000000000017611525525160600455550ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_requestID_below_0.xml000066400000000000000000000017501525525160600450770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_type_authenticationFailed.xml000066400000000000000000000017661525525160600467570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_type_connectionClosed.xml000066400000000000000000000017621525525160600461200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_type_couldNotConnect.xml000066400000000000000000000017611525525160600457270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_type_gatewayInternalError.xml000066400000000000000000000017661525525160600470030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_type_inError.xml000066400000000000000000000017471525525160600442520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_type_malformedRequest.xml000066400000000000000000000017621525525160600461460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_type_notAttempted.xml000066400000000000000000000017561525525160600453020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_type_other.xml000066400000000000000000000017471525525160600437530ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_with_type_unresolvableURI.xml000066400000000000000000000017611525525160600457070ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse response_without_type.xml000066400000000000000000000017321525525160600432740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse extendedRequest/000077500000000000000000000000001525525160600363665ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2request_with_1_attr_malformed_base64_value.xml000066400000000000000000000023071525525160600474750ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest !!!not-base64!!! request_with_1_control.xml000066400000000000000000000021731525525160600436160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest Some text 1.3.563.52.425 request_with_1_control_base64_value.xml000066400000000000000000000024051525525160600461540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest RFNNTHYyLjAgcm9ja3MhIQ== 1.3.563.52.425 request_with_1_control_empty_value.xml000066400000000000000000000021221525525160600462220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest 1.3.563.52.425 request_with_2_controls.xml000066400000000000000000000024351525525160600440030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest Some text Some other text 1.3.563.52.425 request_with_2_requestName.xml000066400000000000000000000020161525525160600444240ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest 1.3.563.52.425 1.3.563.52.425 request_with_2_requestValue.xml000066400000000000000000000024131525525160600446210ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest 1.3.563.52.425 RFNNTHYyLjAgcm9ja3MhIQ== RFNNTHYyLjAgcm9ja3MhIQ== request_with_3_controls_without_value.xml000066400000000000000000000023131525525160600467560ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest 1.3.563.52.425 request_with_base64_requestValue.xml000066400000000000000000000022651525525160600455510ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest 1.3.563.52.425 RFNNTHYyLjAgcm9ja3MhIQ== request_with_empty_requestName.xml000066400000000000000000000022511525525160600454220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest RFNNTHYyLjAgcm9ja3MhIQ== request_with_empty_requestValue.xml000066400000000000000000000020021525525160600456100ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest 1.3.563.52.425 request_with_needed_requestID.xml000066400000000000000000000020201525525160600451160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest 1.3.563.52.425 request_with_requestID_attribute.xml000066400000000000000000000017601525525160600457070ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest 1.3.563.52.425 request_with_requestID_below_0.xml000066400000000000000000000017571525525160600452410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest 1.3.563.52.425 request_with_requestValue.xml000066400000000000000000000020101525525160600443710ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest 1.3.563.52.425 foobar request_without_requestName.xml000066400000000000000000000016621525525160600447410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest extendedResponse/000077500000000000000000000000001525525160600365345ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2response_with_1_control.xml000066400000000000000000000022431525525160600441300ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse Some text response_with_1_control_empty_value.xml000066400000000000000000000021721525525160600465430ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_1_empty_referral.xml000066400000000000000000000020521525525160600454660ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_1_referral.xml000066400000000000000000000020771525525160600442570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse ldap://www.apache.org response_with_1_referral_and_error_message.xml000066400000000000000000000022551525525160600500140ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org response_with_2_controls.xml000066400000000000000000000024661525525160600443230ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse Some text Some other text response_with_2_referrals.xml000066400000000000000000000021571525525160600444420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse ldap://www.apache.org ldap://www.apple.com response_with_3_controls_without_value.xml000066400000000000000000000023631525525160600472770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_base64_response.xml000066400000000000000000000022771525525160600452410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse RFNNTHYyLjAgcm9ja3MhIQ== response_with_empty_error_message.xml000066400000000000000000000020621525525160600463020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_empty_response.xml000066400000000000000000000020421525525160600453010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_empty_responseName.xml000066400000000000000000000020521525525160600461030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_error_message.xml000066400000000000000000000021761525525160600450720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 response_with_malformed_base64_response.xml000066400000000000000000000022671525525160600472660ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse !!!Not base64!!! response_with_matchedDN_attribute.xml000066400000000000000000000020741525525160600461440ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_requestID_attribute.xml000066400000000000000000000020131525525160600462130ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_requestID_below_0.xml000066400000000000000000000020121525525160600455360ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_response.xml000066400000000000000000000020641525525160600440670ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse This is a response response_with_responseName.xml000066400000000000000000000020751525525160600446720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse 1.2.3.4.5.6.7.8.9.0 response_with_responseName_and_response.xml000066400000000000000000000021511525525160600474250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse 1.2.3.4.5.6.7.8.9.0 This is a response response_with_result_code.xml000066400000000000000000000020161525525160600445360ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_result_code_not_integer.xml000066400000000000000000000020221525525160600471300ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_wrong_descr.xml000066400000000000000000000020071525525160600445420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_wrong_matchedDN_attribute.xml000066400000000000000000000020561525525160600473600ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse response_with_wrong_responseName.xml000066400000000000000000000020741525525160600461050ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse Wrong ResponseName response_without_result_code.xml000066400000000000000000000017351525525160600452750ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse modDNRequest/000077500000000000000000000000001525525160600355675ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2request_with_1_control.xml000066400000000000000000000022271525525160600430170ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest Some text request_with_1_control_base64_value.xml000066400000000000000000000024411525525160600453550ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest RFNNTHYyLjAgcm9ja3MhIQ== request_with_1_control_empty_value.xml000066400000000000000000000021561525525160600454320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_1_control_malformed_base64_value.xml000066400000000000000000000024311525525160600474020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest !!!Not base64!!! request_with_2_controls.xml000066400000000000000000000024711525525160600432040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest Some text Some other text request_with_3_controls_without_value.xml000066400000000000000000000023471525525160600461660ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_deleteoldrdn_0.xml000066400000000000000000000020151525525160600437760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_deleteoldrdn_1.xml000066400000000000000000000020151525525160600437770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_deleteoldrdn_error.xml000066400000000000000000000020211525525160600447650ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_deleteoldrdn_false.xml000066400000000000000000000020211525525160600447260ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_deleteoldrdn_true.xml000066400000000000000000000020201525525160600446120ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_dn_and_newrdn_attributes.xml000066400000000000000000000017651525525160600461730ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_needed_requestID.xml000066400000000000000000000020541525525160600443260ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_newSuperior_attribute.xml000066400000000000000000000020571525525160600455250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_requestID_attribute.xml000066400000000000000000000020201525525160600450760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_with_requestID_below_0.xml000066400000000000000000000020171525525160600444300ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_without_dn_attribute.xml000066400000000000000000000017021525525160600443300ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest request_without_newrdn_attribute.xml000066400000000000000000000017261525525160600452320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest modDNResponse/000077500000000000000000000000001525525160600357355ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2response_with_1_control.xml000066400000000000000000000022351525525160600433320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse Some text response_with_1_control_empty_value.xml000066400000000000000000000021641525525160600457450ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_with_1_empty_referral.xml000066400000000000000000000020441525525160600446700ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_with_1_referral.xml000066400000000000000000000020711525525160600434520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse ldap://www.apache.org response_with_1_referral_and_error_message.xml000066400000000000000000000022471525525160600472160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org response_with_2_controls.xml000066400000000000000000000024601525525160600435160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse Some text Some other text response_with_2_referrals.xml000066400000000000000000000021511525525160600436350ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse ldap://www.apache.org ldap://www.apple.com response_with_3_controls_without_value.xml000066400000000000000000000023551525525160600465010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_with_empty_error_message.xml000066400000000000000000000020541525525160600455040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_with_error_message.xml000066400000000000000000000021701525525160600442650ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 response_with_matchedDN_attribute.xml000066400000000000000000000020661525525160600453460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_with_requestID_attribute.xml000066400000000000000000000020051525525160600454150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_with_requestID_below_0.xml000066400000000000000000000020041525525160600447400ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_with_result_code.xml000066400000000000000000000020101525525160600437310ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_with_result_code_not_integer.xml000066400000000000000000000020141525525160600463320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_with_wrong_descr.xml000066400000000000000000000020011525525160600437350ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_with_wrong_matchedDN_attribute.xml000066400000000000000000000020501525525160600465530ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse response_without_result_code.xml000066400000000000000000000017271525525160600444770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse modifyRequest/000077500000000000000000000000001525525160600360555ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2request_with_1_control.xml000066400000000000000000000021611525525160600433020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest Some text request_with_1_control_base64_value.xml000066400000000000000000000023731525525160600456470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest RFNNTHYyLjAgcm9ja3MhIQ== request_with_1_control_empty_value.xml000066400000000000000000000021101525525160600457060ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest request_with_1_control_malformed_base64_value.xml000066400000000000000000000023631525525160600476740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest !!!Not Base64!!! request_with_1_modification.xml000066400000000000000000000021341525525160600442670ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest CN=John Smith, DC=microsoft, DC=com request_with_1_modification_base64_value.xml000066400000000000000000000024341525525160600466320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest Y249RW1tYW51ZWwgTMOpY2hhcm55LCBvdT1wZW9wbGUsIGRjPWV4YW1wbGUsIGRjPWNvbQ== request_with_1_modification_increment.xml000066400000000000000000000021371525525160600463360ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest CN=John Smith, DC=microsoft, DC=com request_with_1_modification_malformed_base64_value.xml000066400000000000000000000023441525525160600506600ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest !!!Not base64!!! request_with_2_controls.xml000066400000000000000000000024251525525160600434710ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest Some text Some other text request_with_2_modifications.xml000066400000000000000000000023261525525160600444560ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest CN=John Smith, DC=microsoft, DC=com CN=Steve Jobs, DC=apple, DC=com request_with_3_controls_without_value.xml000066400000000000000000000023031525525160600464440ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest request_with_modification_with_2_values.xml000066400000000000000000000022211525525160600466770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest CN=John Smith, DC=microsoft, DC=com CN=Steve Jobs, DC=apple, DC=com request_with_modification_with_empty_value.xml000066400000000000000000000020711525525160600475140ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest request_with_modification_without_value.xml000066400000000000000000000020431525525160600470250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest request_with_needed_requestID.xml000066400000000000000000000020061525525160600446110ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest request_with_operation_add.xml000066400000000000000000000021341525525160600442120ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest CN=John Smith, DC=microsoft, DC=com request_with_operation_delete.xml000066400000000000000000000021371525525160600447270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest CN=John Smith, DC=microsoft, DC=com request_with_operation_error.xml000066400000000000000000000021361525525160600446150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest CN=John Smith, DC=microsoft, DC=com request_with_operation_replace.xml000066400000000000000000000021401525525160600450720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest CN=John Smith, DC=microsoft, DC=com request_with_requestID_attribute.xml000066400000000000000000000017501525525160600453750ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest request_with_requestID_below_0.xml000066400000000000000000000017471525525160600447270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest request_without_dn_attribute.xml000066400000000000000000000016561525525160600446260ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest request_without_name_attribute.xml000066400000000000000000000021101525525160600451270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest CN=John Smith, DC=microsoft, DC=com request_without_operation_attribute.xml000066400000000000000000000021141525525160600462130ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest CN=John Smith, DC=microsoft, DC=com modifyResponse/000077500000000000000000000000001525525160600362235ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2response_with_1_control.xml000066400000000000000000000022371525525160600436220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse Some text response_with_1_control_empty_value.xml000066400000000000000000000021661525525160600462350ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_with_1_empty_referral.xml000066400000000000000000000020461525525160600451600ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_with_1_referral.xml000066400000000000000000000020731525525160600437420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse ldap://www.apache.org response_with_1_referral_and_error_message.xml000066400000000000000000000022511525525160600474770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org response_with_2_controls.xml000066400000000000000000000024621525525160600440060ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse Some text Some other text response_with_2_referrals.xml000066400000000000000000000021531525525160600441250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse ldap://www.apache.org ldap://www.apple.com response_with_3_controls_without_value.xml000066400000000000000000000023571525525160600467710ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_with_empty_error_message.xml000066400000000000000000000020561525525160600457740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_with_error_message.xml000066400000000000000000000021721525525160600445550ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 response_with_matchedDN_attribute.xml000066400000000000000000000020701525525160600456270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_with_requestID_attribute.xml000066400000000000000000000020071525525160600457050ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_with_requestID_below_0.xml000066400000000000000000000020061525525160600452300ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_with_result_code.xml000066400000000000000000000020121525525160600442210ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_with_result_code_not_integer.xml000066400000000000000000000020161525525160600466220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_with_wrong_descr.xml000066400000000000000000000020031525525160600442250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_with_wrong_matchedDN_attribute.xml000066400000000000000000000020521525525160600470430ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse response_without_result_code.xml000066400000000000000000000017311525525160600447600ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse searchRequest/000077500000000000000000000000001525525160600360335ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2filters/000077500000000000000000000000001525525160600375035ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequestrequest_with_and.xml000066400000000000000000000023721525525160600435760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar foobar request_with_approxMatch.xml000066400000000000000000000022041525525160600453140ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar request_with_approxMatch_base64_value.xml000066400000000000000000000024611525525160600476610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters RFNNTHYyLjAgcm9ja3MhIQ== request_with_approxMatch_malformed_base64_value.xml000066400000000000000000000024511525525160600517060ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters !!!Not Base64!!! request_with_approxMatch_with_2_values.xml000066400000000000000000000022421525525160600501510ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar foobar request_with_approxMatch_with_empty_value.xml000066400000000000000000000021761525525160600507710ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_approxMatch_without_name.xml000066400000000000000000000021721525525160600501030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar request_with_approxMatch_without_value.xml000066400000000000000000000021341525525160600502750ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_equalityMatch.xml000066400000000000000000000022101525525160600456350ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar request_with_equalityMatch_base64_value.xml000066400000000000000000000024651525525160600502110ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters RFNNTHYyLjAgcm9ja3MhIQ== request_with_equalityMatch_malformed_base64_value.xml000066400000000000000000000024551525525160600522360ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters !!!Not base64!!! request_with_equalityMatch_with_2_values.xml000066400000000000000000000022461525525160600505010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar foobar request_with_equalityMatch_with_empty_value.xml000066400000000000000000000022021525525160600513030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_equalityMatch_without_name.xml000066400000000000000000000022001525525160600504170ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar request_with_equalityMatch_without_value.xml000066400000000000000000000021421525525160600506200ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_extensibleMatch.xml000066400000000000000000000022031525525160600461440ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters A Value request_with_extensibleMatch_base64_value.xml000066400000000000000000000024571525525160600505170ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters RFNNTHYyLjAgcm9ja3MhIQ== request_with_extensibleMatch_malformed_base64_value.xml000066400000000000000000000024471525525160600525440ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters !!!Not Base64!!! request_with_extensibleMatch_with_2_values.xml000066400000000000000000000022421525525160600510020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters A Value A Value request_with_extensibleMatch_with_dnAttributes_0.xml000066400000000000000000000022241525525160600521510ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters A Value request_with_extensibleMatch_with_dnAttributes_1.xml000066400000000000000000000022241525525160600521520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters A Value request_with_extensibleMatch_with_dnAttributes_error.xml000066400000000000000000000022301525525160600531400ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters A Value request_with_extensibleMatch_with_dnAttributes_false.xml000066400000000000000000000022301525525160600531010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters A Value request_with_extensibleMatch_with_dnAttributes_true.xml000066400000000000000000000022251525525160600527720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters A Value request_with_extensibleMatch_with_empty_value.xml000066400000000000000000000022151525525160600516140ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_extensibleMatch_with_matchingRule.xml000066400000000000000000000022441525525160600517060ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters A Value request_with_extensibleMatch_with_name.xml000066400000000000000000000022241525525160600502020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters A Value request_with_extensibleMatch_without_value.xml000066400000000000000000000021441525525160600511270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_greaterOrEqual.xml000066400000000000000000000022121525525160600457470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar request_with_greaterOrEqual_base64_value.xml000066400000000000000000000024671525525160600503230ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters RFNNTHYyLjAgcm9ja3MhIQ== request_with_greaterOrEqual_malformed_base64_value.xml000066400000000000000000000024571525525160600523500ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters !!!Not Base64!!! request_with_greaterOrEqual_with_2_values.xml000066400000000000000000000022501525525160600506040ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar foobar request_with_greaterOrEqual_with_empty_value.xml000066400000000000000000000022041525525160600514150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_greaterOrEqual_without_name.xml000066400000000000000000000022001525525160600505270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar request_with_greaterOrEqual_without_value.xml000066400000000000000000000021421525525160600507300ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_lessOrEqual.xml000066400000000000000000000022041525525160600452650ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar request_with_lessOrEqual_base64_value.xml000066400000000000000000000024611525525160600476320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters RFNNTHYyLjAgcm9ja3MhIQ== request_with_lessOrEqual_malformed_base64_value.xml000066400000000000000000000024511525525160600516570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters !!!Not Base64!!! request_with_lessOrEqual_with_2_values.xml000066400000000000000000000022421525525160600501220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar foobar request_with_lessOrEqual_with_empty_value.xml000066400000000000000000000021761525525160600507420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_lessOrEqual_without_name.xml000066400000000000000000000021721525525160600500540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar request_with_lessOrEqual_without_value.xml000066400000000000000000000021341525525160600502460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_nested_connector_nodes.xml000066400000000000000000000026631525525160600475630ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foo foo josopuram k request_with_not.xml000066400000000000000000000022431525525160600436310ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar request_with_not_with_2_children.xml000066400000000000000000000023721525525160600467600ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar foobar request_with_or.xml000066400000000000000000000022411525525160600434470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters foobar request_with_present.xml000066400000000000000000000021451525525160600445120ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_present_without_name.xml000066400000000000000000000021241525525160600472720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_substrings.xml000066400000000000000000000021441525525160600452340ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_substrings_1_any.xml000066400000000000000000000021741525525160600463260ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters kate request_with_substrings_1_any_1_final.xml000066400000000000000000000022301525525160600477100ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters kate john request_with_substrings_1_base64_any.xml000066400000000000000000000024531525525160600474720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters RFNNTHYyLjAgcm9ja3MhIQ== request_with_substrings_1_base64_final.xml000066400000000000000000000024571525525160600500000ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters RFNNTHYyLjAgcm9ja3MhIQ== request_with_substrings_1_base64_initial.xml000066400000000000000000000024651525525160600503370ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters RFNNTHYyLjAgcm9ja3MhIQ== request_with_substrings_1_empty_any.xml000066400000000000000000000021701525525160600475400ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_substrings_1_empty_final.xml000066400000000000000000000021741525525160600500460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_substrings_1_empty_initial.xml000066400000000000000000000022001525525160600503740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_substrings_1_final.xml000066400000000000000000000022001525525160600466160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters john request_with_substrings_1_initial.xml000066400000000000000000000022041525525160600471620ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters jack request_with_substrings_1_initial_1_any.xml000066400000000000000000000022341525525160600502540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters jack kate request_with_substrings_1_initial_1_final.xml000066400000000000000000000022401525525160600505530ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters jack john request_with_substrings_1_malformed_base64_any.xml000066400000000000000000000024431525525160600515170ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters !!!Not Base64!!! request_with_substrings_1_malformed_base64_final.xml000066400000000000000000000024471525525160600520250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters !!!Not Base64!!! request_with_substrings_1_malformed_base64_initial.xml000066400000000000000000000024551525525160600523640ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters !!!Not Base64!!! request_with_substrings_2_any.xml000066400000000000000000000022261525525160600463250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters kate sawyer request_with_substrings_without_name.xml000066400000000000000000000021321525525160600500140ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters request_with_1_control.xml000066400000000000000000000024351525525160600432640ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_1_control_base64_value.xml000066400000000000000000000026471525525160600456310ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest RFNNTHYyLjAgcm9ja3MhIQ== toto request_with_1_control_empty_value.xml000066400000000000000000000023641525525160600456770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_1_control_malformed_base64_value.xml000066400000000000000000000026371525525160600476560ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest !!!Not Base64!!! toto request_with_2_attributes_elements.xml000066400000000000000000000025411525525160600456650ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_2_controls.xml000066400000000000000000000026761525525160600434570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text Some other text toto request_with_2_filters.xml000066400000000000000000000023521525525160600432530ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto toto request_with_3_controls_without_value.xml000066400000000000000000000025561525525160600464340ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_attribute_without_name_attribute.xml000066400000000000000000000025241525525160600502340ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_attributes_1_attribute.xml000066400000000000000000000025351525525160600460560ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_attributes_2_attribute.xml000066400000000000000000000025771525525160600460650ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_attributes_but_no_attribute.xml000066400000000000000000000025001525525160600471740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_derefAliases_derefAlways.xml000066400000000000000000000024271525525160600463020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_derefAliases_derefFindingBaseObj.xml000066400000000000000000000024371525525160600476470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_derefAliases_derefInSearching.xml000066400000000000000000000024341525525160600472320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_derefAliases_error.xml000066400000000000000000000024211525525160600451570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_derefAliases_neverDerefAliases.xml000066400000000000000000000024351525525160600474220ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_dn_attribute.xml000066400000000000000000000022031525525160600440410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_empty_filter.xml000066400000000000000000000023161525525160600440650ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text request_with_needed_requestID.xml000066400000000000000000000022621525525160600445730ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_requestID_attribute.xml000066400000000000000000000022331525525160600453500ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_requestID_below_0.xml000066400000000000000000000022321525525160600446730ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_scope_baseObject.xml000066400000000000000000000024351525525160600446160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_scope_error.xml000066400000000000000000000024301525525160600437010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_scope_singleLevel.xml000066400000000000000000000024361525525160600450270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_scope_wholeSubtree.xml000066400000000000000000000024371525525160600452270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_with_sizeLimit_attribute.xml000066400000000000000000000022341525525160600454150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_sizeLimit_error.xml000066400000000000000000000022351525525160600445440ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_timeLimit_attribute.xml000066400000000000000000000022321525525160600453770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_timeLimit_error.xml000066400000000000000000000022351525525160600445300ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_typesOnly_0.xml000066400000000000000000000022301525525160600436020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_typesOnly_1.xml000066400000000000000000000022301525525160600436030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_typesOnly_error.xml000066400000000000000000000022341525525160600446000ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_typesOnly_false.xml000066400000000000000000000022341525525160600445410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_with_typesOnly_true.xml000066400000000000000000000022331525525160600444250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_without_derefAliases_attribute.xml000066400000000000000000000023641525525160600465670ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto request_without_dn_attribute.xml000066400000000000000000000021251525525160600445740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest toto request_without_filter.xml000066400000000000000000000022641525525160600434010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text request_without_scope_attribute.xml000066400000000000000000000024021525525160600453020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest Some text toto searchResponse/000077500000000000000000000000001525525160600362015ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2response_with_0_SRD.xml000066400000000000000000000017121525525160600425440ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse response_with_0_SRE_1_SRD.xml000066400000000000000000000020461525525160600434760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse response_with_1_SRD.xml000066400000000000000000000020461525525160600425460ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse response_with_1_SRE_0_SRD.xml000066400000000000000000000023571525525160600435030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse example top domain extensibleObject response_with_1_SRE_1_SRD.xml000066400000000000000000000025131525525160600434760ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse example top domain extensibleObject response_with_1_SRE_1_SRR_1_SRD.xml000066400000000000000000000026461525525160600444530ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse example top domain extensibleObject ldap://localhost response_with_1_SRR_0_SRD.xml000066400000000000000000000020461525525160600435130ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse ldap://localhost response_with_1_SRR_1_SRD.xml000066400000000000000000000022011525525160600435050ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse ldap://localhost response_with_2_SRE_1_SRD.xml000066400000000000000000000032171525525160600435010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse example top domain extensibleObject person top snvalue Bob Rush response_with_2_SRE_2_SRR_1_SRD.xml000066400000000000000000000035171525525160600444530ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse example top domain extensibleObject person top snvalue Bob Rush ldap://localhost ldap://ldap.apache.org response_with_2_SRR_1_SRD.xml000066400000000000000000000023421525525160600435140ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse ldap://localhost ldap://ldap.apache.org response_with_requestID_attribute.xml000066400000000000000000000020661525525160600456700ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse response_with_requestID_below_0.xml000066400000000000000000000020651525525160600452130ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse searchResultDone/000077500000000000000000000000001525525160600414535ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponseresponse_with_1_control.xml000066400000000000000000000023071525525160600470500ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone Some text response_with_1_control_empty_value.xml000066400000000000000000000022361525525160600514630ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone response_with_1_empty_referral.xml000066400000000000000000000021121525525160600504020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone response_with_1_referral.xml000066400000000000000000000021371525525160600471730ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone ldap://www.apache.org response_with_1_referral_and_error_message.xml000066400000000000000000000023171525525160600527320ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org response_with_2_controls.xml000066400000000000000000000025571525525160600472430ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone Some text Some other text response_with_2_referrals.xml000066400000000000000000000022211525525160600473510ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone ldap://www.apache.org ldap://www.apple.com response_with_3_controls_without_value.xml000066400000000000000000000024351525525160600522160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone response_with_empty_error_message.xml000066400000000000000000000021221525525160600512160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone response_with_error_message.xml000066400000000000000000000022361525525160600500060ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 response_with_matchedDN_attribute.xml000066400000000000000000000021321525525160600510560ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone response_with_requestID_attribute.xml000066400000000000000000000023271525525160600511420ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone Some text response_with_requestID_below_0.xml000066400000000000000000000023261525525160600504650ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone Some text response_with_result_code.xml000066400000000000000000000020541525525160600474570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone response_with_result_code_not_integer.xml000066400000000000000000000020601525525160600520510ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone response_with_wrong_descr.xml000066400000000000000000000020451525525160600474630ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone response_with_wrong_matchedDN_attribute.xml000066400000000000000000000021141525525160600522720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone response_without_result_code.xml000066400000000000000000000017711525525160600502140ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone searchResultEntry/000077500000000000000000000000001525525160600416675ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponseresponse_with_0_attr.xml000066400000000000000000000021561525525160600465570ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry response_with_1_attr_0_value.xml000066400000000000000000000022241525525160600501670ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry response_with_1_attr_1_base64_malformed_value.xml000066400000000000000000000025141525525160600533640ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry !!!Not Base64!!! response_with_1_attr_1_base64_value.xml000066400000000000000000000025241525525160600513370ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry RW1tYW51ZWwgTMOpY2hhcm55 response_with_1_attr_1_empty_value.xml000066400000000000000000000022531525525160600514100ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry response_with_1_attr_1_value.xml000066400000000000000000000022621525525160600501720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry example response_with_1_attr_2_value.xml000066400000000000000000000023331525525160600501720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry top domain response_with_1_attr_without_name_attribute.xml000066400000000000000000000022111525525160600534160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry response_with_1_control.xml000066400000000000000000000024171525525160600472660ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry Some text response_with_1_control_empty_value.xml000066400000000000000000000023461525525160600517010ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry response_with_2_attr_1_value.xml000066400000000000000000000024011525525160600501660ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry example top response_with_2_controls.xml000066400000000000000000000026671525525160600474610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry Some text Some other text response_with_3_controls_without_value.xml000066400000000000000000000025511525525160600524310ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry response_with_dn_attribute.xml000066400000000000000000000021561525525160600500520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry response_with_requestID_attribute.xml000066400000000000000000000021761525525160600513600ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry response_with_requestID_below_0.xml000066400000000000000000000021751525525160600507030ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry response_with_wrong_dn_attribute.xml000066400000000000000000000021571525525160600512670ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry response_without_dn_attribute.xml000066400000000000000000000021271525525160600506000ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry searchResultReference/000077500000000000000000000000001525525160600424645ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponseresponse_with_0_ref.xml000066400000000000000000000021371525525160600471550ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference response_with_1_control.xml000066400000000000000000000024421525525160600500610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference Some text ldap://localhost response_with_1_control_empty_value.xml000066400000000000000000000023711525525160600524740ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference ldap://localhost response_with_1_empty_ref.xml000066400000000000000000000021671525525160600503770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference response_with_1_ref.xml000066400000000000000000000022071525525160600471540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference ldap://localhost response_with_1_wrong_ref.xml000066400000000000000000000022211525525160600503640ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference http://thisIsAWrongRef.com response_with_2_controls.xml000066400000000000000000000027121525525160600502450ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference Some text Some other text ldap://localhost response_with_2_ref.xml000066400000000000000000000022561525525160600471610ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference ldap://localhost ldap://www.apache.org response_with_3_controls_without_value.xml000066400000000000000000000025741525525160600532330ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference ldap://localhost response_with_requestID_attribute.xml000066400000000000000000000022211525525160600521440ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference ldap://localhost response_with_requestID_below_0.xml000066400000000000000000000022201525525160600514670ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference ldap://localhost soap/000077500000000000000000000000001525525160600341575ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2soap-dsml-multiple-operation-requests.xml000066400000000000000000000032701525525160600443020ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/soap admin inetOrgPerson soap-dsml-req-with-header.xml000066400000000000000000000032331525525160600415650ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/soap 5 admin soap-dsml-req-without-header.xml000066400000000000000000000026461525525160600423240ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/soap admin apache-directory-ldap-api-cfb3cee/dsml/pom.xml000066400000000000000000000027561525525160600215530ustar00rootroot00000000000000 4.0.0 org.apache.directory.api api-parent 2.1.9 api-dsml-parent Apache Directory LDAP API DSML Parent 2003 pom engine parser apache-directory-ldap-api-cfb3cee/dsml/src/000077500000000000000000000000001525525160600210135ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/src/site/000077500000000000000000000000001525525160600217575ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/dsml/src/site/site.xml000066400000000000000000000025501525525160600234470ustar00rootroot00000000000000 apache-directory-ldap-api-cfb3cee/i18n/000077500000000000000000000000001525525160600200445ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/.gitignore000066400000000000000000000002501525525160600220310ustar00rootroot00000000000000target maven-eclipse.xml lib .externalToolBuilders felix-cache .project .classpath .settings eclipse-classes *.log *.iml *.ipr bin dependency-reduced-pom.xml META-INF apache-directory-ldap-api-cfb3cee/i18n/pom.xml000066400000000000000000000057361525525160600213740ustar00rootroot00000000000000 4.0.0 org.apache.directory.api api-parent 2.1.9 api-i18n Apache Directory LDAP API I18n bundle Internationalization of errors and other messages org.apache.maven.plugins maven-javadoc-plugin **/I18n.java org.apache.maven.plugins maven-surefire-plugin always org.apache.maven.plugins maven-jar-plugin META-INF/MANIFEST.MF false org.apache.felix maven-bundle-plugin true true META-INF ${project.groupId}.i18n org.apache.directory.api.i18n;version=${project.version};-noimport:=true apache.directory.ldap.api.i18n apache-directory-ldap-api-cfb3cee/i18n/src/000077500000000000000000000000001525525160600206335ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/checkstyle/000077500000000000000000000000001525525160600227715ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/checkstyle/suppressions.xml000066400000000000000000000020441525525160600262700ustar00rootroot00000000000000 apache-directory-ldap-api-cfb3cee/i18n/src/main/000077500000000000000000000000001525525160600215575ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/java/000077500000000000000000000000001525525160600225005ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/java/org/000077500000000000000000000000001525525160600232675ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/java/org/apache/000077500000000000000000000000001525525160600245105ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/java/org/apache/directory/000077500000000000000000000000001525525160600265145ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/java/org/apache/directory/api/000077500000000000000000000000001525525160600272655ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/java/org/apache/directory/api/i18n/000077500000000000000000000000001525525160600300445ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/java/org/apache/directory/api/i18n/I18n.java000066400000000000000000003521231525525160600314340ustar00rootroot00000000000000/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.i18n; import java.text.MessageFormat; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; /** * Provides i18n handling of error codes. * About formatting see also {@link MessageFormat} * * @author Apache Directory Project */ public enum I18n { // api-asn1-api 0 - 999 ERR_00000_NULL_OR_NEG_LENGTH_NOT_ALLOWED( "ERR_00000_NULL_OR_NEG_LENGTH_NOT_ALLOWED" ), ERR_00001_BIT_NUMBER_OUT_OF_BOUND( "ERR_00001_BIT_NUMBER_OUT_OF_BOUND" ), ERR_00002_CANNOT_FIND_BIT( "ERR_00002_CANNOT_FIND_BIT" ), ERR_00003_INVALID_OID( "ERR_00003_INVALID_OID" ), // api-asn1-ber 1000 - 1999 // <> 1000 - 1099 ERR_01000_LENGTH_OVERFLOW( "ERR_01000_LENGTH_OVERFLOW" ), ERR_01001_LENGTH_EXTENSION_RESERVED( "ERR_01001_LENGTH_EXTENSION_RESERVED" ), ERR_01002_TLV_NULL( "ERR_01002_TLV_NULL" ), ERR_01003_VALUE_LENGTH_ABOVE_EXPECTED_LENGTH( "ERR_01003_VALUE_LENGTH_ABOVE_EXPECTED_LENGTH" ), ERR_01004_MORE_TLV_EXPECTED( "ERR_01004_MORE_TLV_EXPECTED" ), ERR_01005_TRUNCATED_PDU( "ERR_01005_TRUNCATED_PDU" ), ERR_01006_LENGTH_TOO_LONG_FOR_DEFINITE_FORM( "ERR_01006_LENGTH_TOO_LONG_FOR_DEFINITE_FORM" ), ERR_01007_PDU_SIZE_TOO_LONG( "ERR_01007_PDU_SIZE_TOO_LONG" ), ERR_01008_REMAINING_BYTES_FOR_DECODED_PDU( "ERR_01008_REMAINING_BYTES_FOR_DECODED_PDU" ), ERR_01009_INDEFINITE_LENGTH_NOT_SUPPORTED( "ERR_01009_INDEFINITE_LENGTH_NOT_SUPPORTED" ), ERR_01308_ZERO_LENGTH_TLV( "ERR_01308_ZERO_LENGTH_TLV" ), ERR_01309_EMPTY_TLV( "ERR_01309_EMPTY_TLV" ), ERR_01310_INTEGER_DECODING_ERROR( "ERR_01310_INTEGER_DECODING_ERROR" ), ERR_01311_NEGATIVE_LENGTH( "ERR_01311_NEGATIVE_LENGTH" ), // actions 1100 - 1199 ERR_01100_INCORRECT_LENGTH( "ERR_01100_INCORRECT_LENGTH" ), ERR_01101_NULL_LENGTH( "ERR_01101_NULL_LENGTH" ), ERR_01102_INVALID_INTEGER( "ERR_01102_INVALID_INTEGER" ), // grammar 1200 - 1299 ERR_01200_BAD_TRANSITION_FROM_STATE( "ERR_01200_BAD_TRANSITION_FROM_STATE" ), ERR_01201_MANDATORY_TRANSITION_EXPECTED( "ERR_01201_MANDATORY_TRANSITION_EXPECTED" ), // tlv 1300 - 1399 ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER( "ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER" ), ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL( "ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL" ), ERR_01302_0_BYTES_LONG_BOOLEAN( "ERR_01302_0_BYTES_LONG_BOOLEAN" ), ERR_01303_N_BYTES_LONG_BOOLEAN( "ERR_01303_N_BYTES_LONG_BOOLEAN" ), ERR_01304_0_BYTES_LONG_INTEGER( "ERR_01304_0_BYTES_LONG_INTEGER" ), ERR_01305_ABOVE_4_BYTES_INTEGER( "ERR_01305_ABOVE_4_BYTES_INTEGER" ), ERR_01306_VALUE_NOT_IN_RANGE( "ERR_01306_VALUE_NOT_IN_RANGE" ), ERR_01307_0_BYTES_LONG_LONG( "ERR_01307_0_BYTES_LONG_LONG" ), // api-dsml-engine 2000-2999 ERR_02000_FAILED_PROCESSING_DSML( "ERR_02000_FAILED_PROCESSING_DSML" ), ERR_02001_UNEXPECTED_REQUEST_TYPE( "ERR_02001_UNEXPECTED_REQUEST_TYPE" ), ERR_02002_MISSING_CONNECTION_TO_BIND( "ERR_02002_MISSING_CONNECTION_TO_BIND" ), ERR_02003_LINE_COLUMN( "ERR_02003_LINE_COLUMN" ), ERR_02004_MISSING_REQUEST_ID( "ERR_02004_MISSING_REQUEST_ID" ), ERR_02005_INTERNAL_ERROR( "ERR_02005_INTERNAL_ERROR" ), // api-dsml-parser 3000-3999 ERR_03000_REQUEST_ID_REQUIRED( "ERR_03000_REQUEST_ID_REQUIRED" ), ERR_03001_DN_ATTRIBUTE_REQUIRED( "ERR_03001_DN_ATTRIBUTE_REQUIRED" ), ERR_03002_NAME_ATTRIBUTE_REQUIRED( "ERR_03002_NAME_ATTRIBUTE_REQUIRED" ), ERR_03003_UNABLE_TO_FIND_BATCH_REQUEST( "ERR_03003_UNABLE_TO_FIND_BATCH_REQUEST" ), ERR_03004_UNKNOWN_TYPE( "ERR_03004_UNKNOWN_TYPE" ), ERR_03005_REQUIRE_ATTRIBUTE_TYPE( "ERR_03005_REQUIRE_ATTRIBUTE_TYPE" ), ERR_03006_INCORRECT_TYPE_ATTRIBUTE_VALUE( "ERR_03006_INCORRECT_TYPE_ATTRIBUTE_VALUE" ), ERR_03007_INCORRECT_CRITICALITY_VALUE( "ERR_03007_INCORRECT_CRITICALITY_VALUE" ), ERR_03008_UNEXPECTED_ERROR( "ERR_03008_UNEXPECTED_ERROR" ), ERR_03009_RESULT_CODE_NOT_INTEGER( "ERR_03009_RESULT_CODE_NOT_INTEGER" ), ERR_03010_CODE_ATTRIBUTE_REQUIRED( "ERR_03010_CODE_ATTRIBUTE_REQUIRED" ), ERR_03011_DESCR_DOESNT_MATCH_VALUES( "ERR_03011_DESCR_DOESNT_MATCH_VALUES" ), ERR_03012_REQUEST_ID_NOT_INTEGER( "ERR_03012_REQUEST_ID_NOT_INTEGER" ), ERR_03013_UNKNOWN_PROCESSING_VALUE( "ERR_03013_UNKNOWN_PROCESSING_VALUE" ), ERR_03014_UNKNOWN_ON_ERROR_VALUE( "ERR_03014_UNKNOWN_ON_ERROR_VALUE" ), ERR_03015_UNKNOWN_RESPONSE_ORDER_VALUE( "ERR_03015_UNKNOWN_RESPONSE_ORDER_VALUE" ), ERR_03016_BELOW_0_REQUEST_ID( "ERR_03016_BELOW_0_REQUEST_ID" ), ERR_03017_ABANDON_ID_NOT_INTEGER( "ERR_03017_ABANDON_ID_NOT_INTEGER" ), ERR_03018_ABANDON_ID_REQUIRED( "ERR_03018_ABANDON_ID_REQUIRED" ), ERR_03019_IO_EXCEPTION_OCCURED( "ERR_03019_IO_EXCEPTION_OCCURED" ), ERR_03020_CANT_ADD_ATTRIBUTE_VALUE( "ERR_03020_CANT_ADD_ATTRIBUTE_VALUE" ), ERR_03021_PRINCIPAL_ATTRIBUTE_REQUIRED( "ERR_03021_PRINCIPAL_ATTRIBUTE_REQUIRED" ), ERR_03022_NULL_REQUEST_NAME( "ERR_03022_NULL_REQUEST_NAME" ), ERR_03023_NEW_RDN_ATTRIBUTE_REQUESTED( "ERR_03023_NEW_RDN_ATTRIBUTE_REQUESTED" ), ERR_03024_INCORRECT_DELETE_OLD_RDN_VALUE( "ERR_03024_INCORRECT_DELETE_OLD_RDN_VALUE" ), ERR_03025_OPERATION_ATTRIBUTE_REQUIRED( "ERR_03025_OPERATION_ATTRIBUTE_REQUIRED" ), ERR_03026_UNKNOWN_SCOPE( "ERR_03026_UNKNOWN_SCOPE" ), ERR_03027_SCOPE_ATTRIBUTE_REQUIRED( "ERR_03027_SCOPE_ATTRIBUTE_REQUIRED" ), ERR_03028_UNKNOWN_DEREFALIAS_VALUE( "ERR_03028_UNKNOWN_DEREFALIAS_VALUE" ), ERR_03029_DEREFALIA_ATTRIBUTE_REQUIRED( "ERR_03029_DEREFALIA_ATTRIBUTE_REQUIRED" ), ERR_03030_SIZE_LIMIT_NOT_INTEGER( "ERR_03030_SIZE_LIMIT_NOT_INTEGER" ), ERR_03031_TIME_LIMIT_NOT_INTEGER( "ERR_03031_TIME_LIMIT_NOT_INTEGER" ), ERR_03032_TYPES_ONLY_NOT_BOOLEAN( "ERR_03032_TYPES_ONLY_NOT_BOOLEAN" ), ERR_03033_DN_ATTRIBUTES_NOT_BOOLEAN( "ERR_03033_DN_ATTRIBUTES_NOT_BOOLEAN" ), ERR_03034_INCORRECT_TYPE_VALUE( "ERR_03034_INCORRECT_TYPE_VALUE" ), ERR_03035_TYPE_ATTRIBUTE_REQUIRED( "ERR_03035_TYPE_ATTRIBUTE_REQUIRED" ), ERR_03036_MISSING_TAG( "ERR_03036_MISSING_TAG" ), ERR_03037_UNEXPECTED_FILTER_TYPE( "ERR_03037_UNEXPECTED_FILTER_TYPE" ), ERR_03038_BAD_OID( "ERR_03038_BAD_OID" ), ERR_03039_PARSING_ERROR( "ERR_03039_PARSING_ERROR" ), ERR_03040_UNKNOWN_OPERATION( "ERR_03040_UNKNOWN_OPERATION" ), ERR_03041_NO_FILTER_ELEMENT( "ERR_03041_NO_FILTER_ELEMENT" ), ERR_03042_UNEXPECTED_FILTER_TYPE( "ERR_03042_UNEXPECTED_FILTER_TYPE" ), ERR_03043_UNEXPECTED_DEREF_ALIAS( "ERR_03043_UNEXPECTED_DEREF_ALIAS" ), ERR_03044_SHOULD_NOT_BE_A_DECORATOR( "ERR_03044_SHOULD_NOT_BE_A_DECORATOR" ), ERR_03045_UNIDENTIFIED_RESPONSE_TYPE( "ERR_03045_UNIDENTIFIED_RESPONSE_TYPE" ), ERR_03046_FILTER_MAX_DEPTH_EXCEEDED( "ERR_03046_FILTER_MAX_DEPTH_EXCEEDED" ), ERR_03047_INVALID_BASE64_VALUE( "ERR_03047_INVALID_BASE64_VALUE" ), ERR_03048_FILTER_TOO_DEEP( "ERR_03048_FILTER_TOO_DEEP" ), ERR_03049_DN_ATTRIBUTE_REQUIRED( "ERR_03049_DN_ATTRIBUTE_REQUIRED" ), // api-ldap-client-api 4000-4999 // <> 4000-4100 // api 4100-4200 ERR_04100_UNABLE_TO_UNBIND( "ERR_04100_UNABLE_TO_UNBIND" ), ERR_04101_CANNOT_CREATE_LDAP_CONNECTION_FACTORY( "ERR_04101_CANNOT_CREATE_LDAP_CONNECTION_FACTORY" ), ERR_04102_UNABLE_TO_BIND_CONNECTION( "ERR_04102_UNABLE_TO_BIND_CONNECTION" ), ERR_04103_UNABLE_TO_CLOSE_FAILED_CONNECTION( "ERR_04103_UNABLE_TO_CLOSE_FAILED_CONNECTION" ), ERR_04104_NULL_CONNECTION_CANNOT_CONNECT( "ERR_04104_NULL_CONNECTION_CANNOT_CONNECT" ), ERR_04105_CONNECTION_NOT_AUTHENTICATED( "ERR_04105_CONNECTION_NOT_AUTHENTICATED" ), ERR_04106_OPERATION_NOT_SUPPORTED( "ERR_04106_OPERATION_NOT_SUPPORTED" ), ERR_04107_UNEXPECTED_THROWN_EXCEPTION( "ERR_04107_UNEXPECTED_THROWN_EXCEPTION" ), ERR_04108_INVALID_CONNECTION( "ERR_04108_INVALID_CONNECTION" ), ERR_04109_CANNOT_CONNECT( "ERR_04109_CANNOT_CONNECT" ), ERR_04110_CANNOT_CONNECT_TO_SERVER( "ERR_04110_CANNOT_CONNECT_TO_SERVER" ), ERR_04111_UNKNOWN_RESPONSE_FUTURE_TYPE( "ERR_04111_UNKNOWN_RESPONSE_FUTURE_TYPE" ), ERR_04112_OP_FAILED_TIMEOUT( "ERR_04112_OP_FAILED_TIMEOUT" ), ERR_04113_ERROR_PROCESSING_NOD( "ERR_04113_ERROR_PROCESSING_NOD" ), ERR_04114_CURSOR_CLOSE_FAIL( "ERR_04114_CURSOR_CLOSE_FAIL" ), ERR_04115_ERROR_LOADING_SCHEMA( "ERR_04115_ERROR_LOADING_SCHEMA" ), ERR_04116_FAIL_LOAD_SCHEMA( "ERR_04116_FAIL_LOAD_SCHEMA" ), ERR_04117_FAIL_LOAD_SCHEMA_FILE( "ERR_04117_FAIL_LOAD_SCHEMA_FILE" ), ERR_04118_SOMETHING_WRONG_HAPPENED( "ERR_04118_SOMETHING_WRONG_HAPPENED" ), ERR_04119_TIMEOUT( "ERR_04119_TIMEOUT" ), ERR_04120_TLS_HANDSHAKE_ERROR( "ERR_04120_TLS_HANDSHAKE_ERROR" ), ERR_04121_CANNOT_RESOLVE_HOSTNAME( "ERR_04121_CANNOT_RESOLVE_HOSTNAME" ), ERR_04122_SSL_CONTEXT_INIT_FAILURE( "ERR_04122_SSL_CONTEXT_INIT_FAILURE" ), ERR_04123_CANNOT_ADD_EMPTY_ENTRY( "ERR_04123_CANNOT_ADD_EMPTY_ENTRY" ), ERR_04124_CANNOT_PROCESS_NULL_ADD_REQUEST( "ERR_04124_CANNOT_PROCESS_NULL_ADD_REQUEST" ), ERR_04125_CANNOT_ADD_NULL_ENTRY( "ERR_04125_CANNOT_ADD_NULL_ENTRY" ), ERR_04126_CANNOT_ABANDON_NEG_MSG_ID( "ERR_04126_CANNOT_ABANDON_NEG_MSG_ID" ), ERR_04127_CANNOT_PROCESS_NULL_ABANDON_REQ( "ERR_04127_CANNOT_PROCESS_NULL_ABANDON_REQ" ), ERR_04128_CANNOT_PROCESS_NULL_BIND_REQ( "ERR_04128_CANNOT_PROCESS_NULL_BIND_REQ" ), ERR_04129_NULL_BASE_DN( "ERR_04129_NULL_BASE_DN" ), ERR_04130_CANNOT_PROCESS_NULL_SEARCH_REQ( "ERR_04130_CANNOT_PROCESS_NULL_SEARCH_REQ" ), ERR_04131_CANNOT_PROCESS_SEARCH_NULL_DN( "ERR_04131_CANNOT_PROCESS_SEARCH_NULL_DN" ), ERR_04132_UNEXPECTED_RESPONSE_TYPE( "ERR_04132_UNEXPECTED_RESPONSE_TYPE" ), ERR_04133_NULL_MODIFIED_ENTRY( "ERR_04133_NULL_MODIFIED_ENTRY" ), ERR_04134_NULL_MODIFIED_DN( "ERR_04134_NULL_MODIFIED_DN" ), ERR_04135_CANNOT_PROCESS_NO_MODIFICATION_MOD( "ERR_04135_CANNOT_PROCESS_NO_MODIFICATION_MOD" ), ERR_04136_CANNOT_PROCESS_NULL_MOD_REQ( "ERR_04136_CANNOT_PROCESS_NULL_MOD_REQ" ), ERR_04137_CANNOT_PROCESS_MOD_NULL_DN( "ERR_04137_CANNOT_PROCESS_MOD_NULL_DN" ), ERR_04138_CANNOT_PROCESS_RENAME_NULL_DN( "ERR_04138_CANNOT_PROCESS_RENAME_NULL_DN" ), ERR_04139_CANNOT_PROCESS_RENAME_NULL_RDN( "ERR_04139_CANNOT_PROCESS_RENAME_NULL_RDN" ), ERR_04140_CANNOT_PROCESS_MOVE_NULL_DN( "ERR_04140_CANNOT_PROCESS_MOVE_NULL_DN" ), ERR_04141_CANNOT_PROCESS_MOVE_NULL_SUPERIOR( "ERR_04141_CANNOT_PROCESS_MOVE_NULL_SUPERIOR" ), ERR_04142_NULL_ENTRY_DN( "ERR_04142_NULL_ENTRY_DN" ), ERR_04143_CANNOT_MOVE_ROOT_DSE( "ERR_04143_CANNOT_MOVE_ROOT_DSE" ), ERR_04144_NULL_NEW_DN( "ERR_04144_NULL_NEW_DN" ), ERR_04145_ROOT_DSE_CANNOT_BE_TARGET( "ERR_04145_ROOT_DSE_CANNOT_BE_TARGET" ), ERR_04146_CANNOT_PROCESS_NULL_MODDN_REQ( "ERR_04146_CANNOT_PROCESS_NULL_MODDN_REQ" ), ERR_04147_CANNOT_PROCESS_MOD_NULL_DN_SUP( "ERR_04147_CANNOT_PROCESS_MOD_NULL_DN_SUP" ), ERR_04148_SUBTREE_CONTROL_NOT_SUPPORTED( "ERR_04148_SUBTREE_CONTROL_NOT_SUPPORTED" ), ERR_04149_CANNOT_PROCESS_NULL_DEL_REQ( "ERR_04149_CANNOT_PROCESS_NULL_DEL_REQ" ), ERR_04150_CANNOT_PROCESS_NULL_DEL_NULL_DN( "ERR_04150_CANNOT_PROCESS_NULL_DEL_NULL_DN" ), ERR_04151_CANNOT_PROCESS_NULL_COMP_REQ( "ERR_04151_CANNOT_PROCESS_NULL_COMP_REQ" ), ERR_04152_CANNOT_PROCESS_NULL_DN_COMP_REQ( "ERR_04152_CANNOT_PROCESS_NULL_DN_COMP_REQ" ), ERR_04153_OID_DECODING_FAILURE( "ERR_04153_OID_DECODING_FAILURE" ), ERR_04154_CANNOT_PROCESS_NULL_EXT_REQ( "ERR_04154_CANNOT_PROCESS_NULL_EXT_REQ" ), ERR_04155_ROOT_DSE_SEARCH_FAILED( "ERR_04155_ROOT_DSE_SEARCH_FAILED" ), ERR_04156_FAILED_FETCHING_ROOT_DSE( "ERR_04156_FAILED_FETCHING_ROOT_DSE" ), ERR_04157_CANNOT_USE_TLS_WITH_SSL_FLAG( "ERR_04157_CANNOT_USE_TLS_WITH_SSL_FLAG" ), ERR_04158_CANNOT_FIND_SASL_FACTORY_FOR_MECH( "ERR_04158_CANNOT_FIND_SASL_FACTORY_FOR_MECH" ), ERR_04159_PROTOCOL_ERROR( "ERR_04159_PROTOCOL_ERROR" ), ERR_04160_SESSION_HAS_BEEN_CLOSED( "ERR_04160_SESSION_HAS_BEEN_CLOSED" ), ERR_04161_START_TLS_EXT_NOT_VALID_OID( "ERR_04161_START_TLS_EXT_NOT_VALID_OID" ), ERR_04162_INITIAL_PART_NEEDED( "ERR_04162_INITIAL_PART_NEEDED" ), ERR_04163_FINAL_PART_NEEDED( "ERR_04163_FINAL_PART_NEEDED" ), ERR_04164_ANY_PART_NEEDED( "ERR_04164_ANY_PART_NEEDED" ), ERR_04165_INITIAL_ANY_FINAL_PART_NEEDED( "ERR_04165_INITIAL_ANY_FINAL_PART_NEEDED" ), ERR_04166_ONE_FILTER_REQUIRED( "ERR_04166_ONE_FILTER_REQUIRED" ), ERR_04167_FILTER_NOT_SET( "ERR_04167_FILTER_NOT_SET" ), ERR_04168_TRIM_LOWERCASE_FOR_CHAR_ARRAY( "ERR_04168_TRIM_LOWERCASE_FOR_CHAR_ARRAY" ), ERR_04169_RESPONSE_QUEUE_EMPTIED( "ERR_04169_RESPONSE_QUEUE_EMPTIED" ), ERR_04170_TIMEOUT_OCCURED( "ERR_04170_TIMEOUT_OCCURED" ), ERR_04171_CANNOT_PARSE_MATCHED_DN( "ERR_04171_CANNOT_PARSE_MATCHED_DN" ), ERR_04172_KEYSTORE_INIT_FAILURE( "ERR_04172_KEYSTORE_INIT_FAILURE" ), ERR_04173_ALGORITHM_NOT_FOUND( "ERR_04173_ALGORITHM_NOT_FOUND" ), ERR_04174_INPUT_FILE_NAME_NULL( "ERR_04174_INPUT_FILE_NAME_NULL" ), ERR_04175_TRUST_STORE_FILE_NULL( "ERR_04175_TRUST_STORE_FILE_NULL" ), ERR_04176_TRUST_MANAGER_NOT_FOUND( "ERR_04176_TRUST_MANAGER_NOT_FOUND" ), ERR_04177_NO_SUCH_ALGORITHM( "ERR_04177_NO_SUCH_ALGORITHM" ), ERR_04178_CANT_LOAD_KEY_STORE( "ERR_04178_CANT_LOAD_KEY_STORE" ), ERR_04179_TRUST_STORE_CANT_BE_READ( "ERR_04179_TRUST_STORE_CANT_BE_READ" ), ERR_04180_FILE_DOES_NOT_EXIST_ON_CLASSPATH( "ERR_04180_FILE_DOES_NOT_EXIST_ON_CLASSPATH" ), ERR_04181_INVALID_FILTER_ATTRIBUTE_DESCRIPTIONT( "ERR_04181_INVALID_FILTER_ATTRIBUTE_DESCRIPTIONT" ), ERR_04182_INVALID_MATCHING_RULE( "ERR_04182_INVALID_MATCHING_RULE" ), ERR_04183_TRUSTMANAGERS_CANT_BE_NULL( "ERR_04183_TRUSTMANAGERS_CANT_BE_NULL" ), ERR_04184_FAILED_RELEASE_CONNECTION( "ERR_04184_FAILED_RELEASE_CONNECTION" ), ERR_04185_CANT_READ_SCHEMA( "ERR_04185_CANT_READ_SCHEMA" ), // template 4200-4300 // None // api-ldap-codec-core 5000-5999 // <> 5000-5099 ERR_05000_NULL_REQUEST_NAME( "ERR_05000_NULL_REQUEST_NAME" ), ERR_05001_EMPTY_MATCHING_RULE( "ERR_05001_EMPTY_MATCHING_RULE" ), ERR_05002_ENTRY_NULL_VALUE( "ERR_05002_ENTRY_NULL_VALUE" ), // actions 5100-5199 ERR_05100_ZERO_LENGTH_MESSAGE_ID_NOT_ALLOWED( "ERR_05100_ZERO_LENGTH_MESSAGE_ID_NOT_ALLOWED" ), ERR_05101_NULL_MESSAGE_ID_NOT_ALLOWED( "ERR_05101_NULL_MESSAGE_ID_NOT_ALLOWED" ), ERR_05102_INVALID_MESSAGE_ID( "ERR_05102_INVALID_MESSAGE_ID" ), ERR_05103_INVALID_URL( "ERR_05103_INVALID_URL" ), ERR_05104_INVALID_URL( "ERR_05104_INVALID_URL" ), ERR_05105_REFERRAL_MUST_NOT_BE_NULL( "ERR_05105_REFERRAL_MUST_NOT_BE_NULL" ), ERR_05106_INCORRECT_DN_GIVEN_INVALID( "ERR_05106_INCORRECT_DN_GIVEN_INVALID" ), ERR_05107_INCORRECT_DN_GIVEN( "ERR_05107_INCORRECT_DN_GIVEN" ), ERR_05108_INVALID_RESULT_CODE( "ERR_05108_INVALID_RESULT_CODE" ), ERR_05109_ABANDON_REQ_MSG_ID_NULL( "ERR_05109_ABANDON_REQ_MSG_ID_NULL" ), ERR_05110_INVALID_ABANDON_REQ_MSG_ID( "ERR_05110_INVALID_ABANDON_REQ_MSG_ID" ), ERR_05111_NULL_OR_EMPTY_TYPE_NOT_ALLOWED( "ERR_05111_NULL_OR_EMPTY_TYPE_NOT_ALLOWED" ), ERR_05112_ERROR_WITH_ATTRIBUTE_TYPE( "ERR_05112_ERROR_WITH_ATTRIBUTE_TYPE" ), ERR_05113_INVALID_DN( "ERR_05113_INVALID_DN" ), ERR_05114_ERROR_MESSAGE( "ERR_05114_ERROR_MESSAGE" ), ERR_05115_EMTPY_ENTRY_DN_GIVEN( "ERR_05115_EMTPY_ENTRY_DN_GIVEN" ), ERR_05116_SASL_CREDS_CANT_BE_NULL( "ERR_05116_SASL_CREDS_CANT_BE_NULL" ), ERR_05117_INVALID_VERSION( "ERR_05117_INVALID_VERSION" ), ERR_05118_NULL_ATTRIBUTE_DESC( "ERR_05118_NULL_ATTRIBUTE_DESC" ), ERR_05119_NULL_ENTRY( "ERR_05119_NULL_ENTRY" ), ERR_05120_INVALID_DELETE_DN( "ERR_05120_INVALID_DELETE_DN" ), ERR_05121_INVALID_REQUEST_NAME_OID( "ERR_05121_INVALID_REQUEST_NAME_OID" ), ERR_05122_NULL_NAME( "ERR_05122_NULL_NAME" ), ERR_05123_TYPE_CANT_BE_NULL( "ERR_05123_TYPE_CANT_BE_NULL" ), ERR_05124_INVALID_OPERATION( "ERR_05124_INVALID_OPERATION" ), ERR_05125_INVALID_OLD_RDN( "ERR_05125_INVALID_OLD_RDN" ), ERR_05126_RDN_MUST_NOT_BE_NULL( "ERR_05126_RDN_MUST_NOT_BE_NULL" ), ERR_05127_INVALID_NEW_RDN( "ERR_05127_INVALID_NEW_RDN" ), ERR_05128_NULL_SUPERIOR( "ERR_05128_NULL_SUPERIOR" ), ERR_05129_INVALID_NEW_SUPERIOR( "ERR_05129_INVALID_NEW_SUPERIOR" ), ERR_05130_NON_NULL_UNBIND_LENGTH( "ERR_05130_NON_NULL_UNBIND_LENGTH " ), ERR_05131_UNBIND_REQUEST_LENGTH_MUST_BE_NULL( "ERR_05131_UNBIND_REQUEST_LENGTH_MUST_BE_NULL" ), ERR_05132_INVALID_ROOT_DN( "ERR_05132_INVALID_ROOT_DN" ), ERR_05133_INTERMEDIATE_RESPONSE_INVALID_OID( "ERR_05133_INTERMEDIATE_RESPONSE_INVALID_OID" ), ERR_05134_EMPTY_AND_FILTER_PDU( "ERR_05134_EMPTY_AND_FILTER_PDU" ), ERR_05135_EMPTY_ATTRIBUTE_DESCRIPTION( "ERR_05135_EMPTY_ATTRIBUTE_DESCRIPTION" ), ERR_05136_EMPTY_NOT_FILTER_PDU( "ERR_05136_EMPTY_NOT_FILTER_PDU" ), ERR_05137_EMPTY_OR_FILTER_PDU( "ERR_05137_EMPTY_OR_FILTER_PDU" ), ERR_05138_EMPTY_SUBSTRING_FILTER_PDU( "ERR_05138_EMPTY_SUBSTRING_FILTER_PDU" ), ERR_05139_EMPTY_SUBSTRING_ANY_FILTER_PDU( "ERR_05139_EMPTY_SUBSTRING_ANY_FILTER_PDU" ), ERR_05140_EMPTY_SUBSTRING_FINAL_FILTER_PDU( "ERR_05140_EMPTY_SUBSTRING_FINAL_FILTER_PDU" ), ERR_05141_NULL_MATCHING_RULE_ASSERTION_TYPE( "ERR_05141_NULL_MATCHING_RULE_ASSERTION_TYPE" ), ERR_05142_ZERO_LENGTH_MESSAGE( "ERR_05142_ZERO_LENGTH_MESSAGE" ), ERR_05143_EMPTY_MESSAGE( "ERR_05143_EMPTY_MESSAGE" ), ERR_05144_NULL_BIND_REQUEST( "ERR_05144_NULL_BIND_REQUEST" ), ERR_05145_NULL_ADD_REQUEST( "ERR_05145_NULL_ADD_REQUEST" ), ERR_05146_NULL_ADD_RESPONSE( "ERR_05146_NULL_ADD_RESPONSE" ), ERR_05147_NULL_ATTRIBUTE_TYPE( "ERR_05147_NULL_ATTRIBUTE_TYPE" ), ERR_05148_NULL_COMPARE_REQUEST( "ERR_05148_NULL_COMPARE_REQUEST" ), ERR_05149_BAD_SCOPE( "ERR_05149_BAD_SCOPE" ), ERR_05150_BAD_DEREF_ALIAS( "ERR_05150_BAD_DEREF_ALIAS" ), ERR_05151_BAD_SIZE_LIMIT( "ERR_05151_BAD_SIZE_LIMIT" ), ERR_05152_BAD_TIME_LIMIT( "ERR_05152_BAD_TIME_LIMIT" ), ERR_05153_NULL_ATTRIBUTE_DESCRIPTION( "ERR_05153_NULL_ATTRIBUTE_DESCRIPTION" ), ERR_05154_EMPTY_SUBSTRING_INITIAL_FILTER_PDU( "ERR_05154_EMPTY_SUBSTRING_INITIAL_FILTER_PDU" ), ERR_05155_FLAG_TYPE_INVALID( "ERR_05155_FLAG_TYPE_INVALID" ), ERR_05156_INVALID_ATTRIBUTE_TYPE( "ERR_05156_INVALID_ATTRIBUTE_TYPE" ), ERR_05157_INVALID_DN( "ERR_05157_INVALID_DN" ), ERR_05158_INVALID_REQUEST_VALUE( "ERR_05158_INVALID_REQUEST_VALUE" ), ERR_05159_INVALID_RESPONSE_NAME_OID( "ERR_05159_INVALID_RESPONSE_NAME_OID" ), ERR_05160_MORE_THAN_ONE_VALUE_INCREMENT_MOD_OP( "ERR_05160_MORE_THAN_ONE_VALUE_INCREMENT_MOD_OP" ), ERR_05161_MISPLACED_FILTER_TLV( "ERR_05161_MISPLACED_FILTER_TLV" ), // api 5200-5299 ERR_05200_NOT_INITIALIZED_YET( "ERR_05200_NOT_INITIALIZED_YET" ), ERR_05201_INSTANCE_ALREADY_SET( "ERR_05201_INSTANCE_ALREADY_SET" ), ERR_05202_FAILED_TO_INSTANCIATE( "ERR_05202_FAILED_TO_INSTANCIATE" ), ERR_05203_CODEC_ARGS_CANNOT_BE_NULL( "ERR_05203_CODEC_ARGS_CANNOT_BE_NULL" ), ERR_05204_LDAP_DECODER_FAILURE( "ERR_05204_LDAP_DECODER_FAILURE" ), ERR_05205_PDU_DOES_NOT_CONTAIN_ENOUGH_DATA( "ERR_05205_PDU_DOES_NOT_CONTAIN_ENOUGH_DATA" ), ERR_05206_INPUT_STREAM_TOO_SHORT_PDU( "ERR_05206_INPUT_STREAM_TOO_SHORT_PDU" ), ERR_05207_INVALID_SASL_LENGTH_PREFIX( "ERR_05207_INVALID_SASL_LENGTH_PREFIX" ), ERR_0528_NEGOCIATED_MAX_BUFFER_TOO_SMALL( "ERR_0528_NEGOCIATED_MAX_BUFFER_TOO_SMALL" ), // controls 5300-5399 ERR_05300_CANT_DECODE_CHANGE_TYPE( "ERR_05300_CANT_DECODE_CHANGE_TYPE" ), ERR_05301_INVALID_PREVIOUS_DN( "ERR_05301_INVALID_PREVIOUS_DN" ), ERR_05302_PREVIOUS_DN_NOT_ALLOWED( "ERR_05302_PREVIOUS_DN_NOT_ALLOWED" ), ERR_05303_BAD_PREVIOUS_DN( "ERR_05303_BAD_PREVIOUS_DN" ), ERR_05304_FAILED_TO_DECODE_PREVIOUS_DN( "ERR_05304_FAILED_TO_DECODE_PREVIOUS_DN" ), ERR_05305_CHANGE_NUMBER_DECODING_ERROR( "ERR_05305_CHANGE_NUMBER_DECODING_ERROR" ), ERR_05306_PAGED_SEARCH_SIZE_DECODING_ERROR( "ERR_05306_PAGED_SEARCH_SIZE_DECODING_ERROR" ), ERR_05307_CHANGE_TYPES_DECODING_ERROR( "ERR_05307_CHANGE_TYPES_DECODING_ERROR" ), ERR_05308_CHANGE_ONLY_DECODING_ERROR( "ERR_05308_CHANGE_ONLY_DECODING_ERROR" ), ERR_05309_RETURN_ECS_DECODING_ERROR( "ERR_05309_RETURN_ECS_DECODING_ERROR" ), ERR_05310_INVALID_VISIBILITY_FLAG( "ERR_05310_INVALID_VISIBILITY_FLAG" ), // osgi 5400-5499 ERR_05400_CONTROL_ARGUMENT_WAS_NULL( "ERR_05400_CONTROL_ARGUMENT_WAS_NULL" ), ERR_05401_FIGURE_OUT_HOW_TO_TRANSFORM( "ERR_05401_FIGURE_OUT_HOW_TO_TRANSFORM" ), ERR_05402_UNABLE_TO_ENCODE_RESPONSE_VALUE( "ERR_05402_UNABLE_TO_ENCODE_RESPONSE_VALUE" ), // search 5500-5599 ERR_05500_NULL_MATCHING_RULE_AND_TYPE( "ERR_05500_NULL_MATCHING_RULE_AND_TYPE" ), ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER( "ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER" ), ERR_05502_NULL_INITIAL_ANY_OR_FINAL_SUBSTRING( "ERR_05502_NULL_INITIAL_ANY_OR_FINAL_SUBSTRING" ), ERR_05503_UNEXPECTED_FILTER_TYPE( "ERR_05503_UNEXPECTED_FILTER_TYPE" ), // api-ldap-codec-standalone 6000-6999 ERR_06000_FAILED_TO_LOAD_DEFAULT_CODEC_FACTORY( "ERR_06000_FAILED_TO_LOAD_DEFAULT_CODEC_FACTORY" ), // api-ldap-extras-aci 7000-7999 ERR_07000_FILTER( "ERR_07000_FILTER" ), ERR_07001_NULL_IDENTIFICATION_TAG( "ERR_07001_NULL_IDENTIFICATION_TAG" ), ERR_07002_BAD_PRECENDENCE( "ERR_07002_BAD_PRECENDENCE" ), ERR_07003_NULL_AUTHENTICATION_LEVEL( "ERR_07003_NULL_AUTHENTICATION_LEVEL" ), ERR_07004_PARSER_FAILURE_ACI_ITEM( "ERR_07004_PARSER_FAILURE_ACI_ITEM" ), ERR_07005_MISSING_MANDATORY_ACIITEM( "ERR_07005_MISSING_MANDATORY_ACIITEM" ), ERR_07006_EXPECTING_INTEGER_TOKEN( "ERR_07006_EXPECTING_INTEGER_TOKEN" ), ERR_07007_DUPLICATED_PROTECTED_ITEM( "ERR_07007_DUPLICATED_PROTECTED_ITEM" ), ERR_07008_DN_PARSER_FAILED( "ERR_07008_DN_PARSER_FAILED" ), ERR_07009_FILTER_PARSER_FAILED( "ERR_07009_FILTER_PARSER_FAILED" ), ERR_07010_DUPLICATED_GRANT_AND_DENIAL( "ERR_07010_DUPLICATED_GRANT_AND_DENIAL" ), ERR_07011_DUPLICATED_USER_CLASSES( "ERR_07011_DUPLICATED_USER_CLASSES" ), ERR_07012_MISSING_MANDATORY_USER_PERMISSION( "ERR_07012_MISSING_MANDATORY_USER_PERMISSION" ), ERR_07013_UNKNOWN_GRANT_AND_DENIAL( "ERR_07013_UNKNOWN_GRANT_AND_DENIAL" ), ERR_07014_MISSING_GRANTS_AND_DENIALS_TOKEN( "ERR_07014_MISSING_GRANTS_AND_DENIALS_TOKEN" ), ERR_07015_MISSING_MANDATORY_SPACES( "ERR_07015_MISSING_MANDATORY_SPACES" ), ERR_07016_BAD_REFINEMENT( "ERR_07016_BAD_REFINEMENT" ), ERR_07017_BAD_SPECIFIC_EXCLUSION( "ERR_07017_BAD_SPECIFIC_EXCLUSION" ), ERR_07018_BAD_SUBTREE_SPECIFICATION( "ERR_07018_BAD_SUBTREE_SPECIFICATION" ), ERR_07019_SUBTREE_SPECIFICATION_BASE_SEEN( "ERR_07019_SUBTREE_SPECIFICATION_BASE_SEEN" ), ERR_07020_SUBTREE_SPECIFICATION_MINIMUM_SEEN( "ERR_07020_SUBTREE_SPECIFICATION_MINIMUM_SEEN" ), ERR_07021_SUBTREE_SPECIFICATION_MAXIMUM_SEEN( "ERR_07021_SUBTREE_SPECIFICATION_MAXIMUM_SEEN" ), ERR_07022_SUBTREE_SPECIFICATION_EXCLUSIONS_SEEN( "ERR_07022_SUBTREE_SPECIFICATION_EXCLUSIONS_SEEN" ), ERR_07023_MAX_COUNT_TOKEN_EXPECTED( "ERR_07023_MAX_COUNT_TOKEN_EXPECTED" ), ERR_07024_MAX_COUNT_MISSING_ATTRIBUTE_TYPE("ERR_07024_MAX_COUNT_MISSING_ATTRIBUTE_TYPE" ), ERR_07025_EXPECTED_MAX_COUNT_OR_TYPE( "ERR_07025_EXPECTED_MAX_COUNT_OR_TYPE" ), ERR_07026_TYPE_TOKEN_EXPECTED( "ERR_07026_TYPE_TOKEN_EXPECTED" ), ERR_07027_VALUES_IN_TOKEN_EXPECTED( "ERR_07027_VALUES_IN_TOKEN_EXPECTED" ), ERR_07028_TYPE_INVALID_ATTRIBUTE( "ERR_07028_TYPE_INVALID_ATTRIBUTE" ), ERR_07029_VALUES_IN_INVALID_ATTRIBUTE( "ERR_07029_VALUES_IN_INVALID_ATTRIBUTE" ), ERR_07030_EXPECTED_VALUES_IN_OR_TYPE( "ERR_07030_EXPECTED_VALUES_IN_OR_TYPE" ), ERR_07031_MISSING_ITEM_PERMISSIONS_TOKEN( "ERR_07031_MISSING_ITEM_PERMISSIONS_TOKEN" ), ERR_07032_MISSING_USER_PERMISSIONS_TOKEN( "ERR_07032_MISSING_USER_PERMISSIONS_TOKEN" ), ERR_07033_UNKNOWN_PROTECTED_ITEM( "ERR_07033_UNKNOWN_PROTECTED_ITEM" ), ERR_07034_MISSING_EXPECTED_CLOSING_CURLY( "ERR_07034_MISSING_EXPECTED_CLOSING_CURLY" ), ERR_07035_MISSING_GRANTS_AND_DENIALS( "ERR_07035_MISSING_GRANTS_AND_DENIALS" ), ERR_07036_MISSING_PROTECTED_ITEMS( "ERR_07036_MISSING_PROTECTED_ITEMS" ), ERR_07037_BAD_USER_CLASS( "ERR_07037_BAD_USER_CLASS" ), ERR_07038_MISSING_IDENTIFIER_TAG( "ERR_07038_MISSING_IDENTIFIER_TAG" ), ERR_07039_MISSING_PRECEDENCE( "ERR_07039_MISSING_PRECEDENCE" ), ERR_07040_MISSING_AUTHENTICATION_LEVEL( "ERR_07040_MISSING_AUTHENTICATION_LEVEL" ), ERR_07041_WRONG_AUTHENTICATION_LEVEL( "ERR_07041_WRONG_AUTHENTICATION_LEVEL" ), ERR_07042_MISSING_PROTECTED_ITEMS_TOKEN( "ERR_07042_MISSING_PROTECTED_ITEMS_TOKEN" ), ERR_07043_MISSING_ITEM_FIRST_RIGHT_CURLY( "ERR_07043_MISSING_ITEM_FIRST_RIGHT_CURLY" ), ERR_07044_MISSING_USER_FIRST_RIGHT_CURLY( "ERR_07044_MISSING_USER_FIRST_RIGHT_CURLY" ), ERR_07045_BAD_ATTRIBUTE_TYPE( "ERR_07045_BAD_ATTRIBUTE_TYPE" ), ERR_07046_BAD_ATTRIBUTE_TYPE_OR_VALUE( "ERR_07046_BAD_ATTRIBUTE_TYPE_OR_VALUE" ), ERR_07047_MISSING_USER_CLASSES_TOKEN( "ERR_07047_MISSING_USER_CLASSES_TOKEN" ), ERR_07048_IDENTIFICATION_TAG_ALREADY_SEEN( "ERR_07048_IDENTIFICATION_TAG_ALREADY_SEEN" ), ERR_07049_PRECEDENCE_ALREADY_SEEN( "ERR_07049_PRECEDENCE_ALREADY_SEEN" ), ERR_07050_AUTHENTICATION_LEVEL_ALREADY_SEEN( "ERR_07050_AUTHENTICATION_LEVEL_ALREADY_SEEN" ), ERR_07051_ITEM_OR_USER_FIRST_ALREADY_SEEN( "ERR_07051_ITEM_OR_USER_FIRST_ALREADY_SEEN" ), ERR_07052_UNKNOWN_ACIITEM_PART( "ERR_07052_UNKNOWN_ACIITEM_PART" ), ERR_07053_MISSING_ITEM_OR_USER_FIRST( "ERR_07053_MISSING_ITEM_OR_USER_FIRST" ), ERR_07054_MISSING_PROTECTED_ITEMS( "ERR_07054_MISSING_PROTECTED_ITEMS" ), ERR_07055_PROTECTED_ITEMS_ALREADY_SEEN( "ERR_07055_PROTECTED_ITEMS_ALREADY_SEEN" ), ERR_07056_GRANTS_AND_DENIALS_ALREADY_SEEN( "ERR_07056_GRANTS_AND_DENIALS_ALREADY_SEEN" ), ERR_07057_USER_CLASSES_ALREADY_SEEN( "ERR_07057_USER_CLASSES_ALREADY_SEEN" ), ERR_07058_REFINEMENT_NESTING_TOO_DEEP( "ERR_07058_REFINEMENT_NESTING_TOO_DEEP" ), // api-ldap-extras-codec 8000-8999 // <> 8000-8099 ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER( "ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER" ), ERR_08001_CANNOT_DECODE_REFRESH_DELETES( "ERR_08001_CANNOT_DECODE_REFRESH_DELETES" ), ERR_08002_CANNOT_FIND_CONTROL_FACTORY( "ERR_08002_CANNOT_FIND_CONTROL_FACTORY" ), // controls 8100-8199 ERR_08100_SYNC_REQUEST_VALUE_MODE_DECODING_FAILED( "ERR_08100_SYNC_REQUEST_VALUE_MODE_DECODING_FAILED" ), ERR_08101_RELOAD_HINT_DECODING_FAILED( "ERR_08101_RELOAD_HINT_DECODING_FAILED" ), ERR_08102_SYNC_STATE_VALUE_MODE_DECODING_FAILED( "ERR_08102_SYNC_STATE_VALUE_MODE_DECODING_FAILED" ), ERR_08103_BAD_CONTROL_CRITICALITY( "ERR_08103_BAD_CONTROL_CRITICALITY" ), ERR_08104_AD_DIR_SYNC_FLAG_DECODING_FAILURE( "ERR_08104_AD_DIR_SYNC_FLAG_DECODING_FAILURE" ), ERR_08105_AD_DIR_SYNC_FLAG_DECODING_ERROR( "ERR_08105_AD_DIR_SYNC_FLAG_DECODING_ERROR" ), ERR_08106_AD_DIR_SYNC_MAX_RETURN_LENGTH_DECODING_ERROR( "ERR_08106_AD_DIR_SYNC_MAX_RETURN_LENGTH_DECODING_ERROR" ), ERR_08107_AD_DIR_SYNC_PARENTS_FIRST_DECODING_ERROR( "ERR_08107_AD_DIR_SYNC_PARENTS_FIRST_DECODING_ERROR" ), ERR_08108_AD_DIR_SYNC_MAX_ATTRIBUTE_COUNT_DECODING_ERROR( "ERR_08107_AD_DIR_SYNC_MAX_ATTRIBUTE_COUNT_DECODING_ERROR" ), ERR_08109_BAD_CONTROL_VALUE( "ERR_08109_BAD_CONTROL_VALUE" ), ERR_08110_BAD_PASSWORD_EXPIRED_VALUE( "ERR_08110_BAD_PASSWORD_EXPIRED_VALUE" ), // extended 8200-8399 ERR_08200_CANCELID_DECODING_FAILED( "ERR_08200_CANCELID_DECODING_FAILED" ), ERR_08201_INVALID_TARGET_DN( "ERR_08201_INVALID_TARGET_DN" ), ERR_08202_NULL_TARGET_DN_DECODING_FAILED( "ERR_08202_NULL_TARGET_DN_DECODING_FAILED" ), ERR_08203_INVALID_ISSUER_DN( "ERR_08203_INVALID_ISSUER_DN" ), ERR_08204_INVALID_SUBJECT_DN( "ERR_08204_INVALID_SUBJECT_DN" ), ERR_08205_CANNOT_DECODE_DELAY( "ERR_08205_CANNOT_DECODE_DELAY" ), ERR_08206_TIME_OFFLINE_DECODING_FAILED( "ERR_08206_TIME_OFFLINE_DECODING_FAILED" ), ERR_08207_SP_LANGUAGE_NULL( "ERR_08207_SP_LANGUAGE_NULL" ), ERR_08208_NULL_PROCEDURE( "ERR_08208_NULL_PROCEDURE" ), ERR_08209_NULL_PARAMETER_TYPE( "ERR_08209_NULL_PARAMETER_TYPE" ), ERR_08210_NULL_PARAMETER_VALUE( "ERR_08210_NULL_PARAMETER_VALUE" ), ERR_08211_EMPTY_PARAMETER_VALUE( "ERR_08211_EMPTY_PARAMETER_VALUE" ), ERR_08212_PDU_BUFFER_TOO_SMALL( "ERR_08212_PDU_BUFFER_TOO_SMALL" ), ERR_08213_NULL_CONTROL_LENGTH( "ERR_08213_NULL_CONTROL_LENGTH" ), ERR_08214_NULL_OID( "ERR_08214_NULL_OID" ), ERR_08215_INVALID_CONTROL_OID( "ERR_08215_INVALID_CONTROL_OID" ), ERR_08216_GRACEFUL_SHUTDOWN_PAYLOAD_ENCODING_FAILED( "ERR_08216_GRACEFUL_SHUTDOWN_PAYLOAD_ENCODING_FAILED" ), ERR_08217_PAYLOAD_DECODING_ERROR( "ERR_08217_PAYLOAD_DECODING_ERROR" ), ERR_08218_CERT_GENERATE_PAYLOAD_ENCODING_FAILED( "ERR_08218_CERT_GENERATE_PAYLOAD_ENCODING_FAILED" ), ERR_08219_RESPONSE_DECODING_FAILED( "ERR_08219_RESPONSE_DECODING_FAILED" ), ERR_08220_SP_PAYLOAD_ENCODING_FAILED( "ERR_08220_SP_PAYLOAD_ENCODING_FAILED" ), ERR_08221_BAD_END_TRANSACTION_COMMIT( "ERR_08221_BAD_END_TRANSACTION_COMMIT" ), ERR_08222_BAD_END_TRANSACTION_MESSAGE_ID( "ERR_08222_BAD_END_TRANSACTION_MESSAGE_ID" ), ERR_08223_INVALID_CONTROL_LIST( "ERR_08223_INVALID_CONTROL_LIST" ), ERR_08224_NULL_URL_DECODING_FAILURE( "ERR_08224_NULL_URL_DECODING_FAILURE" ), ERR_08225_URL_DECODING_FAILURE( "ERR_08225_URL_DECODING_FAILURE" ), ERR_08226_AUTHZID_TOO_SHORT_MISSING_U_OR_DN( "ERR_08226_AUTHZID_TOO_SHORT_MISSING_U_OR_DN" ), ERR_08227_AUTHZID_MUST_START_WITH_U_OR_DN( "ERR_08227_AUTHZID_MUST_START_WITH_U_OR_DN" ), ERR_08228_DECORATED_SP_NULL( "ERR_08228_DECORATED_SP_NULL" ), ERR_08229_UNEXPECTED_SYNC_INFO( "ERR_08229_UNEXPECTED_SYNC_INFO" ), ERR_08230_WHOAMI_PAYLOAD_ENCODING_FAILED( "ERR_08230_WHOAMI_PAYLOAD_ENCODING_FAILED" ), ERR_08231_START_TRANSACTION_PAYLOAD_ENCODING_FAILED( "ERR_08231_START_TRANSACTION_PAYLOAD_ENCODING_FAILED" ), ERR_08232_END_TRANSACTION_PAYLOAD_ENCODING_FAILED( "ERR_08232_END_TRANSACTION_PAYLOAD_ENCODING_FAILED" ), // intermediate 8300-8399 ERR_08300_REFRESH_DONE_DECODING_FAILED( "ERR_08300_REFRESH_DONE_DECODING_FAILED" ), ERR_08301_REFRESH_DELETES_DECODING_FAILED( "ERR_08301_REFRESH_DELETES_DECODING_FAILED" ), ERR_08302_BAD_UUID_VALUE_INCORRECT_LENGTH( "ERR_08302_BAD_UUID_VALUE_INCORRECT_LENGTH" ), // api-ldap-extras-codec-api 9000-9999 // <> 9000 - 9099 // controls 9100 - 9199 ERR_9100_UNKNOWN_PASSWORD_POLICY_ERROR( "ERR_9100_UNKNOWN_PASSWORD_POLICY_ERROR" ), ERR_9101_UNKNOWN_MODIFY_DN_OP_TYPE( "ERR_9101_UNKNOWN_MODIFY_DN_OP_TYPE" ), ERR_9102_UNKNOWN_VLV_RESPONSE( "ERR_9102_UNKNOWN_VLV_RESPONSE" ), ERR_9103_UNKNOWN_SYNC_STATE_TYPE( "ERR_9103_UNKNOWN_SYNC_STATE_TYPE" ), ERR_9104_CLASS_LOADING_OF_PROC_TYPE_NOT_IMPLEMENTED( "ERR_9104_CLASS_LOADING_OF_PROC_TYPE_NOT_IMPLEMENTED" ), ERR_9105_CONVERSION_VALUE_TO_JAVA_NOT_IMPLEMENTED( "ERR_9105_CONVERSION_VALUE_TO_JAVA_NOT_IMPLEMENTED" ), // extended 9200 - 9299 ERR_9200_INTERGER_DECODING_FAILURE( "ERR_9200_INTERGER_DECODING_FAILURE" ), // intermediate 9300 - 9399 ERR_9300_UNEXPECTED_SYNCINFO( "ERR_9300_UNEXPECTED_SYNCINFO" ), // api-ldap-extras-sp 10000-10999 ERR_10000_EMPTY_SP_CLASS( "ERR_10000_EMPTY_SP_CLASS" ), ERR_10001_SP_RESULT_CLASS_NOT_ALLOWED( "ERR_10001_SP_RESULT_CLASS_NOT_ALLOWED" ), // api-ldap-extras-trigger 11000-11999 ERR_11000_TRIGGER_SPECIFICATION_INIT_WITH_NULL( "ERR_11000_TRIGGER_SPECIFICATION_INIT_WITH_NULL" ), ERR_11001_TRIGGER_SPECIFICATION_INIT_WITH_EPTY_SPEC_LIST( "ERR_11001_TRIGGER_SPECIFICATION_INIT_WITH_EPTY_SPEC_LIST" ), ERR_11002_TRIGGER_SPECIFICATION_PARSER_FAILURE( "ERR_11002_TRIGGER_SPECIFICATION_PARSER_FAILURE" ), ERR_11003_NAME_PARSE_FAILED( "ERR_11003_NAME_PARSE_FAILED" ), ERR_11004_MISSING_MANDATORY_SPACE( "ERR_11004_MISSING_MANDATORY_SPACE" ), ERR_11005_UNKNOW_TRIGGER_OPERATION( "ERR_11005_UNKNOW_TRIGGER_OPERATION" ), ERR_11006_MISSING_CALL_TOKEN( "ERR_11006_MISSING_CALL_TOKEN" ), ERR_11007_MUST_HAVE_SCOPE_VALUE( "ERR_11007_MUST_HAVE_SCOPE_VALUE" ), ERR_11008_INVALID_DN( "ERR_11008_INVALID_DN" ), ERR_11009_MISSING_AFTER( "ERR_11009_MISSING_AFTER" ), ERR_11010_MISSING_MODIFY_DN_OPERATION( "ERR_11010_MISSING_MODIFY_DN_OPERATION" ), // api-ldap-extra-utils 12000-12999 ERR_12000_CANNOT_PROCESS_EMPTY_DN( "ERR_12000_CANNOT_PROCESS_EMPTY_DN" ), ERR_12001_CANNOT_ADD_NODE_CHILD_EXISTS( "ERR_12001_CANNOT_ADD_NODE_CHILD_EXISTS" ), ERR_12002_CANNOT_ADD_NODE_ALREADY_EXISTS( "ERR_12002_CANNOT_ADD_NODE_ALREADY_EXISTS" ), // api-ldap-model 13000 - 13999 ERR_13000_INVALID_LENGTH( "ERR_13000_INVALID_LENGTH" ), ERR_13001_INVALID_MAXOLEN( "ERR_13001_INVALID_MAXOLEN" ), ERR_13002_BAD_NUMBERS_OF_ROUNDS( "ERR_13002_BAD_NUMBERS_OF_ROUNDS" ), ERR_13003_BAD_SALT_LENGTH( "ERR_13003_BAD_SALT_LENGTH" ), ERR_13004_INVALID_SALT_VERSION( "ERR_13004_INVALID_SALT_VERSION" ), ERR_13005_INVALID_SALT_REVISION( "ERR_13005_INVALID_SALT_REVISION" ), ERR_13006_MISSING_SALT_ROUNDS( "ERR_13006_MISSING_SALT_ROUNDS" ), ERR_13008_ROUNDS_EXCEEDED_MAXIMUM( "ERR_13008_ROUNDS_EXCEEDED_MAXIMUM" ), ERR_13009_LOG_ROUNDS_EXCEEDED_MAXIMUM( "ERR_13009_LOG_ROUNDS_EXCEEDED_MAXIMUM" ), ERR_13010_UNKNOWN_HASH_ALGO( "ERR_13010_UNKNOWN_HASH_ALGO" ), ERR_13011_ATTRIBUTE_INVALID( "ERR_13011_ATTRIBUTE_INVALID" ), ERR_13012_UNEXPECTED_HOST_TYPE_ENUM( "ERR_13012_UNEXPECTED_HOST_TYPE_ENUM" ), ERR_13013_UNKNOWN_AUTHENT_LEVEL( "ERR_13013_UNKNOWN_AUTHENT_LEVEL" ), ERR_13014_DN_ATTR_FLAG_INVALID( "ERR_13014_DN_ATTR_FLAG_INVALID" ), ERR_13015_NULL_OR_EMPTY_CSN( "ERR_13015_NULL_OR_EMPTY_CSN" ), ERR_13016_INCORRECT_CSN_LENGTH( "ERR_13016_INCORRECT_CSN_LENGTH" ), ERR_13017_CANT_FIND_SHARP_IN_CSN( "ERR_13017_CANT_FIND_SHARP_IN_CSN" ), ERR_13018_TIMESTAMP_NOT_LONG_ENOUGH( "ERR_13018_TIMESTAMP_NOT_LONG_ENOUGH" ), ERR_13019_CANNOT_PARSE_TIMESTAMP( "ERR_13019_CANNOT_PARSE_TIMESTAMP" ), ERR_13020_INVALID_MICROSECOND( "ERR_13020_INVALID_MICROSECOND" ), ERR_13021_INVALID_CHANGE_COUNT( "ERR_13021_INVALID_CHANGE_COUNT" ), ERR_13022_MISSING_SHARP_IN_CSN( "ERR_13022_MISSING_SHARP_IN_CSN" ), ERR_13023_REPLICA_ID_NULL( "ERR_13023_REPLICA_ID_NULL" ), ERR_13024_INVALID_REPLICA_ID( "ERR_13024_INVALID_REPLICA_ID" ), ERR_13025_NO_OPERATION_NUMBER( "ERR_13025_NO_OPERATION_NUMBER" ), ERR_13026_INVALID_OPERATION_NUMBER( "ERR_13026_INVALID_OPERATION_NUMBER" ), ERR_13027_UNACCEPTABLE_RESULT_CODE( "ERR_13027_UNACCEPTABLE_RESULT_CODE" ), ERR_13028_SUBTREE_SPEC_PARSER_FAILURE( "ERR_13028_SUBTREE_SPEC_PARSER_FAILURE" ), ERR_13029_NEGATIVE_MINIMUM_BASE( "ERR_13029_NEGATIVE_MINIMUM_BASE" ), ERR_13030_LDAP_URL_MUST_START_WITH_LDAP( "ERR_13030_LDAP_URL_MUST_START_WITH_LDAP" ), ERR_13031_INVALID_HOST_PORT( "ERR_13031_INVALID_HOST_PORT" ), ERR_13032_SLASH_EXPECTED( "ERR_13032_SLASH_EXPECTED" ), ERR_13033_INVALID_DN( "ERR_13033_INVALID_DN" ), ERR_13034_QUESTION_MARK_EXPECTED( "ERR_13034_QUESTION_MARK_EXPECTED" ), ERR_13035_INVALID_ATTRIBUTES( "ERR_13035_INVALID_ATTRIBUTES" ), ERR_13036_INVALID_SCOPE( "ERR_13036_INVALID_SCOPE" ), ERR_13037_INVALID_FILTER( "ERR_13037_INVALID_FILTER" ), ERR_13038_INVALID_EXTENSIONS( "ERR_13038_INVALID_EXTENSIONS" ), ERR_13039_INVALID_CHAR_AT_LDAP_URL_END( "ERR_13039_INVALID_CHAR_AT_LDAP_URL_END" ), ERR_13040_INVALID_URL_ENCODING( "ERR_13040_INVALID_URL_ENCODING" ), ERR_13041_INVALID_LDAP_URL_EMPTY_STRING( "ERR_13041_INVALID_LDAP_URL_EMPTY_STRING" ), // cursor 13100 - 13199 ERR_13100_FAILURE_ON_UNDERLYING_CURSOR( "ERR_13100_FAILURE_ON_UNDERLYING_CURSOR" ), ERR_13101_MONITOR( "ERR_13101_MONITOR" ), ERR_13102_UNSUPPORTED_OPERATION( "ERR_13102_UNSUPPORTED_OPERATION" ), ERR_13103_REMOVAL_NOT_SUPPORTED( "ERR_13103_REMOVAL_NOT_SUPPORTED" ), ERR_13104_EMPTY_CURSOR( "ERR_13104_EMPTY_CURSOR" ), ERR_13105_START_INDEX_OUT_OF_RANGE( "ERR_13105_START_INDEX_OUT_OF_RANGE" ), ERR_13106_END_INDEX_OUT_OF_RANGE( "ERR_13106_END_INDEX_OUT_OF_RANGE" ), ERR_13107_START_INDEX_ABOVE_END_INDEX( "ERR_13107_START_INDEX_ABOVE_END_INDEX" ), ERR_13108_LIST_MAY_BE_SORTED( "ERR_13108_LIST_MAY_BE_SORTED" ), ERR_13109_CURSOR_NOT_POSITIONED( "ERR_13109_CURSOR_NOT_POSITIONED" ), ERR_13110_NO_COMPARATOR_CANT_MOVE_BEFORE( "ERR_13110_NO_COMPARATOR_CANT_MOVE_BEFORE" ), ERR_13111_NO_COMPARATOR_CANT_MOVE_AFTER( "ERR_13111_NO_COMPARATOR_CANT_MOVE_AFTER" ), ERR_13112_CANNOT_ACCESS_IF_BEFORE_FIRST( "ERR_13112_CANNOT_ACCESS_IF_BEFORE_FIRST" ), ERR_13113_CANNOT_ACCESS_IF_AFTER_LAST( "ERR_13113_CANNOT_ACCESS_IF_AFTER_LAST" ), // entry 13200 - 13299 ERR_13200_VALUE_CANT_BE_NORMALIZED( "ERR_13200_VALUE_CANT_BE_NORMALIZED" ), ERR_13201_EMPTY_OPTION_NOT_ALLOWED( "ERR_13201_EMPTY_OPTION_NOT_ALLOWED" ), ERR_13202_INVALID_OID_MISSING_NUMBER( "ERR_13202_INVALID_OID_MISSING_NUMBER" ), ERR_13203_ATTRIBUTE_TYPE_NULL_NOT_ALLOWED( "ERR_13203_ATTRIBUTE_TYPE_NULL_NOT_ALLOWED" ), ERR_13204_NULL_ATTRIBUTE_ID( "ERR_13204_NULL_ATTRIBUTE_ID" ), ERR_13205_CANNOT_REMOVE_VAL_MISSING_ATTR( "ERR_13205_CANNOT_REMOVE_VAL_MISSING_ATTR" ), ERR_13206_CANNOT_REMOVE_VAL_BAD_ATTR( "ERR_13206_CANNOT_REMOVE_VAL_BAD_ATTR" ), ERR_13207_VALUE_ALREADY_EXISTS( "ERR_13207_VALUE_ALREADY_EXISTS" ), ERR_13208_ATTRIBUTE_IS_SINGLE_VALUED( "ERR_13208_ATTRIBUTE_IS_SINGLE_VALUED" ), ERR_13209_NULL_ATTRIBUTE_TYPE( "ERR_013209_NULL_ATTRIBUTE_TYPE" ), ERR_13210_SYNTAX_INVALID( "ERR_13210_SYNTAX_INVALID" ), ERR_13211_BYTE_VALUE_EXPECTED( "ERR_13211_BYTE_VALUE_EXPECTED" ), ERR_13212_ERROR_ADDING_VALUE( "ERR_13212_ERROR_ADDING_VALUE" ), ERR_13213_VALUE_MUST_BE_A_STRING( "ERR_13213_VALUE_MUST_BE_A_STRING" ), ERR_13214_VALUE_EXPECT_BYTES( "ERR_13214_VALUE_EXPECT_BYTES" ), ERR_13215_VALUE_EXPECT_STRING( "ERR_13215_VALUE_EXPECT_STRING" ), ERR_13216_AT_ID_NULL( "ERR_13216_AT_ID_NULL" ), ERR_13217_FAILED_LOOKUP_AT( "ERR_13217_FAILED_LOOKUP_AT" ), ERR_13218_AT_DOES_NOT_EXIST( "ERR_13218_AT_DOES_NOT_EXIST" ), ERR_13219_NULL_SYNTAX_CHECKER( "ERR_13219_NULL_SYNTAX_CHECKER" ), ERR_13220_NO_NORMALIZER( "ERR_13220_NO_NORMALIZER" ), ERR_13221_INVALID_OID_MISSING_DOT( "ERR_13221_INVALID_OID_MISSING_DOT" ), ERR_13222_EMPTY_ATTRIBUTE( "ERR_13222_EMPTY_ATTRIBUTE" ), ERR_13223_BAD_CHAR_IN_ATTRIBUTE( "ERR_13223_BAD_CHAR_IN_ATTRIBUTE" ), ERR_13224_FAILED_TO_COMPARE_NORM_VALUES( "ERR_13224_FAILED_TO_COMPARE_NORM_VALUES" ), ERR_13225_NO_SYNTAX( "ERR_13225_NO_SYNTAX" ), ERR_13226_CANNOT_ADD_ATTRIBUTE_NO_ID( "ERR_13226_CANNOT_ADD_ATTRIBUTE_NO_ID" ), ERR_13227_NON_STRING_VALUE_NOT_ALLOWED( "ERR_13227_NON_STRING_VALUE_NOT_ALLOWED" ), ERR_13228_AT_LIST_NULL_ELEMENTS( "ERR_13228_AT_LIST_NULL_ELEMENTS" ), ERR_13229_ID_INCOMPATIBLE_WITH_AT( "ERR_13229_ID_INCOMPATIBLE_WITH_AT" ), ERR_13230_INCORRECT_ATTRIBUTE( "ERR_13230_INCORRECT_ATTRIBUTE" ), ERR_13231_NO_VALID_AT_FOR_THIS_ID( "ERR_13231_NO_VALID_AT_FOR_THIS_ID" ), ERR_13232_NO_VALUE_NOT_ALLOWED( "ERR_13232_NO_VALUE_NOT_ALLOWED" ), ERR_13233_ATTRIBUTE_ID_MUST_BE_A_STRING( "ERR_13233_ATTRIBUTE_ID_MUST_BE_A_STRING" ), ERR_13234_ATTRIBUTE_VAL_STRING_OR_BYTE( "ERR_13234_ATTRIBUTE_VAL_STRING_OR_BYTE" ), ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED( "ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED" ), ERR_13236_ENTRY_IMMUTABLE_CANT_ADD_ATTRIBUTE( "ERR_13236_ENTRY_IMMUTABLE_CANT_ADD_ATTRIBUTE" ), ERR_13237_ENTRY_IMMUTABLE_CANT_PUT_VALUE( "ERR_13237_ENTRY_IMMUTABLE_CANT_PUT_VALUE" ), ERR_13238_ENTRY_IMMUTABLE_CANT_REMOVE_VALUE( "ERR_13238_ENTRY_IMMUTABLE_CANT_REMOVE_VALUE" ), ERR_13239_ENTRY_IMMUTABLE_CANT_RENAME_ENTRY( "ERR_13239_ENTRY_IMMUTABLE_CANT_RENAME_ENTRY" ), ERR_13240_ENTRY_IMMUTABLE_CANT_CLEAR_ENTRY( "ERR_13240_ENTRY_IMMUTABLE_CANT_CLEAR_ENTRY" ), ERR_13241_ENTRY_IMMUTABLE_CANT_READ_ENTRY( "ERR_13241_ENTRY_IMMUTABLE_CANT_READ_ENTRY" ), ERR_13242_ENTRY_IMMUTABLE_CANT_SERIALIZE( "ERR_13242_ENTRY_IMMUTABLE_CANT_SERIALIZE" ), ERR_13243_ENTRY_IMMUTABLE_CANT_DESERIALIZE( "ERR_13243_ENTRY_IMMUTABLE_CANT_DESERIALIZE" ), ERR_13244_ID_AT_NOT_COMPATIBLE( "ERR_13244_ID_AT_NOT_COMPATIBLE" ), ERR_13245_AT_PARAMETER_NULL( "ERR_13245_AT_PARAMETER_NULL" ), ERR_13246_INVALID_VALUE_PER_SYNTAX( "ERR_13246_INVALID_VALUE_PER_SYNTAX" ), ERR_13247_INVALID_VALUE_CANT_NORMALIZE( "ERR_13247_INVALID_VALUE_CANT_NORMALIZE" ), ERR_13248_CANNOT_READ_ENTRY( "ERR_13248_CANNOT_READ_ENTRY" ), ERR_13249_NO_COMPARATOR_FOR_AT( "ERR_13249_NO_COMPARATOR_FOR_AT" ), ERR_13250_VALUE_MISSING_AT_THE_END( "ERR_13250_VALUE_MISSING_AT_THE_END" ), ERR_13251_NEGATIVE_NB_ATTRIBUTES( "ERR_13251_NEGATIVE_NB_ATTRIBUTES" ), ERR_13252_NEGATIVE_NB_VALUES( "ERR_13252_NEGATIVE_NB_VALUES" ), ERR_13253_NEGATIVE_VALUE_LENGTH( "ERR_13253_NEGATIVE_VALUE_LENGTH" ), ERR_13254_INVALID_ATTRIBUTE_ID( "ERR_13254_INVALID_ATTRIBUTE_ID" ), // filter 13300 - 13399 ERR_13300_BAD_PLACE_HOLDERS_NUMBER( "ERR_13300_BAD_PLACE_HOLDERS_NUMBER" ), ERR_13301_NO_ORDERING_MR_FOR_AT( "ERR_13301_NO_ORDERING_MR_FOR_AT" ), ERR_13302_CANNOT_CREATE_NODE_NULL_ATTR( "ERR_13302_CANNOT_CREATE_NODE_NULL_ATTR" ), ERR_13303_SCOPENODE_IN_REFINEMENT( "ERR_13303_SCOPENODE_IN_REFINEMENT" ), ERR_13304_ASSERTIONNODE_IN_REFINEMENT( "ERR_13304_ASSERTIONNODE_IN_REFINEMENT" ), ERR_13305_ASSERTION_VALUE_EXPECTED( "ERR_13305_ASSERTION_VALUE_EXPECTED" ), ERR_13306_MR_OR_ASSERTION_VALUE_EXPECTED( "ERR_13306_MR_OR_ASSERTION_VALUE_EXPECTED" ), ERR_13307_MATCHING_RULE_EXPECTED( "ERR_13307_MATCHING_RULE_EXPECTED" ), ERR_13308_NOT_A_VALID_ESCAPED_VALUE( "ERR_13308_NOT_A_VALID_ESCAPED_VALUE" ), ERR_13309_BAD_SUBSTRING( "ERR_13309_BAD_SUBSTRING" ), ERR_13310_BAD_CHAR( "ERR_13310_BAD_CHAR" ), ERR_13311_EXPECTING_EQUAL( "ERR_13311_EXPECTING_EQUAL" ), ERR_13312_ITEM_EXPECTED( "ERR_13312_ITEM_EXPECTED" ), ERR_13313_EMPTY_FILTERCOMP( "ERR_13313_EMPTY_FILTERCOMP" ), ERR_13314_FILTER_MISSING_OPEN_PAR( "ERR_13315_FILTER_MISSING_OPEN_PAR" ), ERR_13315_FILTER_MISSING_CLOSE_PAR( "ERR_13315_FILTER_MISSING_CLOSE_PAR" ), ERR_13316_EMPTY_FILTER( "ERR_13316_EMPTY_FILTER" ), ERR_13317_NO_MORE_THAN_ONE_ELEM_IN_NOT( "ERR_13317_NO_MORE_THAN_ONE_ELEM_IN_NOT" ), ERR_13318_INVALID_ATTR_IN_REFINEMENT( "ERR_13318_INVALID_ATTR_IN_REFINEMENT" ), ERR_13319_MAX_FILTER_DEPTH_EXCEEDED( "ERR_13319_MAX_FILTER_DEPTH_EXCEEDED" ), // ldif 13400 - 13499 ERR_13400_ENTRY_WITH_TWO_DNS( "ERR_13400_ENTRY_WITH_TWO_DNS" ), ERR_13401_CHANGE_NOT_ALLOWED( "ERR_13401_CHANGE_NOT_ALLOWED" ), ERR_13402_EXPECTING_ATTRIBUTE_TYPE( "ERR_13402_EXPECTING_ATTRIBUTE_TYPE" ), ERR_13403_CANNOT_PARSE_LDIF_BUFFER( "ERR_13403_CANNOT_PARSE_LDIF_BUFFER" ), ERR_13404_EMPTY_DN_NOT_ALLOWED( "ERR_13404_EMPTY_DN_NOT_ALLOWED" ), ERR_13405_DN_EXPECTED( "ERR_13405_DN_EXPECTED" ), ERR_13406_FILE_NOT_FOUND( "ERR_13406_FILE_NOT_FOUND" ), ERR_13407_ERROR_READING_FILE( "ERR_13407_ERROR_READING_FILE" ), ERR_13408_BAD_PROTOCOL( "ERR_13408_BAD_PROTOCOL" ), ERR_13409_CONTROL_WITHOUT_OID( "ERR_13409_CONTROL_WITHOUT_OID" ), ERR_13410_INVALID_CRITICALITY( "ERR_13410_INVALID_CRITICALITY" ), ERR_13411_BAD_MODRDN_OPERATION( "ERR_13411_BAD_MODRDN_OPERATION" ), ERR_13412_NO_DELETEOLDRDN( "ERR_13412_NO_DELETEOLDRDN" ), ERR_13413_BAD_MODIFY_SEPARATOR( "ERR_13413_BAD_MODIFY_SEPARATOR" ), ERR_13414_BAD_MODIFY_SEPARATOR_2( "ERR_13414_BAD_MODIFY_SEPARATOR_2" ), ERR_13415_MOD_ATTR_AND_VALUE_SPEC_NOT_EQUAL( "ERR_13415_MOD_ATTR_AND_VALUE_SPEC_NOT_EQUAL" ), ERR_13416_NEW_SUPERIOR_NEEDED( "ERR_13416_NEW_SUPERIOR_NEEDED" ), ERR_13417_UNKNOWN_OPERATION( "ERR_13417_UNKNOWN_OPERATION" ), ERR_13418_CONTROL_ALREADY_FOUND( "ERR_13418_CONTROL_ALREADY_FOUND" ), ERR_13419_CHANGETYPE_ALREADY_FOUND( "ERR_13419_CHANGETYPE_ALREADY_FOUND" ), ERR_13420_AT_VALUE_NOT_ALLOWED_AFTER_CONTROL( "ERR_13420_AT_VALUE_NOT_ALLOWED_AFTER_CONTROL" ), ERR_13421_ATTRIBUTE_TYPE_EXPECTED( "ERR_13421_ATTRIBUTE_TYPE_EXPECTED" ), ERR_13422_UNKNOWN_ENTRY_TYPE( "ERR_13422_UNKNOWN_ENTRY_TYPE" ), ERR_13423_VERSION_NOT_A_NUMBER( "ERR_13423_VERSION_NOT_A_NUMBER" ), ERR_13424_EMPTY_CONTINUATION_LINE( "ERR_13424_EMPTY_CONTINUATION_LINE" ), ERR_13425_EMPTY_FILE_NAME( "ERR_13425_EMPTY_FILE_NAME" ), ERR_13426_CANNOT_PARSE_INEXISTANT_FILE( "ERR_13426_CANNOT_PARSE_INEXISTANT_FILE" ), ERR_13427_CANNOT_FIND_FILE( "ERR_13427_CANNOT_FIND_FILE" ), ERR_13428_CANNOT_PARSE_LDIF(" ERR_13428_CANNOT_PARSE_LDIF" ), ERR_13429_ERROR_PARSING_LDIF( "ERR_13429_ERROR_PARSING_LDIF" ), ERR_13430_PREMATURE_LDIF_ITERATOR_TERMINATION( "ERR_13430_PREMATURE_LDIF_ITERATOR_TERMINATION" ), ERR_13431_UNEXPECTED_CHANGETYPE( "ERR_13431_UNEXPECTED_CHANGETYPE" ), ERR_13432_NULL_ADDED_CONTROL( "ERR_13432_NULL_ADDED_CONTROL" ), ERR_13433_SEE_DIRSERVER_1547( "ERR_13433_SEE_DIRSERVER_1547" ), ERR_13434_UNEXPECTED_MOD_OPERATION( "ERR_13434_UNEXPECTED_MOD_OPERATION" ), ERR_13435_CANNOT_COMPUTE_NEW_VALUE( "ERR_13435_CANNOT_COMPUTE_NEW_VALUE" ), ERR_13436_ERROR_ANONYMIZING_VALUE( "ERR_13436_ERROR_ANONYMIZING_VALUE" ), ERR_13437_OVERFLOW( "ERR_13437_OVERFLOW" ), ERR_13438_UNKNOWN_CHANGE_TYPE( "ERR_13438_UNKNOWN_CHANGE_TYPE" ), ERR_13439_LDIF_ENTRY_WITH_TWO_DNS( "ERR_13439_LDIF_ENTRY_WITH_TWO_DNS" ), ERR_13440_NO_CHANGE( "ERR_13440_NO_CHANGE" ), ERR_13441_BAD_ATTRIBUTE( "ERR_13441_BAD_ATTRIBUTE" ), ERR_13442_ERROR_PARSING_LDIF_BUFFER( "ERR_13442_ERROR_PARSING_LDIF_BUFFER" ), ERR_13443_CANNOT_FIND_FILE( "ERR_13443_CANNOT_FIND_FILE" ), ERR_13444_CANNOT_READ_FILE( "ERR_13444_CANNOT_READ_FILE" ), ERR_13445_NO_DN( "ERR_13445_NO_DN" ), ERR_13446_INVALID_DN( "ERR_13446_INVALID_DN" ), ERR_13447_BAD_URL_FILE_NOT_FOUND( "ERR_13447_BAD_URL_FILE_NOT_FOUND" ), ERR_13448_FILE_TOO_BIG( "ERR_13448_FILE_TOO_BIG" ), ERR_13449_ERROR_READING_BAD_URL( "ERR_13449_ERROR_READING_BAD_URL" ), ERR_13450_CANNOT_CLOSE_FILE( "ERR_13450_CANNOT_CLOSE_FILE" ), ERR_13451_UNSUPPORTED_PROTOCOL( "ERR_13451_UNSUPPORTED_PROTOCOL" ), ERR_13452_BAD_URL( "ERR_13452_BAD_URL" ), ERR_13453_INVALID_OID( "ERR_13453_INVALID_OID" ), ERR_13454_BAD_MODIFY_ATTRIBUTE( "ERR_13454_BAD_MODIFY_ATTRIBUTE" ), ERR_13455_BAD_MODDN_NO_SUPERIOR( "ERR_13455_BAD_MODDN_NO_SUPERIOR" ), ERR_13456_BAD_OPERATION( "ERR_13456_BAD_OPERATION" ), ERR_13457_MISPLACED_CONTROL( "ERR_13457_MISPLACED_CONTROL" ), ERR_13458_MISPLACED_CHANGETYPE( "ERR_13458_MISPLACED_CHANGETYPE" ), ERR_13459_MISPLACED_ATTRIBUTETYPE( "ERR_13459_MISPLACED_ATTRIBUTETYPE" ), ERR_13460_BAD_ATTRIBUTE( "ERR_13460_BAD_ATTRIBUTE" ), ERR_13461_UNKNOWN_ENTRY( "ERR_13461_UNKNOWN_ENTRY" ), ERR_13462_LDIF_PARSING_ERROR( "ERR_13462_LDIF_PARSING_ERROR" ), ERR_13463_ERROR_WHILE_READING_LDIF_LINE( "ERR_13463_ERROR_WHILE_READING_LDIF_LINE" ), ERR_13464_FILENAME_NOT_FOUND( "ERR_13464_FILENAME_NOT_FOUND" ), ERR_13465_CANT_DEDUCE_REVERSE_FOR_MOD( "ERR_13465_CANT_DEDUCE_REVERSE_FOR_MOD" ), ERR_13466_NEW_SUPERIOR_DN_NULL( "ERR_13466_NEW_SUPERIOR_DN_NULL" ), ERR_13467_NULL_MODIFIED_DN( "ERR_13467_NULL_MODIFIED_DN" ), ERR_13468_DONT_MOVE_ROOTDSE( "ERR_13468_DONT_MOVE_ROOTDSE" ), ERR_13469_NULL_READ_DN( "ERR_13469_NULL_READ_DN" ), ERR_13470_DONT_RENAME_ROOTDSE( "ERR_13470_DONT_RENAME_ROOTDSE" ), ERR_13471_DELETED_ENTRY_WITH_ATTRIBUTES( "ERR_13471_DELETED_ENTRY_WITH_ATTRIBUTES" ), ERR_13472_ENTRY_WITH_NO_ATTRIBUTE( "ERR_13472_ENTRY_WITH_NO_ATTRIBUTE" ), ERR_13473_MODDN_WITH_ATTRIBUTES( "ERR_13473_MODDN_WITH_ATTRIBUTES" ), ERR_13474_LINE_LENGTH_TOO_SHORT( "ERR_13474_LINE_LENGTH_TOO_SHORT" ), ERR_13475_UNKNOWN_ATTRIBUTETYPE( "ERR_13475_UNKNOWN_ATTRIBUTETYPE" ), // message 13500 - 13599 ERR_13500_UNDEFINED_CHANGETYPE( "ERR_13500_UNDEFINED_CHANGETYPE" ), ERR_13501_UNKNOWN_JNDI_SCOPE( "ERR_13501_UNKNOWN_JNDI_SCOPE" ), ERR_13502_UNKNOWN_LDAP_URL_SCOPE( "ERR_13502_UNKNOWN_LDAP_URL_SCOPE" ), ERR_13503_RESULT_CODE_SHOULD_BE_IN( "ERR_13503_RESULT_CODE_SHOULD_BE_IN" ), ERR_13504_FIX_OID( "ERR_13504_FIX_OID" ), ERR_13505_HARDCODED_ZERO_LENGTH_RESPONSE( "ERR_13505_HARDCODED_ZERO_LENGTH_RESPONSE" ), ERR_13506_CANNOT_ABANDON_OPERATION( "ERR_13506_CANNOT_ABANDON_OPERATION" ), ERR_13507_UNRECOGNIZED_JNDI_PROPERTY_VALUE( "ERR_13507_UNRECOGNIZED_JNDI_PROPERTY_VALUE" ), ERR_13508_INVALID_FILTER( "ERR_13508_INVALID_FILTER" ), ERR_13509_UNEXPECTED_SCOPE( "ERR_13509_UNEXPECTED_SCOPE" ), ERR_13510_UNKNOWN_DEREF_MODE( "ERR_13510_UNKNOWN_DEREF_MODE" ), ERR_13511_INVALID_PROXIED_AUTHZ_NULL( "ERR_13511_INVALID_PROXIED_AUTHZ_NULL" ), ERR_13512_INVALID_PROXIED_AUTHZ_BAD_DN( "ERR_13512_INVALID_PROXIED_AUTHZ_BAD_DN" ), ERR_13513_INVALID_PROXIED_AUTHZ_NO_DN_OR_U( "ERR_13513_INVALID_PROXIED_AUTHZ_NO_DN_OR_U" ), ERR_13514_UNKNOWN_SORT_RESPONSE_RESULT( "ERR_13514_UNKNOWN_SORT_RESPONSE_RESULT" ), ERR_13515_UNEXPECTED_MOD_OP( "ERR_13515_UNEXPECTED_MOD_OP" ), ERR_13516_UNEXPECTED_MESSAGE_TYPE( "ERR_13516_UNEXPECTED_MESSAGE_TYPE" ), ERR_13517_UNEXPECTED_ALIAS_DEREF_MODE( "ERR_13517_UNEXPECTED_ALIAS_DEREF_MODE" ), ERR_13518_CLASS_INVALID_ENULM_VALUE( "ERR_13518_CLASS_INVALID_ENULM_VALUE" ), // name 13600 - 13699 ERR_13600_TYPE_IS_NULL_OR_EMPTY( "ERR_13600_TYPE_IS_NULL_OR_EMPTY" ), ERR_13601_EXPECTED_COMMA_SEMI_COLON( "ERR_13601_EXPECTED_COMMA_SEMI_COLON" ), ERR_13602_RDN_EMPTY( "ERR_13602_RDN_EMPTY" ), ERR_13603_NULL_RDN( "ERR_13603_NULL_RDN" ), ERR_13604_START_AT_EXPECTED( "ERR_13604_START_AT_EXPECTED" ), ERR_13605_START_AT_DESCR_EXPECTED( "ERR_13605_START_AT_DESCR_EXPECTED" ), ERR_13606_EXPECTED_NUMERICOID( "ERR_13606_EXPECTED_NUMERICOID" ), ERR_13607_DOT_MISSING_IN_OID( "ERR_13607_DOT_MISSING_IN_OID" ), ERR_13608_START_AT_NUMERICOID_EXPECTED( "ERR_13608_START_AT_NUMERICOID_EXPECTED" ), ERR_13609_EQUAL_EXPECTED( "ERR_13609_EQUAL_EXPECTED" ), ERR_13610_NO_MORE_CHAR_AVAILABLE( "ERR_13610_NO_MORE_CHAR_AVAILABLE" ), ERR_13611_VALUE_MISSING_ON_RDN( "ERR_13611_VALUE_MISSING_ON_RDN" ), ERR_13612_POSITION_NOT_IN_RANGE( "ERR_13612_POSITION_NOT_IN_RANGE" ), ERR_13613_VALUE_NOT_IN_HEX_FORM_ODD_NUMBER( "ERR_13613_VALUE_NOT_IN_HEX_FORM_ODD_NUMBER" ), ERR_13614_VALUE_NOT_IN_HEX_FORM( "ERR_13614_VALUE_NOT_IN_HEX_FORM" ), ERR_13615_UNESCAPED_CHARS_NOT_ALLOWED( "ERR_13615_UNESCAPED_CHARS_NOT_ALLOWED" ), ERR_13616_CANNOT_SERIALIZE_AVA_UPNAME_NULL( "ERR_13616_CANNOT_SERIALIZE_AVA_UPNAME_NULL" ), ERR_13617_CANNOT_SERIALIZE_AVA_UPTYPE_NULL( "ERR_13617_CANNOT_SERIALIZE_AVA_UPTYPE_NULL" ), ERR_13618_CANNOT_SERIALIZE_AVA_NORMTYPE_NULL( "ERR_13618_CANNOT_SERIALIZE_AVA_NORMTYPE_NULL" ), ERR_13619_CANNOT_SERIALIZE_AVA_VALUE_NULL( "ERR_13619_CANNOT_SERIALIZE_AVA_VALUE_NULL" ), ERR_13620_CANNOT_NORMALIZE_VALUE( "ERR_13620_CANNOT_NORMALIZE_VALUE" ), ERR_13621_ASSERTION_FAILURE( "ERR_13621_ASSERTION_FAILURE" ), ERR_13622_DN_OR_RDN_NULL( "ERR_13622_DN_OR_RDN_NULL" ), ERR_13623_INVALID_POSITION( "ERR_13623_INVALID_POSITION" ), ERR_13624_CANNOT_SERIALIZE_NULL_DN( "ERR_13624_CANNOT_SERIALIZE_NULL_DN" ), ERR_13625_INVALID_RDN( "ERR_13625_INVALID_RDN" ), ERR_13626_INVALID_RDN_DUPLICATE_AVA( "ERR_13626_INVALID_RDN_DUPLICATE_AVA" ), ERR_13627_NEGATIVE_NUMBER_OF_RDNS( "ERR_13627_NEGATIVE_NUMBER_OF_RDNS" ), ERR_13628_NEGATIVE_NUMBER_OF_AVAS( "ERR_13628_NEGATIVE_NUMBER_OF_AVAS" ), ERR_13629_NO_ATTRIBUTE_TYPE( "ERR_13629_NO_ATTRIBUTE_TYPE" ), ERR_13630_BAD_OID_ATTRIBUTE_TYPE( "ERR_13630_BAD_OID_ATTRIBUTE_TYPE" ), ERR_13631_WRONG_ESCAPED_SEQUENCE( "ERR_13631_WRONG_ESCAPED_SEQUENCE" ), ERR_13632_WRONG_HEX_PAIR( "ERR_13632_WRONG_HEX_PAIR" ), ERR_13633_INVALID_UTFMB( "ERR_13633_INVALID_UTFMB" ), ERR_13634_INCOMPLETE_UTFMB( "ERR_13634_INCOMPLETE_UTFMB"), ERR_13635_INVALID_VALUE_CHARACTER( "ERR_13635_INVALID_VALUE_CHARACTER" ), ERR_13636_INVALID_END_ESCAPED_CHARACTER( "ERR_13636_INVALID_END_ESCAPED_CHARACTER" ), ERR_13637_LDAPV2_QUOTED_VALUE_NOT_ACCEPTED( "ERR_13637_LDAPV2_QUOTED_VALUE_NOT_ACCEPTED" ), ERR_13638_WRONG_ATTRIBUTE_TYPE( "ERR_13638_WRONG_ATTRIBUTE_TYPE" ), ERR_13639_UTILITY_CLASS_CANT_BE_INSTANCIATED( "ERR_13639_UTILITY_CLASS_CANT_BE_INSTANCIATED" ), // schema 13700 - 13899 ERR_13700_CANNOT_MODIFY_LOCKED_SCHEMA_OBJECT( "ERR_13700_CANNOT_MODIFY_LOCKED_SCHEMA_OBJECT" ), ERR_13701_CANNOT_MODIFY_AT_REGISTRY_COPY( "ERR_13701_CANNOT_MODIFY_AT_REGISTRY_COPY" ), ERR_13702_CANNOT_MODIFY_CMP_REGISTRY_COPY( "ERR_13702_CANNOT_MODIFY_CMP_REGISTRY_COPY" ), ERR_13703_CANNOT_MODIFY_DITCR_REGISTRY_COPY( "ERR_13703_CANNOT_MODIFY_DITCR_REGISTRY_COPY" ), ERR_13704_CANNOT_MODIFY_DITSR_REGISTRY_COPY( "ERR_13704_CANNOT_MODIFY_DITSR_REGISTRY_COPY" ), ERR_13705_CANNOT_MODIFY_SYN_REGISTRY_COPY( "ERR_13705_CANNOT_MODIFY_SYN_REGISTRY_COPY" ), ERR_13706_CANNOT_MODIFY_MR_REGISTRY_COPY( "ERR_13706_CANNOT_MODIFY_MR_REGISTRY_COPY" ), ERR_13707_CANNOT_MODIFY_MRU_REGISTRY_COPY( "ERR_13707_CANNOT_MODIFY_MRU_REGISTRY_COPY" ), ERR_13708_CANNOT_MODIFY_NF_REGISTRY_COPY( "ERR_13708_CANNOT_MODIFY_NF_REGISTRY_COPY" ), ERR_13709_CANNOT_MODIFY_NORM_REGISTRY_COPY( "ERR_13709_CANNOT_MODIFY_NORM_REGISTRY_COPY" ), ERR_13710_CANNOT_MODIFY_OC_REGISTRY_COPY( "ERR_13710_CANNOT_MODIFY_OC_REGISTRY_COPY" ), ERR_13711_CANNOT_MODIFY_SC_REGISTRY_COPY( "ERR_13711_CANNOT_MODIFY_SC_REGISTRY_COPY" ), ERR_13712_UNKNOWN_SCHEMA_OBJECT_TYPE( "ERR_13712_UNKNOWN_SCHEMA_OBJECT_TYPE" ), ERR_13713_ESCAPED_WRONG_VALUE( "ERR_13713_ESCAPED_WRONG_VALUE" ), ERR_13714_NULL( "ERR_13714_NULL" ), ERR_13715_OPENLDAP_PARSER_NON_STANDARD( "ERR_13715_OPENLDAP_PARSER_NON_STANDARD" ), ERR_13716_NULL_OR_EMPTY_STRING_SCHEMA_OBJECT( "ERR_13716_NULL_OR_EMPTY_STRING_SCHEMA_OBJECT" ), ERR_13717_UNEXPECTED_OBJECT_CLASS_TYPE_ENUM( "ERR_13717_UNEXPECTED_OBJECT_CLASS_TYPE_ENUM" ), ERR_13718_UNEXPECTED_SCHEMA_OBJECT_TYPE( "ERR_13718_UNEXPECTED_SCHEMA_OBJECT_TYPE" ), ERR_13719_LOOP_DETECTED( "ERR_13719_LOOP_DETECTED" ), ERR_13720_CANNOT_HANDLE_DN_COMPARISONS( "ERR_13720_CANNOT_HANDLE_DN_COMPARISONS" ), ERR_13721_ARGUMENT1_NULL( "ERR_13721_ARGUMENT1_NULL" ), ERR_13722_ARGUMENT2_NULL( "ERR_13722_ARGUMENT2_NULL" ), ERR_13723_MATCHING_RULE_NOT_FOUND( "ERR_13723_MATCHING_RULE_NOT_FOUND" ), ERR_13724_INVALID_VALUE( "ERR_13724_INVALID_VALUE" ), ERR_13725_CANNOT_HANDLE_NAME_AND_OPTIONAL_UID_NORM( "ERR_13725_CANNOT_HANDLE_NAME_AND_OPTIONAL_UID_NORM" ), ERR_13726_NO_OBJECT_IDENTIFIER_MACRO( "ERR_13726_NO_OBJECT_IDENTIFIER_MACRO" ), ERR_13727_ENTRY_CANNOT_BE_NULL( "ERR_13727_ENTRY_CANNOT_BE_NULL" ), ERR_13728_ENTRY_INVALID_CN( "ERR_13728_ENTRY_INVALID_CN" ), ERR_13729_RULE_ID_NOT_FOUND( "ERR_13729_RULE_ID_NOT_FOUND" ), ERR_13730_DIT_STRUCTURE_RULE_ALREADY_REGISTRED( "ERR_13730_DIT_STRUCTURE_RULE_ALREADY_REGISTRED" ), ERR_13731_DIT_STRUCTURE_RULE_DOES_NOT_EXIST( "ERR_13731_DIT_STRUCTURE_RULE_DOES_NOT_EXIST" ), ERR_13732_NAME_CANNOT_BE_NULL( "ERR_13732_NAME_CANNOT_BE_NULL" ), ERR_13733_ARG_NOT_NUMERIC_OID( "ERR_13733_ARG_NOT_NUMERIC_OID" ), ERR_13734_OID_NOT_FOUND( "ERR_13734_OID_NOT_FOUND" ), ERR_13735_ELEMENT_FOR_OID_DOES_NOT_EXIST( "ERR_13735_ELEMENT_FOR_OID_DOES_NOT_EXIST" ), ERR_13736_ELEMENT_FOR_OID_ALREADY_REGISTERED( "ERR_13736_ELEMENT_FOR_OID_ALREADY_REGISTERED" ), ERR_13737_ELEMENT_WITH_NAME_ALREADY_REGISTERED( "ERR_13737_ELEMENT_WITH_NAME_ALREADY_REGISTERED" ), ERR_13738_OID_NOT_A_NUMERIC_OID( "ERR_13738_OID_NOT_A_NUMERIC_OID" ), ERR_13739_ELEMENT_WITH_OID_NOT_REGISTERED( "ERR_13739_ELEMENT_WITH_OID_NOT_REGISTERED" ), ERR_13740_CANNOT_FIND_OID_FROM_NAME( "ERR_13740_CANNOT_FIND_OID_FROM_NAME" ), ERR_13741_OID_NOT_FOUND_IN_REGISTRY( "ERR_13741_OID_NOT_FOUND_IN_REGISTRY" ), ERR_13742_NO_SCHEMA_OBJECT_WITH_OID( "ERR_13742_NO_SCHEMA_OBJECT_WITH_OID" ), ERR_13743_CANNOT_REGISTER_NULL_SCHEMA_OBJECT( "ERR_13743_CANNOT_REGISTER_NULL_SCHEMA_OBJECT" ), ERR_13744_SCHEMA_OBJECT_HAS_NO_VALID_OID( "ERR_13744_SCHEMA_OBJECT_HAS_NO_VALID_OID" ), ERR_13745_SCHEMA_OBJECT_WITH_OID_ALREADY_EXIST( "ERR_13745_SCHEMA_OBJECT_WITH_OID_ALREADY_EXIST" ), ERR_13746_CANNOT_BUILD_REFERENCES( "ERR_13746_CANNOT_BUILD_REFERENCES" ), ERR_13747_CANNOT_REMOVE_REFERENCES( "ERR_13747_CANNOT_REMOVE_REFERENCES" ), ERR_13748_MATCHING_RULE_NO_SYNTAX( "ERR_13748_MATCHING_RULE_NO_SYNTAX" ), ERR_13749_AT_WITH_CYCLE( "ERR_13749_AT_WITH_CYCLE" ), ERR_13750_REGISTERING_FAILED_ALREADY_PRESENT( "ERR_13750_REGISTERING_FAILED_ALREADY_PRESENT" ), ERR_13751_UNREGISTERING_FAILED_NOT_PRESENT( "ERR_13751_UNREGISTERING_FAILED_NOT_PRESENT" ), ERR_13752_CANNOT_FIND_SUPERIOR( "ERR_13752_CANNOT_FIND_SUPERIOR" ), ERR_13753_CYCLE_DETECTED( "ERR_13753_CYCLE_DETECTED" ), ERR_13754_CANNOT_FIND_SYNTAX( "ERR_13754_CANNOT_FIND_SYNTAX" ), ERR_13755_AT_MUST_HAVE_A_SYNTAX_OID( "ERR_13755_AT_MUST_HAVE_A_SYNTAX_OID" ), ERR_13756_CANNOT_FIND_EQUALITY_MR_OBJECT( "ERR_13756_CANNOT_FIND_EQUALITY_MR_OBJECT" ), ERR_13757_CANNOT_FIND_EQUALITY_MR_INSTANCE( "ERR_13757_CANNOT_FIND_EQUALITY_MR_INSTANCE" ), ERR_13758_CANNOT_FIND_ORDERING_MR_OBJECT( "ERR_13758_CANNOT_FIND_ORDERING_MR_OBJECT" ), ERR_13759_CANNOT_FIND_ORDERING_MR_INSTANCE( "ERR_13759_CANNOT_FIND_ORDERING_MR_INSTANCE" ), ERR_13760_CANNOT_FIND_SUBSTR_MR_OBJECT( "ERR_13760_CANNOT_FIND_SUBSTR_MR_OBJECT" ), ERR_13761_CANNOT_FIND_SUBSTR_MR_INSTANCE( "ERR_13761_CANNOT_FIND_SUBSTR_MR_INSTANCE" ), ERR_13762_AT_MUST_HAVE_SUPERIOR_USAGE( "ERR_13762_AT_MUST_HAVE_SUPERIOR_USAGE" ), ERR_13763_AT_MUST_BE_USER_MODIFIABLE( "ERR_13763_AT_MUST_BE_USER_MODIFIABLE" ), ERR_13764_AT_COLLECTIVE_SHOULD_BE_USER_APP( "ERR_13764_AT_COLLECTIVE_SHOULD_BE_USER_APP" ), ERR_13765_MR_MUST_REFER_EXISTING_SYNTAX( "ERR_13765_MR_MUST_REFER_EXISTING_SYNTAX" ), ERR_13766_ABSTRACT_OC_CANNOT_INHERIT_FROM_OC( "ERR_13766_ABSTRACT_OC_CANNOT_INHERIT_FROM_OC" ), ERR_13767_AUX_OC_CANNOT_INHERIT_FROM_STRUCT_OC( "ERR_13767_AUX_OC_CANNOT_INHERIT_FROM_STRUCT_OC" ), ERR_13768_STRUCT_OC_CANNOT_INHERIT_FROM_AUX_OC( "ERR_13768_STRUCT_OC_CANNOT_INHERIT_FROM_AUX_OC" ), ERR_13769_CANNOT_REGISTER_SUPERIOR_MISSING( "ERR_13769_CANNOT_REGISTER_SUPERIOR_MISSING" ), ERR_13770_CANNOT_REGISTER_DUPLICATE_AT_IN_MAY( "ERR_13770_CANNOT_REGISTER_DUPLICATE_AT_IN_MAY" ), ERR_13771_CANNOT_REGISTER_AT_IN_MAY_DOES_NOT_EXIST( "ERR_13771_CANNOT_REGISTER_AT_IN_MAY_DOES_NOT_EXIST" ), ERR_13772_CANNOT_REGISTER_DUPLICATE_AT_IN_MUST( "ERR_13772_CANNOT_REGISTER_DUPLICATE_AT_IN_MUST" ), ERR_13773_CANNOT_REGISTER_DUPLICATE_AT_IN_MAY_AND_MUST( "ERR_13773_CANNOT_REGISTER_DUPLICATE_AT_IN_MAY_AND_MUST" ), ERR_13774_CANNOT_REGISTER_AT_IN_MUST_DOES_NOT_EXIST( "ERR_13774_CANNOT_REGISTER_AT_IN_MUST_DOES_NOT_EXIST" ), ERR_13775_UNDEFINED_MODIFICATION_TYPE( "ERR_13775_UNDEFINED_MODIFICATION_TYPE" ), ERR_13776_CANNOT_SUBTYPE_COLLECTIVE( "ERR_13776_CANNOT_SUBTYPE_COLLECTIVE" ), ERR_13777_COLLECTIVE_NOT_MULTI_VALUED( "ERR_13777_COLLECTIVE_NOT_MULTI_VALUED" ), ERR_13778_COLLECTIVE_NOT_ALLOWED_IN_MUST( "ERR_13778_COLLECTIVE_NOT_ALLOWED_IN_MUST" ), ERR_13779_COLLECTIVE_NOT_ALLOWED_IN_MAY( "ERR_13779_COLLECTIVE_NOT_ALLOWED_IN_MAY" ), ERR_13780_SCHEMA_OBJECT_DESCRIPTION_HAS_ELEMENT_TWICE( "ERR_13780_SCHEMA_OBJECT_DESCRIPTION_HAS_ELEMENT_TWICE" ), ERR_13781_MR_DESCRIPTION_INVALID( "ERR_13781_MR_DESCRIPTION_INVALID" ), ERR_13782_END_OF_FILE( "ERR_13782_END_OF_FILE" ), ERR_13783_SPACE_EXPECTED( "ERR_13783_SPACE_EXPECTED" ), ERR_13784_BAD_OID_TWO_ZEROES( "ERR_13785_BAD_OID_CONSECUTIVE_DOTS" ), ERR_13785_BAD_OID_CONSECUTIVE_DOTS( "" ), ERR_13786_BAD_OID_DOT_AT_THE_END( "ERR_13786_BAD_OID_DOT_AT_THE_END" ), ERR_13787_OID_EXPECTED( "ERR_13787_OID_EXPECTED" ), ERR_13788_LEAD_KEY_CHAR_EXPECTED( "ERR_13788_LEAD_KEY_CHAR_EXPECTED" ), ERR_13789_SIMPLE_QUOTE_EXPECTED_AT_START( "ERR_13789_SIMPLE_QUOTE_EXPECTED_AT_START" ), ERR_13790_NOT_A_KEYSTRING( "ERR_13790_NOT_A_KEYSTRING" ), ERR_13791_KEYCHAR_EXPECTED( "ERR_13791_KEYCHAR_EXPECTED" ), ERR_13792_SIMPLE_QUOTE_EXPECTED_AT_END( "ERR_13792_SIMPLE_QUOTE_EXPECTED_AT_END" ), ERR_13793_NO_CLOSING_PAREN( "ERR_13793_NO_CLOSING_PAREN" ), ERR_13794_MORE_OIDS_EXPECTED( "ERR_13794_MORE_OIDS_EXPECTED" ), ERR_13795_OPENED_BRACKET_NOT_CLOSED( "ERR_13795_OPENED_BRACKET_NOT_CLOSED" ), ERR_13796_USAGE_EXPECTED( "ERR_13796_USAGE_EXPECTED" ), ERR_13797_USAGE_UNKNOWN( "ERR_13797_USAGE_UNKNOWN" ), ERR_13798_AT_DESCRIPTION_INVALID( "ERR_13798_AT_DESCRIPTION_INVALID" ), ERR_13799_SYNTAX_OR_SUP_REQUIRED( "ERR_13799_SYNTAX_OR_SUP_REQUIRED" ), ERR_13800_COLLECTIVE_REQUIRES_USER_APPLICATION( "ERR_13800_COLLECTIVE_REQUIRES_USER_APPLICATION" ), ERR_13801_NO_USER_MOD_REQUIRE_OPERATIONAL( "ERR_13801_NO_USER_MOD_REQUIRE_OPERATIONAL" ), ERR_13802_EXTENSION_SHOULD_START_WITH_X( "ERR_13802_EXTENSION_SHOULD_START_WITH_X" ), ERR_13803_OC_DESCRIPTION_INVALID( "ERR_13803_OC_DESCRIPTION_INVALID" ), ERR_13804_OBJECT_IDENTIFIER_HAS_NO_OID( "ERR_13804_OBJECT_IDENTIFIER_HAS_NO_OID" ), ERR_13805_OBJECT_IDENTIFIER_INVALID_OID( "ERR_13805_OBJECT_IDENTIFIER_INVALID_OID" ), ERR_13806_UNEXPECTED_ELEMENT_READ( "ERR_13806_UNEXPECTED_ELEMENT_READ" ), ERR_13807_SYN_DESCRIPTION_INVALID( "ERR_13807_SYN_DESCRIPTION_INVALID" ), ERR_13808_SYNTAX_REQUIRED( "ERR_13808_SYNTAX_REQUIRED" ), ERR_13809_DCR_DESCRIPTION_INVALID( "ERR_13809_DCR_DESCRIPTION_INVALID" ), ERR_13810_DSR_DESCRIPTION_INVALID( "ERR_13810_DSR_DESCRIPTION_INVALID" ), ERR_13811_INVALID_RULE_ID( "ERR_13811_INVALID_RULE_ID" ), ERR_13812_FORM_REQUIRED( "ERR_13812_FORM_REQUIRED" ), ERR_13813_MORE_RULE_IDS_EXPECTED( "ERR_13813_MORE_RULE_IDS_EXPECTED" ), ERR_13814_APPLIES_REQUIRED( "ERR_13814_APPLIES_REQUIRED" ), ERR_13815_MRU_DESCRIPTION_INVALID( "ERR_13815_MRU_DESCRIPTION_INVALID" ), ERR_13816_NF_DESCRIPTION_INVALID( "ERR_13816_NF_DESCRIPTION_INVALID" ), ERR_13817_STRUCTURAL_OBJECT_CLASS_REQUIRED( "ERR_13817_STRUCTURAL_OBJECT_CLASS_REQUIRED" ), ERR_13818_MUST_REQUIRED( "ERR_13818_MUST_REQUIRED" ), ERR_13819_FQCN_REQUIRED( "ERR_13819_FQCN_REQUIRED" ), ERR_13820_BYTE_CODE_REQUIRED( "ERR_13820_BYTE_CODE_REQUIRED" ), ERR_13821_NORM_DESCRIPTION_INVALID( "ERR_13821_NORM_DESCRIPTION_INVALID" ), ERR_13822_INVALID_FQCN_BAD_IDENTIFIER_START( "ERR_13822_INVALID_FQCN_BAD_IDENTIFIER_START" ), ERR_13823_INVALID_FQCN_DOUBLE_DOT( "ERR_13823_INVALID_FQCN_DOUBLE_DOT" ), ERR_13824_INVALID_FQCN_BAD_IDENTIFIER( "ERR_13824_INVALID_FQCN_BAD_IDENTIFIER" ), ERR_13825_COMP_DESCRIPTION_INVALID( "ERR_13825_COMP_DESCRIPTION_INVALID" ), ERR_13826_SC_DESCRIPTION_INVALID( "ERR_13826_SC_DESCRIPTION_INVALID" ), ERR_13827_EMPTY_SYNTAX_LEN( "ERR_13827_EMPTY_SYNTAX_LEN" ), ERR_13828_MISSING_SYNTAX_OID( "ERR_13828_MISSING_SYNTAX_OID" ), ERR_13829_NO_OPENING_PAREN( "ERR_13829_NO_OPENING_PAREN" ), ERR_13830_CANNOT_PARSE_NULL_ATTR_TYPE( "ERR_13830_CANNOT_PARSE_NULL_ATTR_TYPE" ), ERR_13831_ATTRIBUTE_TYPE_PARSING_FAILURE( "ERR_13831_ATTRIBUTE_TYPE_PARSING_FAILURE" ), ERR_13832_ATTRIBUTE_TYPE_DESC_PARSE_FAILURE( "ERR_13832_ATTRIBUTE_TYPE_DESC_PARSE_FAILURE" ), ERR_13833_CANNOT_PARSE_NULL_DCR( "ERR_13833_CANNOT_PARSE_NULL_DCR" ), ERR_13834_DCR_PARSING_FAILURE( "ERR_13834_DCR_PARSING_FAILURE" ), ERR_13835_DCR_DESC_PARSING_FAILURE( "ERR_13385_DCR_DESC_PARSING_FAILURE" ), ERR_13836_CANNOT_PARSE_NULL_DSR( "ERR_13386_CANNOT_PARSE_NULL_DSR" ), ERR_13837_DSR_PARSING_FAILURE( "ERR_13387_DSR_PARSING_FAILURE" ), ERR_13838_DSR_DESC_PARSING_FAILURE( "ERR_13838_DSR_DESC_PARSING_FAILURE" ), ERR_13839_CANNOT_PARSE_NULL_COMP( "ERR_13839_CANNOT_PARSE_NULL_COMP" ), ERR_13840_COMP_PARSING_FAILURE( "ERR_13840_COMP_PARSING_FAILURE" ), ERR_13841_COMP_DESC_PARSING_FAILURE( "ERR_13841_COMP_DESC_PARSING_FAILURE" ), ERR_13842_CANNOT_PARSE_NULL_SYNTAX( "ERR_13842_CANNOT_PARSE_NULL_SYNTAX" ), ERR_13843_SYNTAX_PARSING_FAILURE( "ERR_13843_SYNTAX_PARSING_FAILURE" ), ERR_13844_SYNTAX_DESC_PARSING_FAILURE( "ERR_13844_SYNTAX_DESC_PARSING_FAILURE" ), ERR_13845_CANNOT_PARSE_NULL_MR( "ERR_13845_CANNOT_PARSE_NULL_MR" ), ERR_13846_MR_PARSING_FAILURE( "ERR_13846_MR_PARSING_FAILURE" ), ERR_13847_MR_DESC_PARSING_FAILURE( "ERR_13847_MR_DESC_PARSING_FAILURE" ), ERR_13848_CANNOT_PARSE_NULL_MRU( "ERR_13848_CANNOT_PARSE_NULL_MRU" ), ERR_13849_MRU_PARSING_FAILURE( "ERR_13849_MRU_PARSING_FAILURE" ), ERR_13850_MRU_DESC_PARSING_FAILURE( "ERR_13850_MRU_DESC_PARSING_FAILURE" ), ERR_13851_CANNOT_PARSE_NULL_NF( "ERR_13851_CANNOT_PARSE_NULL_NF" ), ERR_13852_NF_PARSING_FAILURE( "ERR_13852_NF_PARSING_FAILURE" ), ERR_13853_NF_DESC_PARSING_FAILURE( "ERR_13853_NF_DESC_PARSING_FAILURE" ), ERR_13854_CANNOT_PARSE_NULL_NORM( "ERR_13854_CANNOT_PARSE_NULL_NORM" ), ERR_13855_NORM_PARSING_FAILURE( "ERR_13855_NORM_PARSING_FAILURE" ), ERR_13856_NORM_DESC_PARSING_FAILURE( "ERR_13856_NORM_DESC_PARSING_FAILURE" ), ERR_13857_CANNOT_PARSE_NULL_OC( "ERR_13857_CANNOT_PARSE_NULL_OC" ), ERR_13858_OC_PARSING_FAILURE( "ERR_13858_OC_PARSING_FAILURE" ), ERR_13859_OC_DESC_PARSING_FAILURE( "ERR_13859_OC_DESC_PARSING_FAILURE" ), ERR_13860_CANNOT_PARSE_NULL_SC( "ERR_13860_CANNOT_PARSE_NULL_SC" ), ERR_13861_SC_PARSING_FAILURE( "ERR_13861_SC_PARSING_FAILURE" ), ERR_13862_SC_PARSING_FAILURE( "ERR_13862_SC_PARSING_FAILURE" ), ERR_13863_MR_DOES_NOT_HAVE_A_COMP( "ERR_13863_MR_DOES_NOT_HAVE_A_COMP" ), ERR_13864_AT_DOES_NOT_HAVE_A_SUPERIOR_NOR_SYNTAX( "ERR_13864_AT_DOES_NOT_HAVE_A_SUPERIOR_NOR_SYNTAX" ), ERR_13865_ERROR_PARSING_AT( "ERR_13865_ERROR_PARSING_AT" ), ERR_13866_MOD_INCREMENT_INVALID_VALUE( "ERR_13866_MOD_INCREMENT_INVALID_VALUE" ), ERR_13867_MOD_INCREMENT_NO_ATTRIBUTE( "ERR_13867_MOD_INCREMENT_NO_ATTRIBUTE" ), ERR_13868_MOD_INCREMENT_NO_INT_ATTRIBUTE( "ERR_13868_MOD_INCREMENT_NO_INT_ATTRIBUTE" ), ERR_13869_MOD_INCREMENT_OVERFLOW( "ERR_13869_MOD_INCREMENT_OVERFLOW" ), // api-ldap-model subtree 13900-13999 ERR_13900_INTEGER_TOKEN_NOT_INTEGER( "ERR_13900_INTEGER_TOKEN_NOT_INTEGER" ), ERR_13901_MESSAGE( "ERR_13901_MESSAGE" ), ERR_13902_FILTER_PARSER_FAILED( "ERR_13902_FILTER_PARSER_FAILED" ), ERR_13903_DN_PARSER_FAILED( "ERR_13903_DN_PARSER_FAILED" ), ERR_13904_MISSING_SPACE_AFTER_BASE( "ERR_13904_MISSING_SPACE_AFTER_BASE" ), ERR_13905_REQUIRED_SPACE_SS_SPEC_FILTER( "ERR_13905_REQUIRED_SPACE_SS_SPEC_FILTER" ), ERR_13906_SS_INVALID_ITEM( "ERR_13906_SS_INVALID_ITEM" ), ERR_13907_REQUIRED_SPACE_SS_SPEC_EXCLUSIONS( "ERR_13907_REQUIRED_SPACE_SS_SPEC_EXCLUSIONS" ), ERR_13908_SS_INVALID_DN( "ERR_13908_SS_INVALID_DN" ), ERR_13909_SUBTREE_SPECIFICATION_REFINEMENT_TOO_DEEP( "ERR_13909_SUBTREE_SPECIFICATION_REFINEMENT_TOO_DEEP" ), // api-ldap-net-mina 14000 - 14999 ERR_14000_ERROR_ENCODING_MESSAGE( "ERR_14000_ERROR_ENCODING_MESSAGE" ), // api-ldap-schema-converter 15000 - 15999 ERR_15000_SCHEMA_ELEMENT_NAME_REQUIRED( "ERR_15000_SCHEMA_ELEMENT_NAME_REQUIRED" ), ERR_15001_NULL_SCHEMA( "ERR_15001_NULL_SCHEMA" ), ERR_15002_EMPTY_OR_NULL_SCHEMA_OBJECT( "ERR_15002_EMPTY_OR_NULL_SCHEMA_OBJECT" ), ERR_15003_PARSER_FAILURE( "ERR_15003_PARSER_FAILURE" ), ERR_15004_CANNOT_GENERATE_SOURCES( "ERR_15004_CANNOT_GENERATE_SOURCES" ), ERR_15005_NO_PROPERTY( "ERR_15005_NO_PROPERTY" ), ERR_15006_SPACE_REQUIRED( "ERR_15006_SPACE_REQUIRED" ), ERR_15007_UNEXPECTED_ESCAPED_SECOND_CHAR("ERR_15007_UNEXPECTED_ESCAPED_SECOND_CHAR" ), ERR_15008_OID_REQUIRED( "ERR_15008_OID_REQUIRED" ), ERR_15009_MISSING_ESCAPED_CHAR( "ERR_15009_MISSING_ESCAPED_CHAR" ), ERR_15010_MISSING_QDESCR_LQUOTE( "ERR_15010_MISSING_QDESCR_LQUOTE" ), ERR_15011_MISSING_ESCAPED_QUOTE( "ERR_15011_MISSING_ESCAPED_QUOTE" ), ERR_15012_MISSING_ESCAPED_ESCAPE( "ERR_15012_MISSING_ESCAPED_ESCAPE" ), ERR_15013_QDESCR_INCOMPLET( "ERR_15013_QDESCR_INCOMPLET" ), ERR_15014_AT_WRONG_USAGE( "ERR_15014_AT_WRONG_USAGE" ), ERR_15015_MISSING_DESC_LQUOTE( "ERR_15015_MISSING_DESC_LQUOTE" ), ERR_15016_MISSING_QDSTRING_RPAREN( "ERR_15016_MISSING_QDSTRING_RPAREN" ), ERR_15017_MISSING_OID_LEN_RIGHT_CURLY( "ERR_15017_MISSING_OID_LEN_RIGHT_CURLY" ), ERR_15018_MANDATORY_SPACE_MISSING( "ERR_15018_MANDATORY_SPACE_MISSING" ), ERR_15019_MISSING_OIDS_RPAREN( "ERR_15019_MISSING_OIDS_RPAREN" ), ERR_15020_MISSING_SCHEMA_ELEMENT_RPAREN( "ERR_15020_MISSING_SCHEMA_ELEMENT_RPAREN" ), ERR_15021_NO_SYTNAX_LEN( "ERR_15021_NO_SYTNAX_LEN" ), ERR_15022_SCHEMA_ELEMENT_MISSING_RPAREN( "ERR_15022_SCHEMA_ELEMENT_MISSING_RPAREN" ), ERR_15023_IMPROPER_EXTENSION_NAME( "ERR_15023_IMPROPER_EXTENSION_NAME" ), // api-ldap-schema-data 16000 - 16999 ERR_16000_CANNOT_OVEWRITE_SCHEMA( "ERR_16000_CANNOT_OVEWRITE_SCHEMA" ), ERR_16001_CANNOT_COPY_NON_EXISTENT( "ERR_16001_CANNOT_COPY_NON_EXISTENT" ), ERR_16002_MORE_THAN_ONE_ENTRY( "ERR_16002_MORE_THAN_ONE_ENTRY" ), ERR_16003_ERROR_PARSING_LDIF( "ERR_16003_ERROR_PARSING_LDIF" ), ERR_16004_ROOT_WITHOUT_SCHEMA( "ERR_16004_ROOT_WITHOUT_SCHEMA" ), ERR_16005_PARENT_NULL( "ERR_16005_PARENT_NULL" ), ERR_16006_DIRECTORY_CREATION_FAILED( "ERR_16006_DIRECTORY_CREATION_FAILED" ), ERR_16007_BINARY_REQUIRED( "ERR_16007_BINARY_REQUIRED" ), ERR_16008_AT_ACCESS_FAILURE( "ERR_16008_AT_ACCESS_FAILURE" ), ERR_16009_LDIF_LOAD_FAIL( "ERR_16009_LDIF_LOAD_FAIL" ), ERR_16010_NO_SHEMA_FILE( "ERR_16010_NO_SHEMA_FILE" ), ERR_16011_NULL_ATTRIBUTE( "ERR_16011_NULL_ATTRIBUTE" ), ERR_16012_INVALID_COMPARATOR_OID( "ERR_16012_INVALID_COMPARATOR_OID" ), ERR_16013_NULL_ENTRY( "ERR_16013_NULL_ENTRY" ), ERR_16014_NULL_SCHEMA_DESC( "ERR_16014_NULL_SCHEMA_DESC" ), ERR_16015_NON_EXISTENT_SCHEMA( "ERR_16015_NON_EXISTENT_SCHEMA" ), ERR_16016_NULL_ENTRY( "ERR_16016_NULL_ENTRY" ), ERR_16017_INVALID_CN_AT( "ERR_16017_INVALID_CN_AT" ), ERR_16018_INVALID_AT( "ERR_16018_INVALID_AT" ), ERR_16019_CANNOT_ADD_SC( "ERR_16019_CANNOT_ADD_SC" ), ERR_16020_CANNOT_ADD_SC_IN_REGISTRY( "ERR_16020_CANNOT_ADD_SC_IN_REGISTRY" ), ERR_16021_DIFFERENT_COMPARATOR_OID( "ERR_16021_DIFFERENT_COMPARATOR_OID" ), ERR_16022_CANNOT_ADD_CMP( "ERR_16022_CANNOT_ADD_CMP" ), ERR_16023_CANNOT_ADD_CMP_IN_REGISTRY( "ERR_16023_CANNOT_ADD_CMP_IN_REGISTRY" ), ERR_16024_CANNOT_ADD_NORMALIZER( "ERR_16024_CANNOT_ADD_NORMALIZER" ), ERR_16025_CANNOT_ADD_NORMALIZER_IN_REGISTRY( "ERR_16025_CANNOT_ADD_NORMALIZER_IN_REGISTRY" ), ERR_16026_CANNOT_ADD_SYNTAX( "ERR_16026_CANNOT_ADD_SYNTAX" ), ERR_16027_CANNOT_ADD_SYNTAX_IN_REGISTRY( "ERR_16027_CANNOT_ADD_SYNTAX_IN_REGISTRY" ), ERR_16028_CANNOT_ADD_MR( "ERR_16028_CANNOT_ADD_MR" ), ERR_16029_CANNOT_ADD_MR_IN_REGISTRY( "ERR_16029_CANNOT_ADD_MR_IN_REGISTRY" ), ERR_16030_CANNOT_ADD_OC( "ERR_16030_CANNOT_ADD_OC" ), ERR_16031_CANNOT_ADD_OC_IN_REGISTRY( "ERR_16031_CANNOT_ADD_OC_IN_REGISTRY" ), ERR_16032_CANNOT_ADD_AT( "ERR_16032_CANNOT_ADD_AT" ), ERR_16033_CANNOT_ADD_AT_IN_REGISTRY( "ERR_16033_CANNOT_ADD_AT_IN_REGISTRY" ), ERR_16034_ENTRY_WITHOUT_VALID_AT( "ERR_16034_ENTRY_WITHOUT_VALID_AT" ), ERR_16035_CANNOT_LOAD_SCHEMA( "ERR_16035_CANNOT_LOAD_SCHEMA" ), ERR_16036_OID_NOT_UNIQUE( "ERR_16036_OID_NOT_UNIQUE" ), ERR_16037_NON_EXISTING_SCHEMA( "ERR_16037_NON_EXISTING_SCHEMA" ), ERR_16038_NOT_ASSOCIATED_TO_A_SCHEMA( "ERR_16038_NOT_ASSOCIATED_TO_A_SCHEMA" ), ERR_16039_OID_DOES_NOT_EXIST( "ERR_16039_OID_DOES_NOT_EXIST" ), ERR_16040_CANNOT_REMOVE_FROM_REGISTRY( "ERR_16040_CANNOT_REMOVE_FROM_REGISTRY" ), ERR_16041_CANNOT_DELETE_SCHEMA_OBJECT( "ERR_16041_CANNOT_DELETE_SCHEMA_OBJECT" ), ERR_16042_OUTPUT_DIR_CREATION_FAIL( "ERR_16042_OUTPUT_DIR_CREATION_FAIL" ), ERR_16043_CANOT_LOAD_SCHEMA( "ERR_16043_CANOT_LOAD_SCHEMA" ), ERR_16044_CANNOT_LOAD_FILE( "ERR_16044_CANNOT_LOAD_FILE" ), ERR_16045_ERROR_LOADING_RESOURCE( "ERR_16045_ERROR_LOADING_RESOURCE" ), ERR_16046_BASE_DIR_DOES_NOT_EXIST( "ERR_16046_BASE_DIR_DOES_NOT_EXIST" ), ERR_16047_CANNOT_LOAD_RESOURCE( "ERR_16047_CANNOT_LOAD_RESOURCE" ), ERR_16048_CANNOT_FIND_SC_CTOR( "ERR_16048_CANNOT_FIND_SC_CTOR" ), ERR_16049_CANNOT_FIND_SC_CLASS( "ERR_16049_CANNOT_FIND_SC_CLASS" ), ERR_16050_CANNOT_LOAD_SC_CTOR( "ERR_16050_CANNOT_LOAD_SC_CTOR" ), ERR_16051_CANNOT_LOAD_SC_CLASS( "ERR_16051_CANNOT_LOAD_SC_CLASS" ), ERR_16052_CANNOT_INST_SC_CTOR( "ERR_16052_CANNOT_INST_SC_CTOR" ), ERR_16053_CANNOT_INST_SC_CLASS( "ERR_16053_CANNOT_INST_SC_CLASS" ), ERR_16054_CANNOT_ACCESS_SC_CTOR( "ERR_16054_CANNOT_ACCESS_SC_CTOR" ), ERR_16055_CANNOT_ACCESS_SC_CLASS( "ERR_16055_CANNOT_ACCESS_SC_CLASS" ), ERR_16056_CANNOT_FIND_CMP_CTOR( "ERR_16056_CANNOT_FIND_CMP_CTOR" ), ERR_16057_CANNOT_FIND_CMP_CLASS( "ERR_16057_CANNOT_FIND_CMP_CLASS" ), ERR_16058_CANNOT_LOAD_CMP_CTOR( "ERR_16058_CANNOT_LOAD_CMP_CTOR" ), ERR_16059_CANNOT_LOAD_CMP_CLASS( "ERR_16059_CANNOT_LOAD_CMP_CLASS" ), ERR_16060_CANNOT_INVOKE_CMP_CTOR( "ERR_16060_CANNOT_INVOKE_CMP_CTOR" ), ERR_16061_CANNOT_INVOKE_CMP_CLASS( "ERR_16061_CANNOT_INVOKE_CMP_CLASS" ), ERR_16062_CANNOT_INST_CMP_CTOR_CLASS( "ERR_16062_CANNOT_INST_CMP_CTOR_CLASS" ), ERR_16063_CANNOT_INST_CMP_CLASS( "ERR_16063_CANNOT_INST_CMP_CLASS" ), ERR_16064_CANNOT_ACCESS_CMP_CTOR( "ERR_16064_CANNOT_ACCESS_CMP_CTOR" ), ERR_16065_CANNOT_ACCESS_CMP_CLASS( "ERR_16065_CANNOT_ACCESS_CMP_CLASS" ), ERR_16066_CANNOT_FIND_CMP_CTOR_METH_CLASS( "ERR_16066_CANNOT_FIND_CMP_CTOR_METH_CLASS" ), ERR_16067_CANNOT_FIND_CMP_CTOR_METH( "ERR_16067_CANNOT_FIND_CMP_CTOR_METH" ), ERR_16068_CANNOT_FIND_NORM_CTOR( "ERR_16068_CANNOT_FIND_NORM_CTOR" ), ERR_16069_CANNOT_FIND_NORM_CLASS( "ERR_16069_CANNOT_FIND_NORM_CLASS" ), ERR_16070_CANNOT_LOAD_NORM_CTOR( "ERR_16070_CANNOT_LOAD_NORM_CTOR" ), ERR_16071_CANNOT_LOAD_NORM_CLASS( "ERR_16071_CANNOT_LOAD_NORM_CLASS" ), ERR_16072_CANNOT_INST_NORM_CTOR_CLASS( "ERR_16072_CANNOT_INST_NORM_CTOR_CLASS" ), ERR_16073_CANNOT_INST_NORM_CLASS( "ERR_16073_CANNOT_INST_NORM_CLASS" ), ERR_16074_CANNOT_ACCESS_NORM_CTOR_CLASS( "ERR_16074_CANNOT_ACCESS_NORM_CTOR_CLASS" ), ERR_16075_CANNOT_ACCESS_NORM_CTOR( "ERR_16075_CANNOT_ACCESS_NORM_CTOR" ), ERR_16076_NOT_A_SCHEMA_DEFINITION( "ERR_16076_NOT_A_SCHEMA_DEFINITION" ), ERR_16077_SCHEMA_MANAGER_CANT_BE_LOADED( "ERR_16077_SCHEMA_MANAGER_CANT_BE_LOADED" ), ERR_16078_CANNOT_LOAD_UNKNOWN_SCHEMA( "ERR_16078_CANNOT_LOAD_UNKNOWN_SCHEMA" ), ERR_16079_INVALID_SCHEMA_OBJECT_CANNOT_BE_LOADED( "ERR_16079_INVALID_SCHEMA_OBJECT_CANNOT_BE_LOADED" ), ERR_16080_SCHEMA_LOADER_CANT_BE_CREATED("ERR_16080_SCHEMA_LOADER_CANT_BE_CREATED"), ERR_16081_WONT_LOAD_CLASS("ERR_16081_WONT_LOAD_CLASS"), ERR_16082_CANNOT_INSTANTIATE_CLASS("ERR_16082_CANNOT_INSTANTIATE_CLASS"), // api-utils 17000 - 17999 ERR_17000_UNEXPECTED_PARSER_CONDITION( "ERR_17000_UNEXPECTED_PARSER_CONDITION" ), ERR_17001_FAILED_OPEN_JAR_MANIFEST( "ERR_17001_FAILED_OPEN_JAR_MANIFEST" ), ERR_17002_INTEGER_TOO_BIG( "ERR_17002_INTEGER_TOO_BIG" ), ERR_17003_INTEGER_INVALID( "ERR_17003_INTEGER_INVALID" ), ERR_17004_UNABLE_DELETE_DIR( "ERR_17004_UNABLE_DELETE_DIR" ), ERR_17005_FILE_MUST_NOT_BE_NULL( "ERR_17005_FILE_MUST_NOT_BE_NULL" ), ERR_17006_DOES_NOT_EXIST( "ERR_17006_DOES_NOT_EXIST" ), ERR_17007_IS_NOT_DIRECTORY( "ERR_17007_IS_NOT_DIRECTORY" ), ERR_17008_FAIL_LIST_DIR( "ERR_17008_FAIL_LIST_DIR" ), ERR_17009_FILE_DOES_NOT_EXIST( "ERR_17009_FILE_DOES_NOT_EXIST" ), ERR_17010_UNABLE_DELETE_FILE( "ERR_17010_UNABLE_DELETE_FILE" ), ERR_17011_FILE_IS_DIR( "ERR_17011_FILE_IS_DIR" ), ERR_17012_CANNOT_READ_FILE( "ERR_17012_CANNOT_READ_FILE" ), ERR_17013_FILE_DOES_NOT_EXIST( "ERR_17013_FILE_DOES_NOT_EXIST" ), ERR_17014_CANNOT_WRITE_FILE( "ERR_17014_CANNOT_WRITE_FILE" ), ERR_17015_CANNOT_CREATE_DIR( "ERR_17015_CANNOT_CREATE_DIR" ), ERR_17016_SOURCE_MUST_NOT_BE_NULL( "ERR_17016_SOURCE_MUST_NOT_BE_NULL" ), ERR_17017_DEST_MUST_NOT_BE_NULL( "ERR_17017_DEST_MUST_NOT_BE_NULL" ), ERR_17018_SRC_DOES_NOT_EXIST( "ERR_17018_SRC_DOES_NOT_EXIST" ), ERR_17019_SRC_IS_DIR( "ERR_17019_SRC_IS_DIR" ), ERR_17020_SRC_AND_DEST_SAME( "ERR_17020_SRC_AND_DEST_SAME" ), ERR_17021_CANNOT_CREATE_DEST_DIR( "ERR_17021_CANNOT_CREATE_DEST_DIR" ), ERR_17022_DEST_READONLY( "ERR_17022_DEST_READONLY" ), ERR_17023_DEST_IS_DIR( "ERR_17023_DEST_IS_DIR" ), ERR_17024_FAILED_COPY_CONTENT( "ERR_17024_FAILED_COPY_CONTENT" ), ERR_17025_INVALID_CHAR( "ERR_17025_INVALID_CHAR" ), ERR_17026_UNREGISTRED_COMPONENT( "ERR_17026_UNREGISTRED_COMPONENT" ), ERR_17027_WRONG_DATA_LENGTH( "ERR_17027_WRONG_DATA_LENGTH" ), ERR_17028_PARAMETER_CANT_BE_NULL( "ERR_17028_PARAMETER_CANT_BE_NULL" ), ERR_17029_CHARSET_CANT_BE_NULL( "ERR_17029_CHARSET_CANT_BE_NULL" ), ERR_17030_BAD_ITERATOR_TYPE( "ERR_17030_BAD_ITERATOR_TYPE" ), ERR_17031_REMOVE_FOLLOW_NEXT( "ERR_17031_REMOVE_FOLLOW_NEXT" ), ERR_17032_BELOW_ZERO( "ERR_17032_BELOW_ZERO" ), ERR_17033_ABOVE_OR_EQUAL( "ERR_17033_ABOVE_OR_EQUAL" ), ERR_17034_ADDING_DUP_KEYS_NOT_ALLOWED( "ERR_17034_ADDING_DUP_KEYS_NOT_ALLOWED" ), ERR_17035_DUPLICATED_COMMON_ELEMENT( "ERR_17035_DUPLICATED_COMMON_ELEMENT" ), ERR_17036_UNREGISTRED_COMPONENT( "ERR_17036_UNREGISTRED_COMPONENT" ), ERR_17037_MUST_START_WITH_SHARP( "ERR_17037_MUST_START_WITH_SHARP" ), ERR_17038_MUST_START_WITH_ESC_SHARP( "ERR_17038_MUST_START_WITH_ESC_SHARP" ), ERR_17039_NON_NULL_EXPECTED_STRING( "ERR_17039_NON_NULL_EXPECTED_STRING" ), ERR_17040_EXPECTED_NON_EMPTY_STRING( "ERR_17040_EXPECTED_NON_EMPTY_STRING" ), ERR_17041_VALID_ESC_CHARS_EXPECTED( "ERR_17041_VALID_ESC_CHARS_EXPECTED" ), ERR_17042_INITIAL_SIZE_ABOVE_ZERO( "ERR_17042_INITIAL_SIZE_ABOVE_ZERO" ), ERR_17043_GENERALIZED_TIME_NULL( "ERR_17043_GENERALIZED_TIME_NULL" ), ERR_17044_BAD_GENERALIZED_TIME( "ERR_17044_BAD_GENERALIZED_TIME" ), ERR_17045_BAD_GENERALIZED_TIME( "ERR_17045_BAD_GENERALIZED_TIME" ), ERR_17046_BAD_GENERALIZED_TIME( "ERR_17046_BAD_GENERALIZED_TIME" ), ERR_17047_TIME_TOO_SHORT( "ERR_17047_TIME_TOO_SHORT" ), ERR_17048_TIME_TOO_SHORT( "ERR_17048_TIME_TOO_SHORT" ), ERR_17049_INVALID_GENERALIZED_TIME( "ERR_17049_INVALID_GENERALIZED_TIME" ), ERR_17050_INVALID_DATE_TIME( "ERR_17050_INVALID_DATE_TIME" ), ERR_17051_CALENDAR_NULL( "ERR_17051_CALENDAR_NULL" ), ERR_17052_TIME_TOO_SHOR_NO_TZ( "ERR_17052_TIME_TOO_SHOR_NO_TZ" ), ERR_17053_MISSING_TZ( "ERR_017053_MISSING_TZ" ), ERR_17054_TZ_MUST_BE_2_OR_4_DIGITS( "ERR_17054_TZ_MUST_BE_2_OR_4_DIGITS" ), ERR_17055_MISSING_FRACTION( "ERR_17055_MISSING_FRACTION" ), ERR_17056_TIME_TOO_SHORT_NO_SECOND( "ERR_17056_TIME_TOO_SHORT_NO_SECOND" ), ERR_17057_SECOND_NOT_NUM( "ERR_17057_SECOND_NOT_NUM" ), ERR_17058_MISSING_MINUTE( "ERR_17058_MISSING_MINUTE" ), ERR_17059_MIN_NOT_NUM( "ERR_17059_MIN_NOT_NUM" ), ERR_17060_TIME_TO_SHORT_MISSING_HOUR( "ERR_17060_TIME_TO_SHORT_MISSING_HOUR" ), ERR_17061_HOUR_NOT_NUM( "ERR_17061_HOUR_NOT_NUM" ), ERR_17062_TIME_TO_SHORT_MISSING_DAY( "ERR_17062_TIME_TO_SHORT_MISSING_DAY" ), ERR_17063_DAY_NOT_NUM( "ERR_17063_DAY_NOT_NUM" ), ERR_17064_TIME_TO_SHORT_MISSING_MONTH( "ERR_17064_TIME_TO_SHORT_MISSING_MONTH" ), ERR_17065_MONTH_NOT_NUM( "ERR_17065_MONTH_NOT_NUM" ), ERR_17066_TIME_TO_SHORT_MISSING_YEAR( "ERR_17066_TIME_TO_SHORT_MISSING_YEAR" ), ERR_17067_YEAR_NOT_NUM( "ERR_17067_YEAR_NOT_NUM" ), ERR_17068_SHOULD_NOT_GET_HERE( "ERR_17068_SHOULD_NOT_GET_HERE" ), ERR_17069_UNEXPECTED_FORMAT( "ERR_17069_UNEXPECTED_FORMAT" ), ERR_17070_SIZE_POSITIVE( "ERR_17070_SIZE_POSITIVE" ), ERR_17071_UNEXPECTED_SIZE( "ERR_17071_UNEXPECTED_SIZE" ), ERR_17072_INTEGER_OVERFLOW( "ERR_17072_INTEGER_OVERFLOW" ), ERR_17073_CHAR_REQUIRED( "ERR_17073_CHAR_REQUIRED" ), ERR_17074_DESCR_INCORRECT_FIRST_CHAR( "ERR_17074_DESCR_INCORRECT_FIRST_CHAR" ), ERR_17075_MISSING_LOW_SURROGATE_CHAR( "ERR_17075_MISSING_LOW_SURROGATE_CHAR" ), ERR_17076_IMPROPER_MULTI_BYTE_CHAR( "ERR_17076_IMPROPER_MULTI_BYTE_CHAR" ), ERR_17077_MISSING_CLOSING_DQUOTE( "ERR_17077_MISSING_CLOSING_DQUOTE" ), ERR_17078_INVALID_INTEGER_STARTING_WITH_ZERO( "ERR_17078_INVALID_INTEGER_STARTING_WITH_ZERO" ), ERR_17079_OVERFLOWN_INTEGER( "ERR_17079_OVERFLOWN_INTEGER" ), ERR_17080_INVALID_CHAR_SHOULD_BE_ASCII( "ERR_17080_INVALID_CHAR_SHOULD_BE_ASCII" ), // The messages // asn1 api 0-999 // none // asn1 ber 1000-1999 // <> 1000-1099 MSG_01000_TAG_DECODED( "MSG_01000_TAG_DECODED" ), MSG_01001_TLV_TREE( "MSG_01001_TLV_TREE" ), MSG_01002_CURRENT_BYTE( "MSG_01002_CURRENT_BYTE" ), MSG_01003_PARENT_LENGTH( "MSG_01003_PARENT_LENGTH" ), MSG_01004_ROOT_TLV( "MSG_01004_ROOT_TLV" ), MSG_01005_TLV( "MSG_01005_TLV" ), MSG_01006_LENGTH_DECODED( "MSG_01006_LENGTH_DECODED" ), MSG_01007_LINE_SEPARATOR1( "MSG_01007_LINE_SEPARATOR1" ), MSG_01008_LINE_SEPARATOR2( "MSG_01008_LINE_SEPARATOR2" ), MSG_01009_LINE_SEPARATOR3( "MSG_01009_LINE_SEPARATOR3" ), MSG_01010_LINE_SEPARATOR4( "MSG_01010_LINE_SEPARATOR4" ), MSG_01011_DECODING_PDU( "MSG_01011_DECODING_PDU" ), MSG_01012_STATE( "MSG_01012_STATE" ), MSG_01013_CURRENT_BYTE( "MSG_01013_CURRENT_BYTE" ), MSG_01014_NO_MORE_BYTE( "MSG_01014_NO_MORE_BYTE" ), MSG_01015_STOP_DECODING( "MSG_01015_STOP_DECODING" ), MSG_01016_STOP_DECODING_NULL_TLV( "MSG_01016_STOP_DECODING_NULL_TLV" ), MSG_01017_END_DECODING( "MSG_01017_END_DECODING" ), MSG_01018_END_DECODING_NULL_TLV( "MSG_01018_END_DECODING_NULL_TLV" ), // actions 1100-1199 MSG_01100_INTEGER_VALUE( "MSG_01100_INTEGER_VALUE" ), MSG_01101_BITSTRING_VALUE( "MSG_01101_BITSTRING_VALUE" ), // grammar 1200-1299 // None // tlv 1300-1399 MSG_01300_BOOLEAN_0X00_0XFF( "MSG_01300_BOOLEAN_0X00_0XFF" ), // api-dsml-engine 2000-2999 MSG_02000_FAILED_GETTING_NEXT_REQUEST( "MSG_02000_FAILED_GETTING_NEXT_REQUEST" ), MSG_02001_FAILED_PROCESSING_REQUEST( "MSG_02001_FAILED_PROCESSING_REQUEST" ), MSG_02002_FAILED_TO_BIND( "MSG_02002_FAILED_TO_BIND" ), MSG_02003_ERROR( "MSG_02003_ERROR" ), // api-dsml-parser 3000-3999 MSG_03000_FAILED_TO_CREATE_XSLT_TRANSFORMER( "MSG_03000_FAILED_TO_CREATE_XSLT_TRANSFORMER" ), // api-ldap-client-api 4000-4999 // <> 4000-4100 // api 4100-4200 MSG_04100_BIND_FAIL( "MSG_04100_BIND_FAIL" ), MSG_04101_BIND_SUCCESSFUL( "MSG_04101_BIND_SUCCESSFUL" ), MSG_04102_BIND_REQUEST( "MSG_04102_BIND_REQUEST" ), MSG_04103_NULL_REQUEST( "MSG_04103_NULL_REQUEST" ), MSG_04104_SENDING_REQUEST( "MSG_04104_SENDING_REQUEST" ), MSG_04105_MISSING_PASSWORD( "MSG_04105_MISSING_PASSWORD" ), MSG_04106_ADDING( "MSG_04106_ADDING" ), MSG_04107_ADD_FAILED( "MSG_04107_ADD_FAILED" ), MSG_04108_ADD_SUCCESSFUL( "MSG_04108_ADD_SUCCESSFUL" ), MSG_04109_ANONYMOUS_BIND( "MSG_04109_ANONYMOUS_BIND" ), MSG_04110_ANONYMOUS_ASYNC_BIND( "MSG_04110_ANONYMOUS_ASYNC_BIND" ), MSG_04111_ASYNC_BIND( "MSG_04111_ASYNC_BIND" ), MSG_04112_BIND( "MSG_04112_BIND" ), MSG_04113_COMPARE_FAILED( "MSG_04113_COMPARE_FAILED" ), MSG_04114_COMPARE_SUCCESSFUL( "MSG_04114_COMPARE_SUCCESSFUL" ), MSG_04115_DELETE_FAILED( "MSG_04115_DELETE_FAILED" ), MSG_04116_DELETE_SUCCESSFUL( "MSG_04116_DELETE_SUCCESSFUL" ), MSG_04117_EXTENDED_FAILED( "MSG_04117_EXTENDED_FAILED" ), MSG_04118_EXTENDED_SUCCESSFUL( "MSG_04118_EXTENDED_SUCCESSFUL" ), MSG_04119_GETTING( "MSG_04119_GETTING" ), MSG_04120_INTERRUPTED_WAITING_FOR_CONNECTION( "MSG_04120_INTERRUPTED_WAITING_FOR_CONNECTION" ), MSG_04121_LDAP_ALREADY_USING_START_TLS( "MSG_04121_LDAP_ALREADY_USING_START_TLS" ), MSG_04122_MODIFY_FAILED( "MSG_04122_MODIFY_FAILED" ), MSG_04123_MODIFY_SUCCESSFUL( "MSG_04123_MODIFY_SUCCESSFUL" ), MSG_04124_MODIFYDN_FAILED( "MSG_04124_MODIFYDN_FAILED" ), MSG_04125_MODIFYDN_SUCCESSFUL( "MSG_04125_MODIFYDN_SUCCESSFUL" ), MSG_04126_REMOVING( "MSG_04126_REMOVING" ), MSG_04127_SASL_PLAIN_BIND( "MSG_04127_SASL_PLAIN_BIND" ), MSG_04128_SEARCH_ENTRY_FOUND( "MSG_04128_SEARCH_ENTRY_FOUND" ), MSG_04129_SEARCH_FAILED( "MSG_04129_SEARCH_FAILED" ), MSG_04130_SEARCH_REFERENCE_FOUND( "MSG_04130_SEARCH_REFERENCE_FOUND" ), MSG_04131_SEARCH_SUCCESSFUL( "MSG_04131_SEARCH_SUCCESSFUL" ), MSG_04132_SENDING_UNBIND( "MSG_04132_SENDING_UNBIND" ), MSG_04133_UNBINDSUCCESSFUL( "MSG_04133_UNBINDSUCCESSFUL" ), MSG_04134_CLOSING( "MSG_04134_CLOSING" ), MSG_04135_KRB5_FILE_CREATED( "MSG_04135_KRB5_FILE_CREATED" ), MSG_04136_NOTIFYING_CLOSE_LISTENERS( "MSG_04136_NOTIFYING_CLOSE_LISTENERS" ), MSG_04137_NOD_RECEIVED( "MSG_04137_NOD_RECEIVED" ), MSG_04138_NULL_DN_SEARCH( "MSG_04138_NULL_DN_SEARCH" ), MSG_04139_NULL_DN_MODIFY( "MSG_04139_NULL_DN_MODIFY" ), MSG_04140_NULL_ENTRY_MODIFY( "MSG_04140_NULL_ENTRY_MODIFY" ), MSG_04141_SENDING_CANCEL( "MSG_04141_SENDING_CANCEL" ), MSG_04142_MESSAGE_RECEIVED( "MSG_04142_MESSAGE_RECEIVED" ), MSG_04143_CONNECTION_RETRYING( "MSG_04143_CONNECTION_RETRYING" ), MSG_04144_CONNECTION_ERROR( "MSG_04144_CONNECTION_ERROR" ), MSG_04145_BIND_REQUEST( "MSG_04145_BIND_REQUEST" ), MSG_04146_ACTIVATING( "MSG_04146_ACTIVATING" ), MSG_04147_REBIND_CONNECTION_DROPPED( "MSG_04147_REBIND_CONNECTION_DROPPED" ), MSG_04148_DESTROYING( "MSG_04148_DESTROYING" ), MSG_04149_UNABLE_TO_UNBIND( "MSG_04149_UNABLE_TO_UNBIND" ), MSG_04150_CREATING_LDAP_CONNECTION( "MSG_04150_CREATING_LDAP_CONNECTION" ), MSG_04151_PASSIVATING( "MSG_04151_PASSIVATING" ), MSG_04152_VALIDATING( "MSG_04152_VALIDATING" ), MSG_04153_SENDING_NAME_IN_CALLBACK( "MSG_04153_SENDING_NAME_IN_CALLBACK" ), MSG_04154_SENDING_CREDS_IN_CALLBACK( "MSG_04154_SENDING_CREDS_IN_CALLBACK" ), MSG_04155_SENDING_USER_REALM_IN_CALLBACK( "MSG_04155_SENDING_USER_REALM_IN_CALLBACK" ), MSG_04156_SENDING_DEFAULT_REALM_IN_CALLBACK( "MSG_04156_SENDING_DEFAULT_REALM_IN_CALLBACK" ), MSG_04157_SENDING_USER_REALM_IN_CALLBACK( "MSG_04157_SENDING_USER_REALM_IN_CALLBACK" ), MSG_04158_UNABLE_TO_BIND( "MSG_04158_UNABLE_TO_BIND" ), MSG_04159_UNABLE_TO_CLOSE_CONNECTION( "MSG_04159_UNABLE_TO_CLOSE_CONNECTION" ), MSG_04160_INITIALIZING_SCHEMAS( "MSG_04160_INITIALIZING_SCHEMAS" ), MSG_04161_CREATING_ENTRY_CURSOR( "MSG_04161_CREATING_ENTRY_CURSOR" ), MSG_04162_CLOSING_ENTRY_CURSOR( "MSG_04162_CLOSING_ENTRY_CURSOR" ), MSG_04163_BORROWED_CONNECTION( "MSG_04163_BORROWED_CONNECTION" ), MSG_04164_RETURNED_CONNECTION( "MSG_04164_RETURNED_CONNECTION" ), MSG_04165_NO_FUTURE_ASSOCIATED_TO_MSG_ID_COMPLETED( "MSG_04165_NO_FUTURE_ASSOCIATED_TO_MSG_ID_COMPLETED" ), MSG_04166_NO_FUTURE_ASSOCIATED_TO_MSG_ID_IGNORING( "MSG_04166_NO_FUTURE_ASSOCIATED_TO_MSG_ID_IGNORING" ), MSG_04167_SCHEMA_LOADED_SUCCESSFULLY( "MSG_04167_SCHEMA_LOADED_SUCCESSFULLY" ), MSG_04168_CHECK_CLIENT_TRUSTED( "MSG_04168_CHECK_CLIENT_TRUSTED" ), MSG_04169_CHECK_SERVER_TRUSTED( "MSG_04169_CHECK_SERVER_TRUSTED" ), MSG_04170_CREATING_SEARCH_CURSOR( "MSG_04170_CREATING_SEARCH_CURSOR" ), MSG_04171_CLOSING_SEARCH_CURSOR( "MSG_04171_CLOSING_SEARCH_CURSOR" ), MSG_04172_REBIND_BIND_CONNECTION( "MSG_04172_REBIND_BIND_CONNECTION" ), MSG_04173_UNBIND_START_TLS( "MSG_04173_UNBIND_START_TLS" ), MSG_04174_CREATING_NEW_CONNECTION_TEMPLATE( "MSG_04174_CREATING_NEW_CONNECTION_TEMPLATE" ), MSG_04175_TRUST_MANAGER_IO_EXCEPTION( "MSG_04175_TRUST_MANAGER_IO_EXCEPTION" ), MSG_04176_TRUST_MANAGER_ON_CLASSPATH( "MSG_04176_TRUST_MANAGER_ON_CLASSPATH" ), MSG_04177_CONNECTION_TIMEOUT( "MSG_04177_CONNECTION_TIMEOUT" ), MSH_04178_CLOSE_LATCH_ABORTED( "MSH_04178_CLOSE_LATCH_ABORTED" ), // api-ldap-codec-core 5000-5999 // <> 5000-5099 // actions 5100-5199 MSG_05100_NEW_LIST_CONTROLS_INITIALIZED( "MSG_05100_NEW_LIST_CONTROLS_INITIALIZED" ), MSG_05101_NEW_EMPTY_CONTROLS_INITIALIZED( "MSG_05101_NEW_EMPTY_CONTROLS_INITIALIZED" ), MSG_05102_LDAP_MESSAGE_ID_DECODED( "MSG_05102_LDAP_MESSAGE_ID_DECODED" ), MSG_05103_REFERRAL_ERROR_MESSAGE_NOT_ALLOWED( "MSG_05103_REFERRAL_ERROR_MESSAGE_NOT_ALLOWED" ), MSG_05104_REFERRAL_ERROR_MESSAGE_SET_TO( "MSG_05104_REFERRAL_ERROR_MESSAGE_SET_TO" ), MSG_05105_INITIALISNG_REFERRAL_LIST( "MSG_05105_INITIALISNG_REFERRAL_LIST" ), MSG_05106_ERROR_MESSAGE_IS( "MSG_05106_ERROR_MESSAGE_IS" ), MSG_05107_NO_SUCH_OBJECT_MATCHED_DN_NOT_SET( "MSG_05107_NO_SUCH_OBJECT_MATCHED_DN_NOT_SET" ), MSG_05108_MATCHED_DN_IS( "MSG_05108_MATCHED_DN_IS" ), MSG_05109_RESULT_CODE_IS( "MSG_05109_RESULT_CODE_IS" ), MSG_05110_ABANDON_MSG_ID_DECODED( "MSG_05110_ABANDON_MSG_ID_DECODED" ), MSG_05111_ADDING_TYPE( "MSG_05111_ADDING_TYPE" ), MSG_05112_ADDING_VALUE( "MSG_05112_ADDING_VALUE" ), MSG_05113_ADDING_ENTRY_WITH_DN( "MSG_05113_ADDING_ENTRY_WITH_DN" ), MSG_05114_LDAP_VERSION( "MSG_05114_LDAP_VERSION" ), MSG_05115_SASL_CREDS_CREATED( "MSG_05115_SASL_CREDS_CREATED" ), MSG_05116_BIND_NAME_IS( "MSG_05116_BIND_NAME_IS" ), MSG_05117_SASL_CREDENTIALS_DECODED( "MSG_05117_SASL_CREDENTIALS_DECODED" ), MSG_05118_THE_SASL_MECHANISM_IS( "MSG_05118_THE_SASL_MECHANISM_IS" ), MSG_05119_SIMPLE_CREDENTIAL_DECODED( "MSG_05119_SIMPLE_CREDENTIAL_DECODED" ), MSG_05120_COMPARE_REQUEST( "MSG_05120_COMPARE_REQUEST" ), MSG_05121_COMPARING_ATTRIBUTE_VALUE( "MSG_05121_COMPARING_ATTRIBUTE_VALUE" ), MSG_05122_COMPARING_ATTRIBUTE_DESCRIPTION( "MSG_05122_COMPARING_ATTRIBUTE_DESCRIPTION" ), MSG_05123_COMPARING_DN( "MSG_05123_COMPARING_DN" ), MSG_05124_DELETING_DN( "MSG_05124_DELETING_DN" ), MSG_05125_EXTENDED_REQUEST_PROCESSED( "MSG_05125_EXTENDED_REQUEST_PROCESSED" ), MSG_05126_OID_READ( "MSG_05126_OID_READ" ), MSG_05127_EXTENDED_VALUE( "MSG_05127_EXTENDED_VALUE" ), MSG_05128_MODIFYING_TYPE( "MSG_05128_MODIFYING_TYPE" ), MSG_05129_NO_VALS_FOR_ATTRIBUTE( "MSG_05129_NO_VALS_FOR_ATTRIBUTE" ), MSG_05130_SOME_VALS_NEED_DECODING( "MSG_05130_SOME_VALS_NEED_DECODING" ), MSG_05131_VALUE_MODIFIED( "MSG_05131_VALUE_MODIFIED" ), MSG_05132_DN_MODIFICATION( "MSG_05132_DN_MODIFICATION" ), MSG_05133_MODIFY_OPERATION( "MSG_05133_MODIFY_OPERATION" ), MSG_05134_MODIFY_DN_REQUEST( "MSG_05134_MODIFY_DN_REQUEST" ), MSG_05135_OID_RDN_ATT_WILL_BE_DELETED( "MSG_05135_OID_RDN_ATT_WILL_BE_DELETED" ), MSG_05136_OID_RDN_ATT_WILL_BE_RETAINED( "MSG_05136_OID_RDN_ATT_WILL_BE_RETAINED" ), MSG_05137_MODIFYING_DN( "MSG_05137_MODIFYING_DN" ), MSG_05138_MODIFYING_WITH_NEW_RDN( "MSG_05138_MODIFYING_WITH_NEW_RDN" ), MSG_05139_NULL_NEW_SUPERIOR( "MSG_05139_NULL_NEW_SUPERIOR" ), MSG_05140_NEW_SUPERIOR_DN( "MSG_05140_NEW_SUPERIOR_DN" ), MSG_05141_INITIALIZE_AND_FILTER( "MSG_05141_INITIALIZE_AND_FILTER" ), MSG_05142_INITIALIZE_APPROX_FILTER( "MSG_05142_INITIALIZE_APPROX_FILTER" ), MSG_05143_INITIALIZE_ATT_DESC_FILTER( "MSG_05143_INITIALIZE_ATT_DESC_FILTER" ), MSG_05144_INITIALIZE_ASSERTION_FILTER( "MSG_05144_INITIALIZE_ASSERTION_FILTER" ), MSG_05145_INITIALIZE_EQ_FILTER( "MSG_05145_INITIALIZE_EQ_FILTER" ), MSG_05146_INITIALIZE_EXT_FILTER( "MSG_05146_INITIALIZE_EXT_FILTER" ), MSG_05147_INITIALIZE_GEQ_FILTER( "MSG_05147_INITIALIZE_GEQ_FILTER" ), MSG_05148_INITIALIZE_LEQ_FILTER( "MSG_05148_INITIALIZE_LEQ_FILTER" ), MSG_05149_INITIALIZE_NOT_FILTER( "MSG_05149_INITIALIZE_NOT_FILTER" ), MSG_05150_INITIALIZE_OR_FILTER( "MSG_05150_INITIALIZE_OR_FILTER" ), MSG_05151_INITIALIZE_PRESENT_FILTER( "MSG_05151_INITIALIZE_PRESENT_FILTER" ), MSG_05152_INITIALIZE_SUBSTRING_FILTER( "MSG_05152_INITIALIZE_SUBSTRING_FILTER" ), MSG_05153_STORED_ANY_SUBSTRING( "MSG_05153_STORED_ANY_SUBSTRING" ), MSG_05154_STORED_FINAL_SUBSTRING( "MSG_05154_STORED_FINAL_SUBSTRING" ), MSG_05155_DN_ATTRIBUTES( "MSG_05155_DN_ATTRIBUTES" ), MSG_05156_STORED_MATCH_VALUE( "MSG_05156_STORED_MATCH_VALUE" ), MSG_05157_SEARCH_REQUEST( "MSG_05157_SEARCH_REQUEST" ), MSG_05158_INITIALIZE_ATT_DESC_LIST( "MSG_05158_INITIALIZE_ATT_DESC_LIST" ), MSG_05159_DECODED_ATT_DESC( "MSG_05159_DECODED_ATT_DESC" ), MSG_05160_SEARCHING_WITH_ROOT_DN( "MSG_05160_SEARCHING_WITH_ROOT_DN" ), MSG_05161_HANDLING_OBJECT_STRATEGY( "MSG_05161_HANDLING_OBJECT_STRATEGY" ), MSG_05162_SEARCHING_WITH_SCOPE( "MSG_05162_SEARCHING_WITH_SCOPE" ), MSG_05163_SIZE_LIMIT_SET_TO( "MSG_05163_SIZE_LIMIT_SET_TO" ), MSG_05164_TIME_LIMIT_SET_TO( "MSG_05164_TIME_LIMIT_SET_TO" ), MSG_05165_SEARCH_RETURN_TYPE_ONLY( "MSG_05165_SEARCH_RETURN_TYPE_ONLY" ), MSG_05166_STORED_TYPE_MATCHING_RULE( "MSG_05166_STORED_TYPE_MATCHING_RULE" ), MSG_05167_ADD_RESPONSE( "MSG_05167_ADD_RESPONSE" ), MSG_05168_SASL_CREDENTIALS_VALUE_STORED( "MSG_05168_SASL_CREDENTIALS_VALUE_STORED" ), MSG_05169_COMPARE_RESPONSE( "MSG_05169_COMPARE_RESPONSE" ), MSG_05170_DEL_RESPONSE( "MSG_05170_DEL_RESPONSE" ), MSG_05171_EXTENDED_RESPONSE( "MSG_05171_EXTENDED_RESPONSE" ), MSG_05172_OID_READ( "MSG_05172_OID_READ" ), MSG_05173_EXTENDED_VALUE( "MSG_05173_EXTENDED_VALUE" ), MSG_05174_INTERMEDIATE_RESPONSE( "MSG_05174_INTERMEDIATE_RESPONSE" ), MSG_05175_VALUE_READ( "MSG_05175_VALUE_READ" ), MSG_05176_MODIFY_RESPONSE( "MSG_05176_MODIFY_RESPONSE" ), MSG_05177_MODIFY_DN_RESPONSE( "MSG_05177_MODIFY_DN_RESPONSE" ), MSG_05178_SEARCH_RESULT_DONE( "MSG_05178_SEARCH_RESULT_DONE" ), MSG_05179_ATTRIBUTE_TYPE( "MSG_05179_ATTRIBUTE_TYPE" ), MSG_05180_NULL_ATTRIBUTE_VALUE( "MSG_05180_NULL_ATTRIBUTE_VALUE" ), MSG_05181_ATTRIBUTE_VALUE( "MSG_05181_ATTRIBUTE_VALUE" ), MSG_05182_SEARCH_RESULT_ENTRY_DN( "MSG_05182_SEARCH_RESULT_ENTRY_DN" ), MSG_05183_SEARCH_RESULT_REFERENCE_RESPONSE( "MSG_05183_SEARCH_RESULT_REFERENCE_RESPONSE" ), MSG_05184_SEARCH_REFERENCE_URL( "MSG_05184_SEARCH_REFERENCE_URL" ), MSG_05185_MODIFY_REQUEST( "MSG_05185_MODIFY_REQUEST" ), // api 5200-5299 MSG_05200_DECODED_LDAP_MESSAGE( "MSG_05200_DECODED_LDAP_MESSAGE" ), MSG_05201_MESSAGE_RECEIVED( "MSG_05201_MESSAGE_RECEIVED" ), MSG_05202_WILL_NOT_USE_SASL_ON_RECEIVE( "MSG_05202_WILL_NOT_USE_SASL_ON_RECEIVE" ), MSG_05203_PARTIAL_SASL_LENGTH_PREFIX( "MSG_05203_PARTIAL_SASL_LENGTH_PREFIX" ), MSG_05204_PARTIAL_SASL_MESSAGE( "MSG_05204_PARTIAL_SASL_MESSAGE" ), MSG_05205_WILL_USE_SASL_UNWRAP( "MSG_05205_WILL_USE_SASL_UNWRAP" ), MSG_05206_FILTERING_WRITE_REQUEST( "MSG_05206_FILTERING_WRITE_REQUEST" ), MSG_05207_DISABLING_SASL_FILTER( "MSG_05207_DISABLING_SASL_FILTER" ), MSG_05208_WILL_NOT_USE_SASL_ON_WRITE( "MSG_05208_WILL_NOT_USE_SASL_ON_WRITE" ), MSG_05209_SENDING_ENCRYPTED_TOKEN( "MSG_05209_SENDING_ENCRYPTED_TOKEN" ), MSG_05210_WILL_USE_SASL_WRAP( "MSG_05210_WILL_USE_SASL_WRAP" ), // controls 5300-5399 MSG_05300_CHANGE_TYPE( "MSG_05300_CHANGE_TYPE" ), MSG_05301_PREVIOUS_DN( "MSG_05301_PREVIOUS_DN" ), MSG_05302_CHANGE_NUMBER( "MSG_05302_CHANGE_NUMBER" ), MSG_05303_SIZE( "MSG_05303_SIZE" ), MSG_05304_CHANGE_TYPES( "MSG_05304_CHANGE_TYPES" ), MSG_05305_CHANGES_ONLY( "MSG_05305_CHANGES_ONLY" ), MSG_05306_RETURN_ECS( "MSG_05306_RETURN_ECS" ), MSG_05307_ATTRIBUTE_TYPE_DESC( "MSG_05307_ATTRIBUTE_TYPE_DESC" ), MSG_05308_REVERSE_ORDER( "MSG_05308_REVERSE_ORDER" ), MSG_05309_MATCHING_RULE_OID( "MSG_05309_MATCHING_RULE_OID" ), MSG_05310_ATTRIBUTE_TYPE( "MSG_05310_ATTRIBUTE_TYPE" ), // osgi 5400-5499 // none // search 5500-5599 // none // api-ldap-codec-standalone 6000-6999 MSG_06000_REGISTERED_CONTROL_FACTORY( "MSG_06000_REGISTERED_CONTROL_FACTORY" ), MSG_06001_REGISTERED_EXTENDED_OP_FACTORY( "MSG_06001_REGISTERED_EXTENDED_OP_FACTORY" ), MSG_06002_REGISTERED_INTERMEDIATE_FACTORY( "MSG_06002_REGISTERED_INTERMEDIATE_FACTORY" ), MSG_06003_CONTROL_FACTORY_ALREADY_LOADED( "MSG_06003_CONTROL_FACTORY_ALREADY_LOADED" ), MSG_06004_REGISTERED_CONTROL_FACTORY( "MSG_06004_REGISTERED_CONTROL_FACTORY" ), MSG_06005_EXTENDED_OP_FACTORY_ALREADY_LOADED( "MSG_06005_EXTENDED_OP_FACTORY_ALREADY_LOADED" ), MSG_06006_INTERMEDIATE_FACTORY_ALREADY_LOADED( "MSG_06006_INTERMEDIATE_FACTORY_ALREADY_LOADED" ), MSG_06007_REGISTRED_INTERMEDIATE_RESP_FACTORY( "MSG_06007_REGISTRED_INTERMEDIATE_RESP_FACTORY" ), // api-ldap-extras-aci 7000-7999 MSG_07000_ATTRIBUTE_TYPE_AND_VALUE_FROM_SET( "MSG_07000_ATTRIBUTE_TYPE_AND_VALUE_FROM_SET" ), MSG_07001_FILTER_SET_PARSED( "MSG_07001_FILTER_SET_PARSED" ), MSG_07002_DN_PARSED( "MSG_07002_DN_PARSED" ), MSG_07003_OID_PARSED( "MSG_07003_OID_PARSED" ), MSG_07004_ACI_ITEM_OR_USER_FIRST_ID_NOT_REQUIRED( "MSG_07004_ACI_ITEM_OR_USER_FIRST_ID_NOT_REQUIRED" ), MSG_07005_CHECK_ACI_ITEM( "MSG_07005_CHECK_ACI_ITEM" ), MSG_07006_PARSING_DN( "MSG_07006_PARSING_DN" ), MSG_07007_PARSING_GRANT_AND_DENIAL( "MSG_07007_PARSING_GRANT_AND_DENIAL" ), MSG_07008_PARSING_ITEM_PERMISSION( "MSG_07008_PARSING_ITEM_PERMISSION" ), MSG_07009_PARSING_MAX_COUNT( "MSG_07009_PARSING_MAX_COUNT" ), MSG_07010_PARSING_MAX_VALUE_COUNT( "MSG_07010_PARSING_MAX_VALUE_COUNT" ), MSG_07011_PARSING_PROTECTED_ITEM( "MSG_07011_PARSING_PROTECTED_ITEM" ), MSG_07012_PARSING_REFINEMENT( "MSG_07012_PARSING_REFINEMENT" ), MSG_07013_PARSING_RESTRICTED_VALUE( "MSG_07013_PARSING_RESTRICTED_VALUE" ), MSG_07014_PARSING_SPECIFIC_EXCLUSION( "MSG_07014_PARSING_SPECIFIC_EXCLUSION" ), MSG_07015_PARSING_SUBTREE_SPECIFICATION( "MSG_07015_PARSING_SUBTREE_SPECIFICATION" ), MSG_07016_PARSING_TYPE( "MSG_07016_PARSING_TYPE" ), MSG_07017_PARSING_USER_CLASS( "MSG_07017_PARSING_USER_CLASS" ), MSG_07018_PARSING_USER_PERMISSION( "MSG_07018_PARSING_USER_PERMISSION" ), MSG_07019_PARSING_ACI_ITEM( "MSG_07019_PARSING_ACI_ITEM" ), MSG_07020_PARSING_ACI_ITEM_AUTHENT_LEVEL( "MSG_07020_PARSING_ACI_ITEM_AUTHENT_LEVEL" ), MSG_07021_PARSING_ACI_ITEM_ID_TAG( "MSG_07021_PARSING_ACI_ITEM_ID_TAG" ), MSG_07022_PARSING_ACI_ITEM_ITEM_OR_USER_FIRST( "MSG_07022_PARSING_ACI_ITEM_ITEM_OR_USER_FIRST" ), MSG_07023_PARSING_ACI_ITEM_PRECEDENCE( "MSG_07023_PARSING_ACI_ITEM_PRECEDENCE" ), MSG_07024_PARSING_ATTRIBUTE_TYPE_SET( "MSG_07024_PARSING_ATTRIBUTE_TYPE_SET" ), MSG_07025_PARSING_BASE( "MSG_07025_PARSING_BASE" ), MSG_07026_PARSING_CHOP_AFTER( "MSG_07026_PARSING_CHOP_AFTER" ), MSG_07027_PARSING_CHOP_BEFORE( "MSG_07027_PARSING_CHOP_BEFORE" ), MSG_07028_PARSING_DNS( "MSG_07028_PARSING_DNS" ), MSG_07029_PARSING_GRANT_AND_DENIALS( "MSG_07029_PARSING_GRANT_AND_DENIALS" ), MSG_07030_PARSING_ITEM_FIRST( "MSG_07030_PARSING_ITEM_FIRST" ), MSG_07031_PARSING_ITEM_PERMISSION_GAD( "MSG_07031_PARSING_ITEM_PERMISSION_GAD" ), MSG_07032_PARSING_ITEM_PERMISSION_PRECEDENCE( "MSG_07032_PARSING_ITEM_PERMISSION_PRECEDENCE" ), MSG_07033_PARSING_ITEM_PERMISSION_USER_CLASS( "MSG_07033_PARSING_ITEM_PERMISSION_USER_CLASS" ), MSG_07034_PARSING_ITEM_PERMISSIONS( "MSG_07034_PARSING_ITEM_PERMISSIONS" ), MSG_07035_PARSING_MAXIMUM( "MSG_07035_PARSING_MAXIMUM" ), MSG_07036_PARSING_MINIMUM( "MSG_07036_PARSING_MINIMUM" ), MSG_07037_PARSING_PROTECTED_ITEMS( "MSG_07037_PARSING_PROTECTED_ITEMS" ), MSG_07038_PARSING_REFINEMENTS( "MSG_07038_PARSING_REFINEMENTS" ), MSG_07039_PARSING_SPECIFIC_EXCLUSIONS( "MSG_07039_PARSING_SPECIFIC_EXCLUSIONS" ), MSG_07040_PARSING_USER_CLASSES( "MSG_07040_PARSING_USER_CLASSES" ), MSG_07041_PARSING_USER_FIRST( "MSG_07041_PARSING_USER_FIRST" ), MSG_07042_PARSING_USER_PERMISSION_GAD( "MSG_07042_PARSING_USER_PERMISSION_GAD" ), MSG_07043_PARSING_USER_PERMISSION_PRECEDENCE( "MSG_07043_PARSING_USER_PERMISSION_PRECEDENCE" ), MSG_07044_PARSING_USER_PERMISSION_PROTECTED_ITEM( "MSG_07044_PARSING_USER_PERMISSION_PROTECTED_ITEM" ), MSG_07045_PARSING_USER_PERMISSIONS( "MSG_07045_PARSING_USER_PERMISSIONS" ), MSG_07046_PARSING_VALUES_IN( "MSG_07046_PARSING_VALUES_IN" ), // api-ldap-extras-codec 8000-8999 // <> 8000-8099 MSG_08000_COOKIE( "MSG_08000_COOKIE" ), MSG_08001_REFRESH_DELETES( "MSG_08001_REFRESH_DELETES" ), // controls 8100-8199 MSG_08100_MODE( "MSG_08100_MODE" ), MSG_08101_FLAGS( "MSG_08101_FLAGS" ), MSG_08102_MAX_RETURN_LENGTH( "MSG_08102_MAX_RETURN_LENGTH" ), MSG_08103_PP_RESPONSE_CONTROL_CONTAINER_INITIALIZED( "MSG_08103_PP_RESPONSE_CONTROL_CONTAINER_INITIALIZED" ), MSG_08104_RELOAD_HINT( "MSG_08104_RELOAD_HINT" ), MSG_08105_SYNC_STATE_TYPE( "MSG_08105_SYNC_STATE_TYPE" ), MSG_08106_ENTRY_UUID( "MSG_08106_ENTRY_UUID" ), MSG_08107_VLV_REQUEST_CONTAINER_INITIALIZED( "MSG_08107_VLV_REQUEST_CONTAINER_INITIALIZED" ), MSG_08108_PARENTS_FIRST( "MSG_08108_PARENTS_FIRST" ), MSG_08109_MAX_ATTRIBUTE_COUNT( "MSG_08109_MAX_ATTRIBUTE_COUNT" ), // extended 8200-8399 MSG_08200_CANCEL_ID( "MSG_08200_CANCEL_ID" ), MSG_08201_CONTROL_OID( "MSG_08201_CONTROL_OID" ), MSG_08202_CONTROL_CRITICALITY( "MSG_08202_CONTROL_CRITICALITY" ), MSG_08203_CONTROL_VALUE( "MSG_08203_CONTROL_VALUE" ), MSG_08204_DELAY( "MSG_08204_DELAY" ), MSG_08205_GEN_PASSWORD( "MSG_08205_GEN_PASSWORD" ), MSG_08206_IDENTIFIER( "MSG_08206_IDENTIFIER" ), MSG_08207_ISSUER_DN( "MSG_08207_ISSUER_DN" ), MSG_08208_NEW_PASSWORD( "MSG_08208_NEW_PASSWORD" ), MSG_08209_OLD_PASSWORD( "MSG_08209_OLD_PASSWORD" ), MSG_08210_PARAMETER_TYPE_FOUND( "MSG_08210_PARAMETER_TYPE_FOUND" ), MSG_08211_PARAMETER_VALUE_FOUND( "MSG_08211_PARAMETER_VALUE_FOUND" ), MSG_08212_PROCEDURE_FOUND( "MSG_08212_PROCEDURE_FOUND" ), MSG_08213_SP_LANGUAGE_FOUND( "MSG_08213_SP_LANGUAGE_FOUND" ), MSG_08214_STORES_A_REFERRAL( "MSG_08214_STORES_A_REFERRAL" ), MSG_08215_TARGET_DN( "MSG_08215_TARGET_DN" ), MSG_08216_TIME_OFFLINE( "MSG_08216_TIME_OFFLINE" ), MSG_08217_USER_IDENTITY( "MSG_08217_USER_IDENTITY" ), MSG_08218_KEY_ALGORITHM( "MSG_08218_KEY_ALGORITHM" ), MSG_08219_SUBJECT_DN( "MSG_08219_SUBJECT_DN" ), // intermediate 8300-8399 MSG_08300_NEW_COOKIE( "MSG_08300_NEW_COOKIE" ), MSG_08301_REFRESH_DONE( "MSG_08301_REFRESH_DONE" ), MSG_08302_UUID( "MSG_08302_UUID" ), // api-ldap-extras-codec-api 9000-9999 // <> 9000 - 9099 // none // controls 9100 - 9199 // none // extended 9200 - 9299 // none // intermediate 9300 - 9399 // none // api-ldap-extras-sp 10000-10999 // none // api-ldap-extras-trigger 11000-11999 // none // api-ldap-extra-utils 12000-12999 // none // api-ldap-model 13000 - 13999 // cursor 13100 - 13199 MSG_13100_CLOSING_EMPTY_CURSOR( "MSG_13100_CLOSING_EMPTY_CURSOR" ), MSG_13101_CLOSING_LIST_CURSOR( "MSG_13101_CLOSING_LIST_CURSOR" ), MSG_13102_CLOSING_SET_CURSOR( "MSG_13102_CLOSING_SET_CURSOR" ), MSG_13102_CLOSING_SINGLETON_CURSOR( "MSG_13102_CLOSING_SINGLETON_CURSOR" ), MSG_13103_CREATING_EMPTY_CURSOR( "MSG_13103_CREATING_EMPTY_CURSOR" ), MSG_13104_CREATING_LIST_CURSOR( "MSG_13104_CREATING_LIST_CURSOR" ), MSG_13105_CREATING_SET_CURSOR( "MSG_13105_CREATING_SET_CURSOR" ), MSG_13106_CREATING_SINGLE_CURSOR( "MSG_13106_CREATING_SINGLE_CURSOR" ), // entry 13200 - 13299 MSG_13200_CANT_STORE_ATTRIBUTE( "MSG_13200_CANT_STORE_ATTRIBUTE" ), MSG_13201_DN_CANT_BE_NORMALIZED( "MSG_13201_DN_CANT_BE_NORMALIZED" ), MSG_13202_AT_IS_NULL( "MSG_13202_AT_IS_NULL" ), MSG_13203_MISSING_ATTRIBUTE_IN_ENTRY( "MSG_13203_MISSING_ATTRIBUTE_IN_ENTRY" ), // filter 13300 - 13399 // none // ldif 13400 - 13499 MSG_13400_LDIF_VERSION( "MSG_13400_LDIF_VERSION" ), MSG_13401_PARSED_NO_ENTRY( "MSG_13401_PARSED_NO_ENTRY" ), MSG_13402_PARSED_ONE_ENTRY( "MSG_13402_PARSED_ONE_ENTRY" ), MSG_13403_PARSED_N_ENTRIES( "MSG_13403_PARSED_N_ENTRIES" ), MSG_13404_READ_MODIF( "MSG_13404_READ_MODIF" ), MSG_13405_READ_ATTR( "MSG_13405_READ_ATTR" ), MSG_13406_READ_ENTRY( "MSG_13406_READ_ENTRY" ), MSG_13407_STARTS_PARSING_LDIF( "MSG_13407_STARTS_PARSING_LDIF" ), MSG_13408_END_OF_LDIF( "MSG_13408_END_OF_LDIF" ), MSG_13409_HAS_NEXT_FALSE( "MSG_13409_HAS_NEXT_FALSE" ), MSG_13410_HAS_NEXT_TRUE( "MSG_13410_HAS_NEXT_TRUE" ), MSG_13411_NEXT_CALLED( "MSG_13411_NEXT_CALLED" ), MSG_13412_NEXT_RETURNING_LDIF( "MSG_13412_NEXT_RETURNING_LDIF" ), MSG_13413_NO_VERSION_ASSUMING_1( "MSG_13413_NO_VERSION_ASSUMING_1" ), MSG_13414_LDIF_FILE_EMPTY( "MSG_13414_LDIF_FILE_EMPTY" ), // message 13500 - 13599 MSG_13500_ATTRIBUTE_NOT_IN_SCHEMA( "MSG_13500_ATTRIBUTE_NOT_IN_SCHEMA" ), // name 13600 - 13699 MSG_13600_DN_NOT_IN_CACHE_CREATING( "MSG_13600_DN_NOT_IN_CACHE_CREATING" ), MSG_13601_DN_FOUND_IN_CACHE( "MSG_13601_DN_FOUND_IN_CACHE" ), MSG_13602_PARSED_ATTRIBUTE_TYPE( "MSG_13602_PARSED_ATTRIBUTE_TYPE" ), MSG_13603_DN_CACHE_HIT( "MSG_13603_DN_CACHE_HIT" ), MSG_13604_CANNOT_PARSE_ATTRIBUTE_TYPE( "MSG_13604_CANNOT_PARSE_ATTRIBUTE_TYPE" ), // schema 13700 - 13899 MSG_13700_FAILED_TO_NORMALIZE( "MSG_13700_FAILED_TO_NORMALIZE" ), MSG_13701_SYNTAX_VALID( "MSG_13701_SYNTAX_VALID" ), MSG_13702_REMOVED_FROM_REGISTRY( "MSG_13702_REMOVED_FROM_REGISTRY" ), MSG_13703_AT_WITHOUT_EQ_MR( "MSG_13703_AT_WITHOUT_EQ_MR" ), MSG_13704_CANT_FIND_AT_WITH_SUPERIOR( "MSG_13704_CANT_FIND_AT_WITH_SUPERIOR" ), MSG_13705_CANT_FIND_AT_IN_MAY( "MSG_13705_CANT_FIND_AT_IN_MAY" ), MSG_13706_CANT_FIND_AT_IN_MUST( "MSG_13706_CANT_FIND_AT_IN_MUST" ), MSG_13707_CANT_FIND_AT_FOR_MR( "MSG_13707_CANT_FIND_AT_FOR_MR" ), MSG_13708_CANT_FIND_MR_FOR_AT( "MSG_13708_CANT_FIND_MR_FOR_AT" ), MSG_13709_CANT_FIND_NORM_FOR_MR( "MSG_13709_CANT_FIND_NORM_FOR_MR" ), MSG_13710_CANT_FIND_OC_WITH_SUPERIOR( "MSG_13710_CANT_FIND_OC_WITH_SUPERIOR" ), MSG_13711_CANT_FIND_SYN_FOR_AT( "MSG_13711_CANT_FIND_SYN_FOR_AT" ), MSG_13712_CANT_FIND_SYN_FOR_MR( "MSG_13712_CANT_FIND_SYN_FOR_MR" ), MSG_13713_CANT_FIND_SC_FOR_SYN( "MSG_13713_CANT_FIND_SC_FOR_SYN" ), MSG_13714_CHECKING_ATTRIBUTE_TYPES( "MSG_13714_CHECKING_ATTRIBUTE_TYPES" ), MSG_13715_CHECKING_MATCHING_RULES( "MSG_13715_CHECKING_MATCHING_RULES" ), MSG_13716_CHECKING_OBJECT_CLASSES( "MSG_13716_CHECKING_OBJECT_CLASSES" ), MSG_13717_CHECKING_SYNTAXES( "MSG_13717_CHECKING_SYNTAXES" ), MSG_13718_PARSING_A( "MSG_13718_PARSING_A" ), MSG_13719_REGISTRING_FAILED_ALREADY_PRESENT( "MSG_13719_REGISTRING_FAILED_ALREADY_PRESENT" ), MSG_13720_REGISTRING( "MSG_13720_REGISTRING" ), MSG_13721_REMOVED_WITH_RULE_ID( "MSG_13721_REMOVED_WITH_RULE_ID" ), MSG_13722_RENAMED_SCHEMA_NAME_TO( "MSG_13722_RENAMED_SCHEMA_NAME_TO" ), MSG_13723_FOUND_WITH_OID( "MSG_13723_FOUND_WITH_OID" ), MSG_13724_FOUND_WITH_RULE_ID( "MSG_13724_FOUND_WITH_RULE_ID" ), MSG_13725_AT_WITH_NO_SYNTAX( "MSG_13725_AT_WITH_NO_SYNTAX" ), MSG_13726_MR_WITH_NO_COMPARATOR( "MSG_13726_MR_WITH_NO_COMPARATOR" ), MSG_13727_MR_WITH_NO_NORMALIZER( "MSG_13727_MR_WITH_NO_NORMALIZER" ), MSG_13728_MR_WITH_NO_SYNTAX( "MSG_13728_MR_WITH_NO_SYNTAX" ), MSG_13729_SYN_WITH_NO_SYNTAX_CHECKER( "MSG_13729_SYN_WITH_NO_SYNTAX_CHECKER" ), MSG_13730_SYN_DOES_NOT_REFERENCE( "MSG_13730_SYN_DOES_NOT_REFERENCE" ), MSG_13731_REGISTRED_FOR_OID( "MSG_13731_REGISTRED_FOR_OID" ), MSG_13732_NOT_REFERENCE_ANY( "MSG_13732_NOT_REFERENCE_ANY" ), MSG_13733_NOT_REFERENCED_BY_ANY( "MSG_13733_NOT_REFERENCED_BY_ANY" ), MSG_13734_NOT_REFERENCED( "MSG_13734_NOT_REFERENCED" ), MSG_13735_REFERENCED( "MSG_13735_REFERENCED" ), MSG_13736_UNREGISTERED_SCHEMA_OBJECT( "MSG_13736_UNREGISTERED_SCHEMA_OBJECT" ), MSG_13737_UNREGISTERED_FOR_OID( "MSG_13737_UNREGISTERED_FOR_OID" ), MSG_13738_UNREGISTERED( "MSG_13738_UNREGISTERED" ), MSG_13739_UNREGISTERED_FAILED_NOT_PRESENT( "MSG_13739_UNREGISTERED_FAILED_NOT_PRESENT" ), MSG_13740_UNREGISTERED_FAILED_NOT_FOUND( "MSG_13740_UNREGISTERED_FAILED_NOT_FOUND" ), MSG_13741_UNREGISTRING( "MSG_13741_UNREGISTRING" ), MSG_13742_REGISTERED_SCHEMA_OBJECT( "MSG_13742_REGISTERED_SCHEMA_OBJECT" ), MSG_13743_COMPARING_BITSTRING( "MSG_13743_COMPARING_BITSTRING" ), MSG_13744_COMPARING_CSN_SID( "MSG_13744_COMPARING_CSN_SID" ), MSG_13745_COMPARING_CSN( "MSG_13745_COMPARING_CSN" ), MSG_13746_COMPARING_INTEGER( "MSG_13746_COMPARING_INTEGER" ), MSG_13747_COMPARING_OBJECT_IDENTIFIER( "MSG_13747_COMPARING_OBJECT_IDENTIFIER" ), MSG_13748_COMPARING_OBJECT_IDENTIFIER_FIRST_COMPONENT( "MSG_13748_COMPARING_OBJECT_IDENTIFIER_FIRST_COMPONENT" ), MSG_13749_COMPARING_STRING( "MSG_13749_COMPARING_STRING" ), MSG_13750_COMPARING_TELEPHONE_NUMBER( "MSG_13750_COMPARING_TELEPHONE_NUMBER" ), MSG_13751_COMPARING_UUID( "MSG_13751_COMPARING_UUID" ), MSG_13752_COMPARING_BOOLEAN( "MSG_13752_COMPARING_BOOLEAN" ), MSG_13753_COMPARING_GENERALIZED_TIME_ORDERING( "MSG_13753_COMPARING_GENERALIZED_TIME_ORDERING" ), MSG_13754_COMPARING_NUMERIC_STRING_ORDERING( "MSG_13754_COMPARING_NUMERIC_STRING_ORDERING" ), MSG_13755_COMPARING_OBJECTS( "MSG_13755_COMPARING_OBJECTS" ), MSG_13756_LOOKED_UP_NAME( "MSG_13756_LOOKED_UP_NAME" ), // api-ldap-net-mina 14000 - 14999 MSG_14000_DECODING_PDU( "MSG_14000_DECODING_PDU" ), MSG_14001_NULL_BUFFER( "MSG_14001_NULL_BUFFER" ), MSG_14002_DECODED_LDAP_MESSAGE( "MSG_14002_DECODED_LDAP_MESSAGE" ), MSG_14003_ENCODED_LDAP_MESSAGE( "MSG_14003_ENCODED_LDAP_MESSAGE" ), // api-ldap-schema-converter 15000 - 15999 MSG_15000_NO_SCHEMA_DEFINED( "MSG_15000_NO_SCHEMA_DEFINED" ), MSG_15001_GENERATING_SCHEMA( "MSG_15001_GENERATING_SCHEMA" ), // api-ldap-schema-data 16000 - 16999 MSG_16000_BASE_PATH( "MSG_16000_BASE_PATH" ), MSG_16001_CREATING_DIR( "MSG_16001_CREATING_DIR" ), MSG_16002_DIR_EXISTS( "MSG_16002_DIR_EXISTS" ), MSG_16003_COPYFILE( "MSG_16003_COPYFILE" ), MSG_16004_SCHEMA_DIR_ABSENT( "MSG_16004_SCHEMA_DIR_ABSENT" ), MSG_16005_SCHEMA_DIR_PRESENT( "MSG_16005_SCHEMA_DIR_PRESENT" ), MSG_16006_INITIALIZING_SCHEMA( "MSG_16006_INITIALIZING_SCHEMA" ), MSG_16007_SCHEMA_INITIALIZED( "MSG_16007_SCHEMA_INITIALIZED" ), MSG_16008_LOADING_FROM_USER_SCHEMA( "MSG_16008_LOADING_FROM_USER_SCHEMA" ), MSG_16009_ELEMENT_DOES_NOT_EXIST( "MSG_16009_ELEMENT_DOES_NOT_EXIST" ), MSG_16010_USING_BASE_SCHEMA_DIR( "MSG_16010_USING_BASE_SCHEMA_DIR" ), MSG_16011_SCHEMA_XSCHEMA_DIFF( "MSG_16011_SCHEMA_XSCHEMA_DIFF" ), MSG_16012_URL_SCHEMA_ALL_LDIF( "MSG_16012_URL_SCHEMA_ALL_LDIF" ), MSG_16013_SCHEMA_IS_NULL( "MSG_16013_SCHEMA_IS_NULL" ), MSG_16014_LOADING_DISABLED_SCHEMA( "MSG_16014_LOADING_DISABLED_SCHEMA" ), MSG_16015_LOADING_ENABLED_SCHEMA( "MSG_16015_LOADING_ENABLED_SCHEMA" ), MSG_16016_UNLOADING_SCHEMA( "MSG_16016_UNLOADING_SCHEMA" ), MSG_16017_UNACCEPTED_DISABLED_SCHEMA( "MSG_16017_UNACCEPTED_DISABLED_SCHEMA" ), MSG_16018_SCHEMA_ALREADY_LOADED( "MSG_16018_SCHEMA_ALREADY_LOADED" ), MSG_16019_ENABLED_SCHEMA_ADDED( "MSG_16019_ENABLED_SCHEMA_ADDED" ), MSG_16020_CANNOT_LOAD_SCHEMAOBJECT( "MSG_16020_CANNOT_LOAD_SCHEMAOBJECT" ), MSG_16021_ADDED_INTO_DISABLED_SCHEMA( "MSG_16021_ADDED_INTO_DISABLED_SCHEMA" ), MSG_16022_REMOVED_FROM_ENABLED_SCHEMA( "MSG_16022_REMOVED_FROM_ENABLED_SCHEMA" ), MSG_16023_CANNOT_DELETE_SCHEMAOBJECT( "MSG_16023_CANNOT_DELETE_SCHEMAOBJECT" ), MSG_16024_REMOVED_FROM_DISABLED_SCHEMA( "MSG_16024_REMOVED_FROM_DISABLED_SCHEMA" ), // api-utils 17000 - 17999 MSG_17000_NO_EXPORT_FOUND( "MSG_17000_NO_EXPORT_FOUND" ), MSG_17001_PROCESSING_EXPORTS( "MSG_17001_PROCESSING_EXPORTS" ), MSG_17002_ADDED_PACKAGE( "MSG_17002_ADDED_PACKAGE" ), MSG_17003_ACCEPTED_CANDIDATE_WITH_FILTER( "MSG_17003_ACCEPTED_CANDIDATE_WITH_FILTER" ), MSG_17004_ACCEPTED_CANDIDATE_NO_FILTER( "MSG_17004_ACCEPTED_CANDIDATE_NO_FILTER" ), MSG_17005_REJECTING_CANDIDATE( "MSG_17005_REJECTING_CANDIDATE" ), MSG_17006_COMPARING_OBJECTSTRING( "MSG_17006_COMPARING_OBJECTSTRING" ), MSG_17007_SYNTAX_VALID( "MSG_17007_SYNTAX_VALID" ), MSG_17008_SYNTAX_INVALID( "MSG_17008_SYNTAX_INVALID" ), MSG_17009_NO_EXACT_MATCH( "MSG_17009_NO_EXACT_MATCH" ); /** The error code */ private String errorCode; /** The file containing the errors */ private static final ResourceBundle ERR_BUNDLE = ResourceBundle .getBundle( "org/apache/directory/api/i18n/errors", Locale.ROOT ); /** The file containing the messages */ private static final ResourceBundle MSG_BUNDLE = ResourceBundle .getBundle( "org/apache/directory/api/i18n/messages", Locale.ROOT ); /** * Creates a new instance of I18n. * * @param errorCode the error code */ I18n( String errorCode ) { this.errorCode = errorCode; } /** * Getter for the field errorCode. * * @return the errorCode * @since 0.9.20 */ public String getErrorCode() { return errorCode; } /** * * Translate an error code with argument(s) * * @param err The error code * @param args The argument(s) * @return The translated error */ public static String err( I18n err, Object... args ) { StringBuilder sb = new StringBuilder(); sb.append( err ).append( ' ' ); try { return sb.append( format( ERR_BUNDLE.getString( err.getErrorCode() ), args ) ).toString(); } catch ( Exception e ) { boolean comma = false; sb.append( '(' ); for ( Object obj : args ) { if ( comma ) { sb.append( ',' ); } else { comma = true; } sb.append( obj ); } return sb.append( ')' ).toString(); } } /** * Translate a message code with argument(s) * * @param msg The message code * @param args The argument(s) * @return The translated error */ public static String msg( I18n msg, Object... args ) { StringBuilder sb = new StringBuilder(); sb.append( msg ).append( ' ' ); try { return sb.append( format( MSG_BUNDLE.getString( msg.getErrorCode() ), args ) ).toString(); } catch ( Exception e ) { boolean comma = false; sb.append( '(' ); for ( Object obj : args ) { if ( comma ) { sb.append( ',' ); } else { comma = true; } sb.append( obj ); } return sb.append( ')' ).toString(); } } /** * Translate a message with argument(s) * * @param msg The message * @param args The argument(s) * @return The translated error */ public static String msg( String msg, Object... args ) { try { return format( MSG_BUNDLE.getString( msg ), args ); } catch ( MissingResourceException mre ) { try { return format( msg, args ); } catch ( Exception e ) { StringBuilder sb = new StringBuilder(); boolean comma = false; sb.append( msg ).append( " (" ); for ( Object obj : args ) { if ( comma ) { sb.append( ',' ); } else { comma = true; } sb.append( obj ); } return sb.append( ')' ).toString(); } } } /** * Format a message * * @param pattern The pattern to apply * @param args Tha arguments to inject into the pattern * @return The formatted message */ public static String format( String pattern, Object... args ) { return new MessageFormat( pattern, Locale.ROOT ).format( args ); } } apache-directory-ldap-api-cfb3cee/i18n/src/main/resources/000077500000000000000000000000001525525160600235715ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/resources/org/000077500000000000000000000000001525525160600243605ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/resources/org/apache/000077500000000000000000000000001525525160600256015ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/resources/org/apache/directory/000077500000000000000000000000001525525160600276055ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/resources/org/apache/directory/api/000077500000000000000000000000001525525160600303565ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/resources/org/apache/directory/api/i18n/000077500000000000000000000000001525525160600311355ustar00rootroot00000000000000errors.properties000066400000000000000000002560121525525160600345160ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/resources/org/apache/directory/api/i18n# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # asn1 # asn1 api 0 - 999 ERR_00000_NULL_OR_NEG_LENGTH_NOT_ALLOWED=Null or negative length are not allowed ERR_00001_BIT_NUMBER_OUT_OF_BOUND=Bad bit number: out of bound ERR_00002_CANNOT_FIND_BIT=Cannot get a bit at position {0} when the BitString contains only {1} int(s) #ERR_00032_NULL_OID=Null OID ERR_00003_INVALID_OID=Invalid OID: {0} #ERR_00041_CURRENT_LENGTH_EXCEED_EXPECTED_LENGTH=Current Length is above expected Length # asn1 ber 1000 - 1999 # <> 1000 - 1099 ERR_01000_LENGTH_OVERFLOW=Overflow: can''t have more than 4 bytes long length ERR_01001_LENGTH_EXTENSION_RESERVED=Length reserved extension used ERR_01002_TLV_NULL=The current container TLV is null. ERR_01003_VALUE_LENGTH_ABOVE_EXPECTED_LENGTH=The current Value length {0} is above the expected length {1} ERR_01004_MORE_TLV_EXPECTED=The PDU is decoded, but we should have had more TLVs ERR_01005_TRUNCATED_PDU=Truncated PDU. Some elements are lacking, accordingly to the grammar ERR_01006_LENGTH_TOO_LONG_FOR_DEFINITE_FORM=Length above 126 bytes are not allowed for a definite form Length ERR_01007_PDU_SIZE_TOO_LONG=The PDU current size ({0}) exceeds the maximum allowed PDU size ({1}) ERR_01008_REMAINING_BYTES_FOR_DECODED_PDU=The PDU has been fully decoded but there are still bytes in the buffer. ERR_01009_INDEFINITE_LENGTH_NOT_SUPPORTED=The indefinite length form (0x80) is not supported, use the definite form # actions 1100 - 1199 ERR_01100_INCORRECT_LENGTH=The expected length is incorrect, expected {0}, got {1} ERR_01101_NULL_LENGTH=The length should not be 0 ERR_01102_INVALID_INTEGER=The received bytes can''t be decoded to a valid integer: ''{0}'' # grammar 1200 - 1299 ERR_01200_BAD_TRANSITION_FROM_STATE=Bad transition from state {0}, tag {1} ERR_01201_MANDATORY_TRANSITION_EXPECTED=The TLV has been completed while a mandatory transition is expected: {0} # tlv 1300 - 1399 ERR_01300_CANNOT_PUT_PDU_IN_NULL_BUFFER=Cannot put a PDU in a null buffer ! ERR_01301_PDU_BUFFER_SIZE_TOO_SMALL=The PDU buffer size is too small ! ERR_01302_0_BYTES_LONG_BOOLEAN=The value is 0 byte long. This is not allowed for a boolean ERR_01303_N_BYTES_LONG_BOOLEAN=The value is not 1 byte long. This is not allowed for a boolean ERR_01304_0_BYTES_LONG_INTEGER=The value is 0 byte long. This is not allowed for an integer ERR_01305_ABOVE_4_BYTES_INTEGER=The value is more than 4 bytes long. This is not allowed for an integer ERR_01306_VALUE_NOT_IN_RANGE=The value is not in the range [{0}, {1}] ERR_01307_0_BYTES_LONG_LONG=The value is 0 byte long. This is not allowed for a long ERR_01308_ZERO_LENGTH_TLV=The TLV has a zero length. This is not allowed ERR_01309_EMPTY_TLV=The LdapMessage should not be empty ERR_01310_INTEGER_DECODING_ERROR=The integer cannot be decoded: {0} ERR_01311_NEGATIVE_LENGTH=The length should not be negative # asn1-codec ERR_01001=Encoded result is not a ByteBuffer: {0} # dsml-engine 2000-2999 ERR_02000_FAILED_PROCESSING_DSML=Failed to process the DSML ERR_02001_UNEXPECTED_REQUEST_TYPE=Unexpected request type {0} ERR_02002_MISSING_CONNECTION_TO_BIND=Missing connection, can not bind ERR_02003_LINE_COLUMN={0} - Line {1} - Column {2} ERR_02004_MISSING_REQUEST_ID=A requestID must be specified to each request when Processing is Parallel and ReponseOrder is Unordered. ERR_02005_INTERNAL_ERROR=Internal Error: {0} # dsml-parser 3000-3999 ERR_03000_REQUEST_ID_REQUIRED=requestID attribute is required ERR_03001_DN_ATTRIBUTE_REQUIRED=dn attribute is required ERR_03002_NAME_ATTRIBUTE_REQUIRED=name attribute is required ERR_03003_UNABLE_TO_FIND_BATCH_REQUEST=unable to find the batch request ERR_03004_UNKNOWN_TYPE=Unknown type ERR_03005_REQUIRE_ATTRIBUTE_TYPE=type attribute is required ERR_03006_INCORRECT_TYPE_ATTRIBUTE_VALUE=Incorrect value for ''type'' attribute. This is not an OID. ERR_03007_INCORRECT_CRITICALITY_VALUE=Incorrect value for ''criticality'' attribute ERR_03008_UNEXPECTED_ERROR=An unexpected error ocurred: {0} ERR_03009_RESULT_CODE_NOT_INTEGER=the given resultCode is not an integer ERR_03010_CODE_ATTRIBUTE_REQUIRED=code attribute is required ERR_03011_DESCR_DOESNT_MATCH_VALUES=descr (''{0}'') doesn''t match with the possible values ERR_03012_REQUEST_ID_NOT_INTEGER=The given requestID is not an integer ERR_03013_UNKNOWN_PROCESSING_VALUE=Unknown value for ''processing'' attribute. ERR_03014_UNKNOWN_ON_ERROR_VALUE=Unknown value for ''onError'' attribute. ERR_03015_UNKNOWN_RESPONSE_ORDER_VALUE=Unknown value for ''responseOrder'' attribute. ERR_03016_BELOW_0_REQUEST_ID=The attribute requestID {0} can''t be below 0 ERR_03017_ABANDON_ID_NOT_INTEGER=the given abandonID is not an integer ERR_03018_ABANDON_ID_REQUIRED=abandonID attribute is required ERR_03019_IO_EXCEPTION_OCCURED=An IOException occurred during parsing: {0} ERR_03020_CANT_ADD_ATTRIBUTE_VALUE=can not add attribute value ERR_03021_PRINCIPAL_ATTRIBUTE_REQUIRED=principal attribute is required ERR_03022_NULL_REQUEST_NAME=The request name can''t be null ERR_03023_NEW_RDN_ATTRIBUTE_REQUESTED=newrdn attribute is required ERR_03024_INCORRECT_DELETE_OLD_RDN_VALUE=Incorrect value for ''deleteoldrdn'' attribute ERR_03025_OPERATION_ATTRIBUTE_REQUIRED=operation attribute is required ERR_03026_UNKNOWN_SCOPE=unknown scope. Scope must be ''baseObject'', ''singleLevel'' or ''wholeSubtree''. ERR_03027_SCOPE_ATTRIBUTE_REQUIRED=scope attribute is required ERR_03028_UNKNOWN_DEREFALIAS_VALUE=unknown derefAliases value. derefAliases must be ''neverDerefAliases'', ''derefInSearching'', ''derefFindingBaseObj'' or ''derefAlways''. ERR_03029_DEREFALIA_ATTRIBUTE_REQUIRED=derefAliases attribute is required ERR_03030_SIZE_LIMIT_NOT_INTEGER=the given sizeLimit is not an integer ERR_03031_TIME_LIMIT_NOT_INTEGER=the given timeLimit is not an integer ERR_03032_TYPES_ONLY_NOT_BOOLEAN=typesOnly must be a boolean (''true'' or ''false''). ERR_03033_DN_ATTRIBUTES_NOT_BOOLEAN=dnAttributes must be a boolean (''true'' or ''false''). ERR_03034_INCORRECT_TYPE_VALUE=Incorrect value for ''type'' attribute. This is not an OID. ERR_03035_TYPE_ATTRIBUTE_REQUIRED=type attribute is required ERR_03036_MISSING_TAG=The tag {0} can''t be found at this position ERR_03037_UNEXPECTED_FILTER_TYPE=Unexpected filter type {0} ERR_03038_BAD_OID=Bad oid: {0} ERR_03039_PARSING_ERROR={0} ERR_03040_UNKNOWN_OPERATION=Unknown operation. Operation can be ''add'', ''delete'' or ''replace''. ERR_03041_NO_FILTER_ELEMENT=No filter element present in the DSML search request ERR_03042_UNEXPECTED_FILTER_TYPE=Unexpected filter type {0} ERR_03043_UNEXPECTED_DEREF_ALIAS=Unexpected deref alias mode {0} ERR_03044_SHOULD_NOT_BE_A_DECORATOR=This should not be a decorator, but seems it was made into one.\n We need to do something about this if this exception is being raise. ERR_03045_UNIDENTIFIED_RESPONSE_TYPE=Unidentified search resp type ERR_03046_FILTER_MAX_DEPTH_EXCEEDED=The search filter is nested more than {0} levels deep. Use LdapMessageContainer.setMaxFilterDepth( int ) if deeper filters really have to be accepted. ERR_03047_INVALID_BASE64_VALUE=Invalid Base 64 encoded value : {0} ERR_03048_FILTER_TOO_DEEP=The filter is nested more than {0} levels deep. Use SearchRequestDsml.setMaxFilterDepth( int ) if deeper filters really have to be accepted." ERR_03049_DN_ATTRIBUTE_REQUIRED=dn attribute is required # dsml-engine # api-ldap-client-api 4000-4999 # api-ldap-client-api <> 4000-4100 # api-ldap-client-api api 4100-4200 ERR_04100_UNABLE_TO_UNBIND=unable to unbind connection: {0} ERR_04101_CANNOT_CREATE_LDAP_CONNECTION_FACTORY=unable to create LdapConnectionFactory {0} ERR_04102_UNABLE_TO_BIND_CONNECTION=unable to bind connection: {0} ERR_04103_UNABLE_TO_CLOSE_FAILED_CONNECTION=unable to close failed bind connection: {0} ERR_04104_NULL_CONNECTION_CANNOT_CONNECT=Cannot connect on the server, the connection is null ERR_04105_CONNECTION_NOT_AUTHENTICATED=connection is not authenticated ERR_04106_OPERATION_NOT_SUPPORTED=Operation not supported ERR_04107_UNEXPECTED_THROWN_EXCEPTION=An unexpected exception was thrown: {0} ERR_04108_INVALID_CONNECTION=Cannot connect on the server, the connection is invalid ERR_04109_CANNOT_CONNECT=Cannot connect ERR_04110_CANNOT_CONNECT_TO_SERVER=Cannot connect to the server: {0} ERR_04111_UNKNOWN_RESPONSE_FUTURE_TYPE=Unknown ResponseFuture type: {0} ERR_04112_OP_FAILED_TIMEOUT={} failed: timeout occurred ERR_04113_ERROR_PROCESSING_NOD=Error while processing the NoD for {} ERR_04114_CURSOR_CLOSE_FAIL=Failed to close open cursor ERR_04115_ERROR_LOADING_SCHEMA=There are errors while loading the schema ERR_04116_FAIL_LOAD_SCHEMA=Failed to load the schema ERR_04117_FAIL_LOAD_SCHEMA_FILE=Failed to load the schema from file {} ERR_04118_SOMETHING_WRONG_HAPPENED=Message failed: something wrong has occurred ERR_04119_TIMEOUT=Timeout has occurred ERR_04120_TLS_HANDSHAKE_ERROR=The TLS handshake failed ERR_04121_CANNOT_RESOLVE_HOSTNAME=Cannot connect to the server, Hostname ''{0}'' could not be resolved. ERR_04122_SSL_CONTEXT_INIT_FAILURE=Failed to initialize the SSL context ERR_04123_CANNOT_ADD_EMPTY_ENTRY=Cannot add an empty entry ERR_04124_CANNOT_PROCESS_NULL_ADD_REQUEST=Cannot process a null addRequest ERR_04125_CANNOT_ADD_NULL_ENTRY=Cannot add a null entry ERR_04126_CANNOT_ABANDON_NEG_MSG_ID=Cannot abandon a negative message ID ERR_04127_CANNOT_PROCESS_NULL_ABANDON_REQ=Cannot process a null abandonRequest ERR_04128_CANNOT_PROCESS_NULL_BIND_REQ=Cannot process a null bindRequest ERR_04129_NULL_BASE_DN=The base Dn cannot be null ERR_04130_CANNOT_PROCESS_NULL_SEARCH_REQ=Cannot process a null searchRequest ERR_04131_CANNOT_PROCESS_SEARCH_NULL_DN=Cannot process a searchRequest which base DN is null ERR_04132_UNEXPECTED_RESPONSE_TYPE=Unexpected response type {0} ERR_04133_NULL_MODIFIED_ENTRY=Entry to be modified cannot be null ERR_04134_NULL_MODIFIED_DN=The Dn to be modified cannot be null ERR_04135_CANNOT_PROCESS_NO_MODIFICATION_MOD=Cannot process a ModifyRequest without any modification ERR_04136_CANNOT_PROCESS_NULL_MOD_REQ=Cannot process a null modifyRequest ERR_04137_CANNOT_PROCESS_MOD_NULL_DN=Cannot process a modifyRequest which DN is null ERR_04138_CANNOT_PROCESS_RENAME_NULL_DN=Cannot process a rename of a null Dn ERR_04139_CANNOT_PROCESS_RENAME_NULL_RDN=Cannot process a rename with a null Rdn ERR_04140_CANNOT_PROCESS_MOVE_NULL_DN=Cannot process a move of a null Dn ERR_04141_CANNOT_PROCESS_MOVE_NULL_SUPERIOR=Cannot process a move to a null newSuperior ERR_04142_NULL_ENTRY_DN=The entry Dn must not be null ERR_04143_CANNOT_MOVE_ROOT_DSE=The RootDSE cannot be moved ERR_04144_NULL_NEW_DN=The new Dn must not be null ERR_04145_ROOT_DSE_CANNOT_BE_TARGET=The RootDSE cannot be the target ERR_04146_CANNOT_PROCESS_NULL_MODDN_REQ=Cannot process a null modDnRequest ERR_04147_CANNOT_PROCESS_MOD_NULL_DN_SUP=Cannot process a modifyRequest which new superior and new Rdn are null ERR_04148_SUBTREE_CONTROL_NOT_SUPPORTED=The subtreeDelete control (1.2.840.113556.1.4.805) is not supported by the server\n The deletion has been aborted ERR_04149_CANNOT_PROCESS_NULL_DEL_REQ=Cannot process a null deleteRequest ERR_04150_CANNOT_PROCESS_NULL_DEL_NULL_DN=Cannot process a deleteRequest which DN is null ERR_04151_CANNOT_PROCESS_NULL_COMP_REQ=Cannot process a null compareRequest ERR_04152_CANNOT_PROCESS_NULL_DN_COMP_REQ=Cannot process a compareRequest which DN is null ERR_04153_OID_DECODING_FAILURE=Failed to decode the OID {0} ERR_04154_CANNOT_PROCESS_NULL_EXT_REQ=Cannot process a null extendedRequest ERR_04155_ROOT_DSE_SEARCH_FAILED=Search for root DSE returned no entry ERR_04156_FAILED_FETCHING_ROOT_DSE=Failed to fetch the RootDSE ERR_04157_CANNOT_USE_TLS_WITH_SSL_FLAG=Cannot use TLS when the useSsl flag is set true in the configuration ERR_04158_CANNOT_FIND_SASL_FACTORY_FOR_MECH=Cannot find a SASL factory for the {0} mechanism ERR_04159_PROTOCOL_ERROR=Protocol error ERR_04160_SESSION_HAS_BEEN_CLOSED=Error while sending some message: the session has been closed ERR_04161_START_TLS_EXT_NOT_VALID_OID=StartTlsRequest.EXTENSION_OID is not a valid oid... This can''t happen ERR_04162_INITIAL_PART_NEEDED=An ''initial'' part is needed ERR_04163_FINAL_PART_NEEDED=A ''final'' part is needed ERR_04164_ANY_PART_NEEDED=At least one ''any'' part is needed ERR_04165_INITIAL_ANY_FINAL_PART_NEEDED=At least one of ''initial'', ''any'' or ''final'' part is needed ERR_04166_ONE_FILTER_REQUIRED=At least one filter required ERR_04167_FILTER_NOT_SET=Filter not set ERR_04168_TRIM_LOWERCASE_FOR_CHAR_ARRAY=Trim and lowerCase only applicable to char[] ERR_04169_RESPONSE_QUEUE_EMPTIED=The response queue has been emptied, no response was found. ERR_04170_TIMEOUT_OCCURED=TimeOut occurred when calling function {0} ERR_04171_CANNOT_PARSE_MATCHED_DN=Could not parse matchedDn while transforming Codec value to Internal: {0} ERR_04172_KEYSTORE_INIT_FAILURE=Keystore initialisation failure ERR_04173_ALGORITHM_NOT_FOUND=Not TrustManagerFactory found for algorithm ''{0}'' ERR_04174_INPUT_FILE_NAME_NULL=LdapClientTrustStoreManager constructor : input file name is null ERR_04175_TRUST_STORE_FILE_NULL=TrustStoreFile : file not found ERR_04176_TRUST_MANAGER_NOT_FOUND=LdapClientTrustStoreManager.getTrustManagers : file not found ERR_04177_NO_SUCH_ALGORITHM=LdapClientTrustStoreManager.loadTrustManagers caught NoSuchAlgorithmException ERR_04178_CANT_LOAD_KEY_STORE=LdapClientTrustStoreManager.loadTrustManagers caught KeyStoreException ERR_04179_TRUST_STORE_CANT_BE_READ=LdapClientTrustStoreManager.getTrustStore finally block on input stream close operation caught IOException={0} ERR_04180_FILE_DOES_NOT_EXIST_ON_CLASSPATH=LdapClientTrustStoreManager.getTrustStoreInputStream file does not exist on classpath ERR_04181_INVALID_FILTER_ATTRIBUTE_DESCRIPTIONT=Invalid attribute description : {0} ERR_04182_INVALID_MATCHING_RULE= Invalid Matching Rule : {0} ERR_04183_TRUSTMANAGERS_CANT_BE_NULL=TrustManagers must not be null or empty ERR_04184_FAILED_RELEASE_CONNECTION=Failed to release connection to pool ERR_04185_CANT_READ_SCHEMA=Unable to read schema at: {0} # api-ldap-client-api template 4200-4300 # api-ldap-codec-core 5000-5999 # api-ldap-codec-core <> 5000-5099 ERR_05000_NULL_REQUEST_NAME=The request name must not be null ERR_05001_EMPTY_MATCHING_RULE=The matching rule is empty ERR_05002_ENTRY_NULL_VALUE=Entry can''t be null # api-ldap-codec-core actions 5100-5199 ERR_05100_ZERO_LENGTH_MESSAGE_ID_NOT_ALLOWED=The messageId has a zero length. This is not allowed ERR_05101_NULL_MESSAGE_ID_NOT_ALLOWED=The messageId should not be null ERR_05102_INVALID_MESSAGE_ID=The Message Id {0} is invalid: {1}. The message ID must be between (0 .. 2 147 483 647) ERR_05103_INVALID_URL=The URL {0} is not valid: {1} ERR_05104_INVALID_URL=Invalid URL: {0} ERR_05105_REFERRAL_MUST_NOT_BE_NULL=The Referrals must not be null ERR_05106_INCORRECT_DN_GIVEN_INVALID=Incorrect DN given: {0} ({1}) is invalid: {2} ERR_05107_INCORRECT_DN_GIVEN=Incorrect DN given: {0} ERR_05108_INVALID_RESULT_CODE=The result code {0} is invalid: {1}. The result code must be between (0 .. 121) ERR_05109_ABANDON_REQ_MSG_ID_NULL=The AbandonRequest messageId must not be null ERR_05110_INVALID_ABANDON_REQ_MSG_ID=The Abandoned Message Id {0} is invalid: {1}. The message ID must be between (0 .. 2 147 483 647) ERR_05111_NULL_OR_EMPTY_TYPE_NOT_ALLOWED=Null or empty types are not allowed ERR_05112_ERROR_WITH_ATTRIBUTE_TYPE=Error while injecting the AttributeType ERR_05113_INVALID_DN=Invalid Dn given: {0} ({1}) is invalid" ERR_05114_ERROR_MESSAGE={0} : {1}" ERR_05115_EMTPY_ENTRY_DN_GIVEN=Empty entry DN given ERR_05116_SASL_CREDS_CANT_BE_NULL=The SaslCredential must not be null ERR_05117_INVALID_VERSION=The version {0} is invalid: {1}. The version must be between (0 .. 127) ERR_05118_NULL_ATTRIBUTE_DESC=The attribute description must not be null ERR_05119_NULL_ENTRY=The entry must not be null ERR_05120_INVALID_DELETE_DN=The DN to delete: {0} ({1}) is invalid: {2} ERR_05121_INVALID_REQUEST_NAME_OID=The Request name is not a valid OID : {0} ({1}) is invalid ERR_05122_NULL_NAME=The name must not be null ERR_05123_TYPE_CANT_BE_NULL=The type can''t be null ERR_05124_INVALID_OPERATION=Invalid operation ({0}), it should be 0, 1 or 2 ERR_05125_INVALID_OLD_RDN=The oldRdn flag {0} is invalid: {1}. It should be 0 or 255 ERR_05126_RDN_MUST_NOT_BE_NULL=The newrdn must not be null ERR_05127_INVALID_NEW_RDN=Invalid new Rdn given : {0} ({1}) is invalid ERR_05128_NULL_SUPERIOR=The new superior must not be null if the flag ''delete old DN'' is set to true ERR_05129_INVALID_NEW_SUPERIOR=Invalid new superior Dn given : {0} ({1}) is invalid ERR_05130_NON_NULL_UNBIND_LENGTH=The length of a UnBindRequest must be null, the actual value is {0} ERR_05131_UNBIND_REQUEST_LENGTH_MUST_BE_NULL=The length of a UnBindRequest must be null ERR_05132_INVALID_ROOT_DN=Invalid root Dn given : {0} ({1}) is invalid ERR_05133_INTERMEDIATE_RESPONSE_INVALID_OID=The Intermediate Response name is not a valid OID : {0} ({1}) is invalid ERR_05134_EMPTY_AND_FILTER_PDU=The And filter PDU must not be empty ERR_05135_EMPTY_ATTRIBUTE_DESCRIPTION=The attribute description is empty ERR_05136_EMPTY_NOT_FILTER_PDU=The Not filter PDU must not be empty ERR_05137_EMPTY_OR_FILTER_PDU=The Or filter PDU must not be empty ERR_05138_EMPTY_SUBSTRING_FILTER_PDU=The Substring filter PDU must not be empty ERR_05139_EMPTY_SUBSTRING_ANY_FILTER_PDU=The substring any filter is empty ERR_05140_EMPTY_SUBSTRING_FINAL_FILTER_PDU=The substring final filter is empty ERR_05141_NULL_MATCHING_RULE_ASSERTION_TYPE=The type cannot be null in a MatchingRuleAssertion ERR_05142_ZERO_LENGTH_MESSAGE=The LdapMessage has a zero length. This is not allowed ERR_05143_EMPTY_MESSAGE=The LdapMessage should not be empty ERR_05144_NULL_BIND_REQUEST=The BindRequest must not be null ERR_05145_NULL_ADD_REQUEST=The AddRequest must not be null ERR_05146_NULL_ADD_RESPONSE=The AddResponse must not be null ERR_05147_NULL_ATTRIBUTE_TYPE=The AttributeType can''t be empty ERR_05148_NULL_COMPARE_REQUEST=The CompareResponse must not be null ERR_05149_BAD_SCOPE=The scope is not in [0..2]: {0} ERR_05150_BAD_DEREF_ALIAS=The derefAlias is not in [0..3]: {0} ERR_05151_BAD_SIZE_LIMIT=The sizeLimit is not a valid Integer: {0} ERR_05152_BAD_TIME_LIMIT=The timeLimit is not a valid Integer: {0} ERR_05153_NULL_ATTRIBUTE_DESCRIPTION=The attribute description should not be null ERR_05154_EMPTY_SUBSTRING_INITIAL_FILTER_PDU=The substring initial filter is empty ERR_05155_FLAG_TYPE_INVALID=The types only flag {0} is invalid: {1}. It should be 0 or 255 ERR_05156_INVALID_ATTRIBUTE_TYPE=The Attribute type {0} is invalid : {1} ERR_05157_INVALID_DN=The Dn {0} is invalid : {1} ERR_05158_INVALID_REQUEST_VALUE=The encoded value ''{0}'' cannot be decoded ERR_05159_INVALID_RESPONSE_NAME_OID=The Response name is not a valid OID : {0} ({1}) is invalid ERR_05160_MORE_THAN_ONE_VALUE_INCREMENT_MOD_OP=The Increment modification operation accepts only one value ERR_05161_MISPLACED_FILTER_TLV=The filter element {0} is not nested inside its expected enclosing filter element # api-ldap-codec-core api 5200-5299 ERR_05200_NOT_INITIALIZED_YET=Not initialized yet! ERR_05201_INSTANCE_ALREADY_SET=The LdapCodecService is already set to an instance of {0} ERR_05202_FAILED_TO_INSTANCIATE=Failed to instantiate a viable instance, instantiating new instance of {0} ERR_05203_CODEC_ARGS_CANNOT_BE_NULL=Codec argument cannot be null ERR_05204_LDAP_DECODER_FAILURE=Ldap decoder failure: {0} ERR_05205_PDU_DOES_NOT_CONTAIN_ENOUGH_DATA=Ldap decoder failure, PDU does not contain enough data ERR_05206_INPUT_STREAM_TOO_SHORT_PDU=The input stream does not contain a full PDU ERR_05207_INVALID_SASL_LENGTH_PREFIX=Invalid SASL length prefix {0}, negotiated receive buffer size limit: {1} ERR_0528_NEGOCIATED_MAX_BUFFER_TOO_SMALL=0Negotiated max buffer size {0} is too small to wrap any data # api-ldap-codec-core controls 5300-5399 ERR_05300_CANT_DECODE_CHANGE_TYPE=failed to decode the changeType for EntryChangeControl ERR_05301_INVALID_PREVIOUS_DN=The previousDN field should not contain anything if the changeType is not MODDN ERR_05302_PREVIOUS_DN_NOT_ALLOWED=Previous DN is not allowed for this change type ERR_05303_BAD_PREVIOUS_DN=Bad Previous DN: ''{0}'' ERR_05304_FAILED_TO_DECODE_PREVIOUS_DN=failed to decode the previous DN ERR_05305_CHANGE_NUMBER_DECODING_ERROR=failed to decode the changeNumber for EntryChangeControl ERR_05306_PAGED_SEARCH_SIZE_DECODING_ERROR=failed to decode the size for PagedSearchControl ERR_05307_CHANGE_TYPES_DECODING_ERROR=failed to decode the changeTypes for PSearchControl ERR_05308_CHANGE_ONLY_DECODING_ERROR=failed to decode the changesOnly for PSearchControl ERR_05309_RETURN_ECS_DECODING_ERROR=failed to decode the returnECs for PSearchControl ERR_05310_INVALID_VISIBILITY_FLAG=The visibility flag {0} is invalid: {1}. It should be 0 or 255 # api-ldap-codec-core osgi 5400-5499 ERR_05400_CONTROL_ARGUMENT_WAS_NULL=Control argument was null. ERR_05401_FIGURE_OUT_HOW_TO_TRANSFORM=Figure out how to transform ERR_05402_UNABLE_TO_ENCODE_RESPONSE_VALUE=Unable to decode encoded response value: {0} # api-ldap-codec-core search 5500-5599 ERR_05500_NULL_MATCHING_RULE_AND_TYPE=Cannot have a null matching rule and a null type ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER=Cannot have more than one Filter within a Not Filter ERR_05502_NULL_INITIAL_ANY_OR_FINAL_SUBSTRING=Cannot have a null initial, any and final substring ERR_05503_UNEXPECTED_FILTER_TYPE=Unexpected filter type: {0} # api-ldap-codec-standalone 6000-6999 ERR_06000_FAILED_TO_LOAD_DEFAULT_CODEC_FACTORY=Failed to load default codec factory. # api-ldap-extras-aci 7000-7999 ERR_07000_FILTER=filter ERR_07001_NULL_IDENTIFICATION_TAG=identificationTag parameter is null ERR_07002_BAD_PRECENDENCE=precedence parameter not in [0-255]: {0} ERR_07003_NULL_AUTHENTICATION_LEVEL=authenticationLevel parameter is null ERR_07004_PARSER_FAILURE_ACI_ITEM=Parser failure on ACIItem:\n\t{0}\nAntlr exception trace:\n{1} [Line:{2} - Column:{3}] ERR_07005_MISSING_MANDATORY_ACIITEM=Missing mandatory ACIItem components: {0} ERR_07006_EXPECTING_INTEGER_TOKEN=Expecting INTEGER token having an Integer value between 0 and 255, found {0} ERR_07007_DUPLICATED_PROTECTED_ITEM=Protected Items cannot be duplicated. {0} ERR_07008_DN_PARSER_FAILED=dnParser failed for {0} , {1} ERR_07009_FILTER_PARSER_FAILED=filterParser failed. {0} ERR_07010_DUPLICATED_GRANT_AND_DENIAL=Duplicated GrantAndDenial bit: {0} ERR_07011_DUPLICATED_USER_CLASSES=User Classes cannot be duplicated. {0} ERR_07012_MISSING_MANDATORY_USER_PERMISSION=Missing mandatory userPermission components: {0} ERR_07013_UNKNOWN_GRANT_AND_DENIAL=The parsed Grant and Denial does not exist: ''{0}}'' ERR_07014_MISSING_GRANTS_AND_DENIALS_TOKEN=The ''GrantsAndDenials'' token is missing, found: ''{0}}'' ERR_07015_MISSING_MANDATORY_SPACES=The parsed ACIItem requires some space, which are missing ERR_07016_BAD_REFINEMENT=The parsed ACIItem refinement must be AND, OR, NOT or Item, got ''{0}'' ERR_07017_BAD_SPECIFIC_EXCLUSION=The parsed ACIItem specific exclusion must be either ''chopBefore'' or ''chopAfter'', was ''{0}'' ERR_07018_BAD_SUBTREE_SPECIFICATION=The parsed ACIItem subtreeSpecification must have one of ''base', ''minimum'', 'maximum'' or ''specificExclusion', got ''{0}'' ERR_07019_SUBTREE_SPECIFICATION_BASE_SEEN=The parsed ACIItem subtreeSpecification Base has already been parsed ERR_07020_SUBTREE_SPECIFICATION_MINIMUM_SEEN=The parsed ACIItem subtreeSpecification Minimum has already been parsed ERR_07021_SUBTREE_SPECIFICATION_MAXIMUM_SEEN=The parsed ACIItem subtreeSpecification Maximum has already been parsed ERR_07022_SUBTREE_SPECIFICATION_EXCLUSIONS_SEEN=The parsed ACIItem subtreeSpecification SpecificExclusions has already been parsed ERR_07023_MAX_COUNT_TOKEN_EXPECTED=Parser failure on ACIItem: the ''maxCount'' token is expected, got: ''{0}'' ERR_07024_MAX_COUNT_MISSING_ATTRIBUTE_TYPE=The max count value is for an AttributeType that can't be found for oid ''{0}'' ERR_07025_EXPECTED_MAX_COUNT_OR_TYPE=The maxCountValue should start with either ''maxCount'' or ''type'', got ''{0}'' ERR_07026_TYPE_TOKEN_EXPECTED=Parser failure on ACIItem: the ''type'' token is expected, got: ''{0}'' ERR_07027_VALUES_IN_TOKEN_EXPECTED=Parser failure on ACIItem: the ''valuesIn'' token is expected, got: ''{0}'' ERR_07028_TYPE_INVALID_ATTRIBUTE=The type attributeType is invalid for oid ''{0}'' ERR_07029_VALUES_IN_INVALID_ATTRIBUTE=The valuesIn attributeType is invalid for oid ''{0}'' ERR_07030_EXPECTED_VALUES_IN_OR_TYPE=The restrictedValue should start with either ''valuesIn'' or ''type'', got ''{0}'' ERR_07031_MISSING_ITEM_PERMISSIONS_TOKEN=The ''itemPermissions'' token is missing at {0} ERR_07032_MISSING_USER_PERMISSIONS_TOKEN=The ''UserPermissions'' token is missing, found: ''{0}'' ERR_07033_UNKNOWN_PROTECTED_ITEM=The parsed protected item does not exist: ''{0}'' ERR_07034_MISSING_EXPECTED_CLOSING_CURLY=There is a missing closing accolade ERR_07035_MISSING_GRANTS_AND_DENIALS=The UserPermission requires a set of Grants and Denials, got: ''{0}'' ERR_07036_MISSING_PROTECTED_ITEMS=The UserPermission requires a set of Protected Items, got: ''{0}'' ERR_07037_BAD_USER_CLASS=The read token ''{0}'' is not correct, one of ''allUsers'', ''thisEntry'', ''parentOfEntry'', ''name'', ''userGroup'' or ''subtree'' expected ERR_07038_MISSING_IDENTIFIER_TAG=The ACIItem must have an IdentifierTag, got ''{0}'' ERR_07039_MISSING_PRECEDENCE=The ACIItem must have a precedence, got ''{0}'' ERR_07040_MISSING_AUTHENTICATION_LEVEL=The ACIItem must have an authentication level, got ''{0}'' ERR_07041_WRONG_AUTHENTICATION_LEVEL=The ACIItem authentication level must be one of NONE, SIMPLE or STRONG, got ''{0}'' ERR_07042_MISSING_PROTECTED_ITEMS_TOKEN=The ''protectedItems'' token is missing, got ''{0}'' ERR_07043_MISSING_ITEM_FIRST_RIGHT_CURLY=The ''itemFirst'' part is missing a closing ''}'' ERR_07044_MISSING_USER_FIRST_RIGHT_CURLY=The ''userFirst'' part is missing a closing ''}'' ERR_07045_BAD_ATTRIBUTE_TYPE=The provided AttributeType ''{0}'' is unknown ERR_07046_BAD_ATTRIBUTE_TYPE_OR_VALUE=The provided aAttributeType ''{0}'' or value ''{1}'' are invalid ERR_07047_MISSING_USER_CLASSES_TOKEN=The ''UserClasses'' token is missing, found: ''{0}'' ERR_07048_IDENTIFICATION_TAG_ALREADY_SEEN= The ''identificationTag'' has already been parsed ERR_07049_PRECEDENCE_ALREADY_SEEN= The ''precendence'' has already been parsed ERR_07050_AUTHENTICATION_LEVEL_ALREADY_SEEN= The ''authenticationLevel'' has already been parsed ERR_07051_ITEM_OR_USER_FIRST_ALREADY_SEEN= The ''iterOrUserFirst'' has already been parsed ERR_07052_UNKNOWN_ACIITEM_PART=The current token ''{0}'' should not be used for an ACIItem ERR_07053_MISSING_ITEM_OR_USER_FIRST= The ''iterOrUserFirst'' part is missing ERR_07054_MISSING_PROTECTED_ITEMS= The ''protectedItems'' part is missing ERR_07055_PROTECTED_ITEMS_ALREADY_SEEN= The ''protectedItems'' part has already been seen ERR_07056_GRANTS_AND_DENIALS_ALREADY_SEEN= The ''grantsAndDenials'' part has already been seen ERR_07057_USER_CLASSES_ALREADY_SEEN= The ''userClasses'' part has already been seen ERR_07058_REFINEMENT_NESTING_TOO_DEEP=The refinement is nested more than {0} levels deep # api-ldap-extras-codec 8000-8999 # api-ldap-extras-codec <> 8000-8099 ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER=Cannot put a PDU in a null buffer ! ERR_08001_CANNOR_DECODE_REFRESH_DELETES=failed to decode the refreshDeletes flag for SyncDoneValueControl ERR_08002_CANNOT_FIND_CONTROL_FACTORY=failed to find a control factory for control OID: {0} # api-ldap-extras-codec controls 8100-8199 ERR_08100_SYNC_REQUEST_VALUE_MODE_DECODING_FAILED=failed to decode the mode for SyncRequestValueControl ERR_08101_RELOAD_HINT_DECODING_FAILED=failed to decode the reloadHint flag for SyncRequestValueControl ERR_08102_SYNC_STATE_VALUE_MODE_DECODING_FAILED=failed to decode the mode for SyncStateValueControl ERR_08103_BAD_CONTROL_CRITICALITY=The control criticality flag {0} is invalid: {1}. It should be 0 or 255 ERR_08104_AD_DIR_SYNC_FLAG_DECODING_FAILURE=Error while decoding the AdDirSync flag, unknown value: {0} ERR_08105_AD_DIR_SYNC_FLAG_DECODING_ERROR=Error while decoding the AdDirSync flag: {0} ERR_08106_AD_DIR_SYNC_MAX_RETURN_LENGTH_DECODING_ERROR=Error while decoding the AdDirSync maxReturnLength value: {0} ERR_08107_AD_DIR_SYNC_PARENTS_FIRST_DECODING_ERROR=Error while decoding the AdDirSync parentsFirst value: {0} ERR_08108_AD_DIR_SYNC_MAX_ATTRIBUTE_COUNT_DECODING_ERROR=Error while decoding the AdDirSync maxAttributeCount value: {0} ERR_08109_BAD_CONTROL_VALUE=Bad control value: {0} ERR_08110_BAD_PASSWORD_EXPIRED_VALUE=An error occurred during decoding the response message: found a non zero value {0} for the password expired control value. According to the LDAP reference guide, only values of zero are valid. # api-ldap-extras-codec extended 8200-8399 ERR_08200_CANCELID_DECODING_FAILED=failed to decode the cancelId, the value should be between 0 and 2^31-1, it is ''{0}'' ERR_08201_INVALID_TARGET_DN=invalid target DN {0} ERR_08202_NULL_TARGET_DN_DECODING_FAILED=failed to decode the target DN, it cannot be null or empty it is ''{0}'' ERR_08203_INVALID_ISSUER_DN=invalid issuer DN {0} ERR_08204_INVALID_SUBJECT_DN=invalid subject DN {0} ERR_08205_CANNOT_DECODE_DELAY=failed to decode the delay, the value should be between 0 and 86400 seconds, it is ''{0}'' ERR_08206_TIME_OFFLINE_DECODING_FAILED=failed to decode the timeOffline, the value should be between 0 and 720 minutes, it is ''{0}'' ERR_08207_SP_LANGUAGE_NULL=The stored procedure language is null ERR_08208_NULL_PROCEDURE=The procedure can''t be null ERR_08209_NULL_PARAMETER_TYPE=The parameter type can''t be null ERR_08210_NULL_PARAMETER_VALUE=The parameter value can''t be null ERR_08211_EMPTY_PARAMETER_VALUE=The parameter value is empty. This is not allowed. ERR_08212_PDU_BUFFER_TOO_SMALL=The PDU buffer size is too small ! ERR_08213_NULL_CONTROL_LENGTH=The length of a control must not be null ERR_08214_NULL_OID=The OID must not be null ERR_08215_INVALID_CONTROL_OID=The control type {0} is not a valid OID ERR_08216_GRACEFUL_SHUTDOWN_PAYLOAD_ENCODING_FAILED=Failed to encode payload GracefulShutdownRequest ERR_08217_PAYLOAD_DECODING_ERROR=failed to decode payload ERR_08218_CERT_GENERATE_PAYLOAD_ENCODING_FAILED=Failed to encode payload CertGenerateRequest ERR_08219_RESPONSE_DECODING_FAILED=Failed while decoding response ERR_08220_SP_PAYLOAD_ENCODING_FAILED=Failed to encode payload StoredProcedureRequest ERR_08221_BAD_END_TRANSACTION_COMMIT=The EndTransactionRequest Commit value {0} is invalid: {1}. It should be 0 or 255 ERR_08222_BAD_END_TRANSACTION_MESSAGE_ID=The endTransactionResponse UpdateControl MessageID value {0} is invalid: {1}. It should be a numeric value ERR_08223_INVALID_CONTROL_LIST=Invalid control list {0}: {1} ERR_08224_NULL_URL_DECODING_FAILURE=failed to decode a null URL ERR_08225_URL_DECODING_FAILURE=failed to decode the URL ''{0}'' ERR_08226_AUTHZID_TOO_SHORT_MISSING_U_OR_DN=authzId too short. Must starts with either u: or dn: ERR_08227_AUTHZID_MUST_START_WITH_U_OR_DN=authzId Must starts with either u: or dn:, it starts with {0} ERR_08228_DECORATED_SP_NULL=decorated stored procedure request is null ERR_08229_UNEXPECTED_SYNC_INFO=Unexpected SynchronizationInfo: {0} ERR_08230_WHOAMI_PAYLOAD_ENCODING_FAILED=Failed to encode payload WhoAmIRequest ERR_08231_START_TRANSACTION_PAYLOAD_ENCODING_FAILED=Failed to encode payload for StartTransactionRequest ERR_08232_END_TRANSACTION_PAYLOAD_ENCODING_FAILED=Failed to encode payload for EndTransactionRequest # api-ldap-extras-codec intermediate 8300-8399 ERR_08300_REFRESH_DONE_DECODING_FAILED=failed to decode the refreshDone flag for SyncInfoValueControl ERR_08301_REFRESH_DELETES_DECODING_FAILED=failed to decode the refreshDeletes flag for SyncInfoValueControl ERR_08302_BAD_UUID_VALUE_INCORRECT_LENGTH=Bad UUID value, its length is incorrect ( it should be 16 bytes long) # api-ldap-extras-codec-api 9000-9999 # api-ldap-extras-codec-api <> 9000 - 9099 # none # api-ldap-extras-codec-api controls 9100 - 9199 ERR_9100_UNKNOWN_PASSWORD_POLICY_ERROR=Unknown password policy error value {0} ERR_9101_UNKNOWN_MODIFY_DN_OP_TYPE=Unknown modify dn operation type {0} ERR_9102_UNKNOWN_VLV_RESPONSE=Unknown VLV response result code {0} ERR_9103_UNKNOWN_SYNC_STATE_TYPE=Unknown SyncStateTypeEnum value {0} ERR_9104_CLASS_LOADING_OF_PROC_TYPE_NOT_IMPLEMENTED=class loading of procedure type not implemented ERR_9105_CONVERSION_VALUE_TO_JAVA_NOT_IMPLEMENTED=conversion of value to java type not implemented # api-ldap-extras-codec-api extended 9200 - 9299 ERR_9200_INTERGER_DECODING_FAILURE=Failed to decode INTEGER: {0} # api-ldap-extras-codec-api intermediate 9300 - 9399 ERR_9300_UNEXPECTED_SYNCINFO=Unexpected SynchronizationInfo: {0} # api-ldap-extras-sp 10000-10999 ERR_10000_EMPTY_SP_CLASS=The stored procedure class file {0} is empy. ERR_10001_SP_RESULT_CLASS_NOT_ALLOWED=The stored procedure result contains the class {0}, which is not in the deserialization allowlist. See JavaStoredProcUtils.SP_RESULT_ALLOWED_CLASSES_PROPERTY. # api-ldap-extras-trigger 11000-11999 ERR_11000_TRIGGER_SPECIFICATION_INIT_WITH_NULL=TriggerSpecification cannot be initialized with any NULL argument. ERR_11001_TRIGGER_SPECIFICATION_INIT_WITH_EPTY_SPEC_LIST=TriggerSpecification cannot be initialized with emtpy SPSPec list. ERR_11002_TRIGGER_SPECIFICATION_PARSER_FAILURE=Parser failure on Trigger Specification:\n\t{0}\nAntlr exception trace:\n{1} ERR_11003_NAME_PARSE_FAILED=name parse failed for {0} {1} ERR_11004_MISSING_MANDATORY_SPACE=Some mandatory spaces are expected in the parsed TriggerSpecification ''{0}'' ERR_11005_UNKNOW_TRIGGER_OPERATION=The TriggerSpecification operation ''{0}'' is unknown ERR_11006_MISSING_CALL_TOKEN=The TriggerSpecifciation operation requires a "CALL" token after the ldap operation, got ''{0}'' ERR_11007_MUST_HAVE_SCOPE_VALUE=The TriggerSpecifciation operation requires scope value, ''base'', ''one'' or ''subtree'' ERR_11008_INVALID_DN=The TriggerSpecifciation operation requires a valid DN, got ''{0}'' ERR_11009_MISSING_AFTER=The TriggerSpecifciation operation requires a time action AFTER, got ''{0}'' ERR_11010_MISSING_MODIFY_DN_OPERATION=The TriggerSpecifciation ModififyDN operation requires either ''export'', ''import'' or ''rename'' , got ''{0}'' # api-ldap-extra-utils <> 12000-12999 ERR_12000_CANNOT_PROCESS_EMPTY_DN=Cannot process an empty Dn ERR_12001_CANNOT_ADD_NODE_CHILD_EXISTS=Cannot add a node to a node already having an element ERR_12002_CANNOT_ADD_NODE_ALREADY_EXISTS=Cannot add a node with no element if it already exists # api-ldap-model <> 13000-13999 ERR_13000_INVALID_LENGTH=Invalid len ERR_13001_INVALID_MAXOLEN=Invalid maxolen ERR_13002_BAD_NUMBERS_OF_ROUNDS=Bad number of rounds ERR_13003_BAD_SALT_LENGTH=Bad salt length ERR_13004_INVALID_SALT_VERSION=Invalid salt version ERR_13005_INVALID_SALT_REVISION=Invalid salt revision ERR_13006_MISSING_SALT_ROUNDS=SMissing salt rounds ERR_13008_ROUNDS_EXCEEDED_MAXIMUM=rounds exceeds maximum (30) ERR_13009_LOG_ROUNDS_EXCEEDED_MAXIMUM=log_rounds exceeds maximum (30) ERR_13010_UNKNOWN_HASH_ALGO=Unknown hash algorithm {0} ERR_13011_ATTRIBUTE_INVALID=Attribute {0} is invalid ERR_13012_UNEXPECTED_HOST_TYPE_ENUM=Unexpected HostTypeEnum {0} ERR_13013_UNKNOWN_AUTHENT_LEVEL=Unknown AuthenticationLevel {0} ERR_13014_DN_ATTR_FLAG_INVALID=The DN attributes flag {0} is invalid: {1}. It should be 0 or 255 ERR_13015_NULL_OR_EMPTY_CSN=The CSN must not be null or empty ERR_13016_INCORRECT_CSN_LENGTH=The CSN''s length is incorrect, it should be 40 chars long ERR_13017_CANT_FIND_SHARP_IN_CSN=Cannot find a ''#'' in the CSN ''{0}'' ERR_13018_TIMESTAMP_NOT_LONG_ENOUGH=The timestamp is not long enough ERR_13019_CANNOT_PARSE_TIMESTAMP=Cannot parse the timestamp: ''{0}'' ERR_13020_INVALID_MICROSECOND=The microseconds part is invalid ERR_13021_INVALID_CHANGE_COUNT=The changeCount ''{0}'' is not a valid number ERR_13022_MISSING_SHARP_IN_CSN=Missing a ''#'' in the CSN ''{0}'' ERR_13023_REPLICA_ID_NULL=The replicaID must not be null or empty ERR_13024_INVALID_REPLICA_ID=The replicaId ''{0}'' is not a valid number ERR_13025_NO_OPERATION_NUMBER=The operationNumber is absent ERR_13026_INVALID_OPERATION_NUMBER=The operationNumber ''{0}'' is not a valid number ERR_13027_UNACCEPTABLE_RESULT_CODE=Unacceptable result code for this exception type: {0} ERR_13028_SUBTREE_SPEC_PARSER_FAILURE=Parser failure on subtree specification:\n\t{0}\nAntlr exception trace:\n{1} ERR_13029_NEGATIVE_MINIMUM_BASE=A negative minimum base distance is undefined! ERR_13030_LDAP_URL_MUST_START_WITH_LDAP=A LdapUrl must start with "ldap://" or "ldaps://" ERR_13031_INVALID_HOST_PORT=The hostport is invalid ERR_13032_SLASH_EXPECTED=Bad character, position {0}, ''{1}'', ''/'' expected ERR_13033_INVALID_DN=The DN is invalid ERR_13034_QUESTION_MARK_EXPECTED=Bad character, position {0}, ''{1}'', ''?'' expected ERR_13035_INVALID_ATTRIBUTES=Attributes are invalid ERR_13036_INVALID_SCOPE=Scope is invalid ERR_13037_INVALID_FILTER=Filter is invalid ERR_13038_INVALID_EXTENSIONS=Extensions are invalid ERR_13039_INVALID_CHAR_AT_LDAP_URL_END=Invalid character at the end of the ldapUrl ERR_13040_INVALID_URL_ENCODING=Invalid URL encoding ERR_13041_INVALID_LDAP_URL_EMPTY_STRING=The string is empty: this is not a valid LdapURL. # api-ldap-model cursor 13100-13199 ERR_13100_FAILURE_ON_UNDERLYING_CURSOR=Failure on underlying Cursor. ERR_13101_MONITOR=monitor ERR_13102_UNSUPPORTED_OPERATION=The method {0} is not supported ERR_13103_REMOVAL_NOT_SUPPORTED=Underlying Cursor does not support removal. ERR_13104_EMPTY_CURSOR=This cursor is empty and cannot return elements! ERR_13105_START_INDEX_OUT_OF_RANGE=start index ''{0}'' out of range ERR_13106_END_INDEX_OUT_OF_RANGE=end index ''{0}'' out of range ERR_13107_START_INDEX_ABOVE_END_INDEX=start index ''{0}'' greater than or equal to end index ''{1}'' just does not make sense ERR_13108_LIST_MAY_BE_SORTED=don''t know if list is sorted and checking that is not worth it ERR_13109_CURSOR_NOT_POSITIONED=Cursor not positioned at an element ERR_13110_NO_COMPARATOR_CANT_MOVE_BEFORE=Without a comparator I cannot advance to just before the specified element. ERR_13111_NO_COMPARATOR_CANT_MOVE_AFTER=Without a comparator I cannot advance to just after the specified element. ERR_13112_CANNOT_ACCESS_IF_BEFORE_FIRST=Cannot access element if positioned before first. ERR_13113_CANNOT_ACCESS_IF_AFTER_LAST=Cannot access element if positioned after last. # api-ldap-model entry 13200-13299 ERR_13200_VALUE_CANT_BE_NORMALIZED=The value ''{0}'' can''t be normalized, it hasn''t been added ERR_13201_EMPTY_OPTION_NOT_ALLOWED=An empty option is not allowed ERR_13202_INVALID_OID_MISSING_NUMBER=Invalid OID, missing a number after a ''.'' ERR_13203_ATTRIBUTE_TYPE_NULL_NOT_ALLOWED=The attributeType should not be null ERR_13204_NULL_ATTRIBUTE_ID=The ID should not be null or empty ERR_13205_CANNOT_REMOVE_VAL_MISSING_ATTR=The removal of values for the missing ''{0}'' attribute is not possible ERR_13206_CANNOT_REMOVE_VAL_BAD_ATTR=The removal of values for the bad ''{0}'' attribute is not possible ERR_13207_VALUE_ALREADY_EXISTS=The value ''{0}'' already exists in the attribute ({1}) ERR_13208_ATTRIBUTE_IS_SINGLE_VALUED=The attribute ''{0}'' is single valued, we can''t add no more values into it ERR_13209_NULL_ATTRIBUTE_TYPE=The AttributeType cannot be null ERR_13210_SYNTAX_INVALID=Syntax invalid for ''{0}'' ERR_13211_BYTE_VALUE_EXPECTED=The value must be a byte[], as its AttributeType is not H/R ERR_13212_ERROR_ADDING_VALUE=Error while adding values into the ''{0}'' attribute. Error: {1} ERR_13213_VALUE_MUST_BE_A_STRING=The value must be a String, as its AttributeType is H/R ERR_13214_VALUE_EXPECT_BYTES=The value is expected to be a byte[] ERR_13215_VALUE_EXPECT_STRING=The value is expected to be a String ERR_13216_AT_ID_NULL=The attributeType ID should not be null or empty ERR_13217_FAILED_LOOKUP_AT=An exception has been raised while looking for attribute id ''{0}'' ERR_13218_AT_DOES_NOT_EXIST=The attribute ''{0}'' does not exist in the entry ERR_13219_NULL_SYNTAX_CHECKER=Cannot validate {0} with a null SyntaxChecker ERR_13220_NO_NORMALIZER=The MatchingRule {0} does not have a normalizer. This is invalid ERR_13221_INVALID_OID_MISSING_DOT=Invalid OID, missing ''.'' ERR_13222_EMPTY_ATTRIBUTE=Empty attribute ERR_13223_BAD_CHAR_IN_ATTRIBUTE=Bad char in attribute ERR_13224_FAILED_TO_COMPARE_NORM_VALUES=Failed to compare normalized values for {0} and {1} ERR_13225_NO_SYNTAX=There is no Syntax associated with this attributeType ERR_13226_CANNOT_ADD_ATTRIBUTE_NO_ID=Cannot add an attribute without an ID ERR_13227_NON_STRING_VALUE_NOT_ALLOWED=Only String values supported for objectClass attribute ERR_13228_AT_LIST_NULL_ELEMENTS=The EntryAttribute list should not contain null elements ERR_13229_ID_INCOMPATIBLE_WITH_AT=The ''{0}'' id is not compatible with the ''{1}'' attribute type ERR_13230_INCORRECT_ATTRIBUTE=The attribute ''{0}'' is incorrect ERR_13231_NO_VALID_AT_FOR_THIS_ID=Cannot find a valid AttributeType for the ''{0}'' id ERR_13232_NO_VALUE_NOT_ALLOWED=Cannot create or add an Attribute with no value in it ERR_13233_ATTRIBUTE_ID_MUST_BE_A_STRING=The Attribute ID #{0} must be a String ERR_13234_ATTRIBUTE_VAL_STRING_OR_BYTE=The Attribute value #{0} must be a String or a byte[] ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED=Cannot set a null ID with a null AttributeType ERR_13236_ENTRY_IMMUTABLE_CANT_ADD_ATTRIBUTE=Cannot add an attribute: the entry {0} is immutable. ERR_13237_ENTRY_IMMUTABLE_CANT_PUT_VALUE=Cannot put a value: the entry {0} is immutable. ERR_13238_ENTRY_IMMUTABLE_CANT_REMOVE_VALUE=Cannot remove a value: the entry {0} is immutable. ERR_13239_ENTRY_IMMUTABLE_CANT_RENAME_ENTRY=Cannot rename the entry {0} is immutable. ERR_13240_ENTRY_IMMUTABLE_CANT_CLEAR_ENTRY=Cannot clear the entry {0} is immutable. ERR_13241_ENTRY_IMMUTABLE_CANT_READ_ENTRY=Cannot read the entry {0} is immutable. ERR_13242_ENTRY_IMMUTABLE_CANT_SERIALIZE=Cannot serialize the entry {0} is immutable. ERR_13243_ENTRY_IMMUTABLE_CANT_DESERIALIZE=Cannot deserialize the entry {0} is immutable. ERR_13244_ID_AT_NOT_COMPATIBLE=ID ''{0}'' and AttributeType ''{1}'' are not compatible ERR_13245_AT_PARAMETER_NULL=The AttributeType parameter should not be null ERR_13246_INVALID_VALUE_PER_SYNTAX=Invalid upValue per syntax ERR_13247_INVALID_VALUE_CANT_NORMALIZE=Invalid upValue ''{0}'', it can''t be normalized ERR_13248_CANNOT_READ_ENTRY=Cannot read an entry ERR_13249_NO_COMPARATOR_FOR_AT=No comparator for attributeType {0} ERR_13250_VALUE_MISSING_AT_THE_END=A value is missing at the end ERR_13251_NEGATIVE_NB_ATTRIBUTES=The number of entry's attributes is negative ERR_13252_NEGATIVE_NB_VALUES=The number of entry's attributes' values is negative ERR_13253_NEGATIVE_VALUE_LENGTH=The value size is negative ERR_13254_INVALID_ATTRIBUTE_ID=The Atribute ID ''{0}}'' is not valid # api-ldap-model filter 13300-13399 ERR_13300_BAD_PLACE_HOLDERS_NUMBER=Filter template {0} has {1} place-holders but {2} arguments provided. ERR_13301_NO_ORDERING_MR_FOR_AT=There is no ORDERING matchingRule for AttributeType {0} ERR_13302_CANNOT_CREATE_NODE_NULL_ATTR=Cannot create a Node with a null Attribute ERR_13303_SCOPENODE_IN_REFINEMENT=ScopeNode can''t be part of a refinement ERR_13304_ASSERTIONNODE_IN_REFINEMENT=AssertionNode can''t be part of a refinement ERR_13305_ASSERTION_VALUE_EXPECTED=AssertionValue expected ERR_13306_MR_OR_ASSERTION_VALUE_EXPECTED=Expected MatchingRule or assertionValue ERR_13307_MATCHING_RULE_EXPECTED=MatchingRule expected ERR_13308_NOT_A_VALID_ESCAPED_VALUE=Not a valid escaped value ERR_13309_BAD_SUBSTRING=Bad substring ERR_13310_BAD_CHAR=Bad char ERR_13311_EXPECTING_EQUAL=Expecting a ''\='' ERR_13312_ITEM_EXPECTED=An item is expected ERR_13313_EMPTY_FILTERCOMP=Empty filterComp ERR_13314_FILTER_MISSING_OPEN_PAR=No ''('' at the beginning of the filter ERR_13315_FILTER_MISSING_CLOSE_PAR=The filter has no right parenthesis ERR_13316_EMPTY_FILTER=Empty filter ERR_13317_NO_MORE_THAN_ONE_ELEM_IN_NOT=Cannot add more than one element to a negation node. ERR_13318_INVALID_ATTR_IN_REFINEMENT=Invalid attribute {0} for a refinement ERR_13319_MAX_FILTER_DEPTH_EXCEEDED=The expression exceeds the maximum allowed nesting depth ({0}) # api-ldap-model ldif 13400-13499 ERR_13400_ENTRY_WITH_TWO_DNS=An entry must not have two DNs, at line {0} ERR_13401_CHANGE_NOT_ALLOWED=We cannot have changes when reading a file which already contains entries, at line {0} ERR_13402_EXPECTING_ATTRIBUTE_TYPE=Expecting an attribute type ERR_13403_CANNOT_PARSE_LDIF_BUFFER=Cannot parse the ldif buffer: {0} ERR_13404_EMPTY_DN_NOT_ALLOWED=A ldif entry must have a non empty DN, at line {0} ERR_13405_DN_EXPECTED=A ldif entry must start with a DN, at line {0} ERR_13406_FILE_NOT_FOUND=File {0} not found, at line {1} ERR_13407_ERROR_READING_FILE=File {0} error reading, at line {1} ERR_13408_BAD_PROTOCOL=Protocols other than file: are not supported ERR_13409_CONTROL_WITHOUT_OID=The control does not have an OID, at line {0} ERR_13410_INVALID_CRITICALITY=The control must have a valid criticality, at line {0} ERR_13411_BAD_MODRDN_OPERATION=A modrdn operation must start with a "newrdn:", at line {0} ERR_13412_NO_DELETEOLDRDN=A modrdn operation must contains a "deleteoldrdn:", at line {0} ERR_13413_BAD_MODIFY_SEPARATOR=Bad state: we should have come from an ATTRVAL_SPEC, at line {0} ERR_13414_BAD_MODIFY_SEPARATOR_2=Bad state: we should have come from a MOD_SPEC or an ATTRVAL_SPEC, at line {0} ERR_13415_MOD_ATTR_AND_VALUE_SPEC_NOT_EQUAL=The modified attribute and the attribute value spec must be equal, at line {0} ERR_13416_NEW_SUPERIOR_NEEDED=A moddn operation must contains a "newsuperior:", at line {0} ERR_13417_UNKNOWN_OPERATION=Unknown operation, at line {0} ERR_13418_CONTROL_ALREADY_FOUND=We already have had a control, at line {0} ERR_13419_CHANGETYPE_ALREADY_FOUND=We already have had a changeType, at line {0} ERR_13420_AT_VALUE_NOT_ALLOWED_AFTER_CONTROL=We can''t have a Attribute/Value pair after a control or a changeType, at line {0} ERR_13421_ATTRIBUTE_TYPE_EXPECTED=Expecting an attribute type, at line {0} ERR_13422_UNKNOWN_ENTRY_TYPE=Unknown entry type, at line {0} ERR_13423_VERSION_NOT_A_NUMBER=The version is not a number, at line {0} ERR_13424_EMPTY_CONTINUATION_LINE=Cannot have an empty continuation line, at line {0} ERR_13425_EMPTY_FILE_NAME=Cannot parse an empty file name ! ERR_13426_CANNOT_PARSE_INEXISTANT_FILE=Cannot parse the file {0}, it does not exist ERR_13427_CANNOT_FIND_FILE=Cannot find file {0} ERR_13428_CANNOT_PARSE_LDIF=Cannot parse the ldif buffer: {0} ERR_13429_ERROR_PARSING_LDIF=Error while parsing ldif: {0} ERR_13430_PREMATURE_LDIF_ITERATOR_TERMINATION=Premature termination of LDIF iterator: {0} ERR_13431_UNEXPECTED_CHANGETYPE=Unexpected ChangeType: {0} ERR_13432_NULL_ADDED_CONTROL=The added control must not be null ERR_13433_SEE_DIRSERVER_1547=See DIRSERVER-1547 ERR_13434_UNEXPECTED_MOD_OPERATION=Unexpected ModificationOperation: {0} ERR_13435_CANNOT_COMPUTE_NEW_VALUE=Cannot compute a new value for {0} ERR_13436_ERROR_ANONYMIZING_VALUE=Error while anonymizing the value {0} ERR_13437_OVERFLOW=Overflow for {0} ERR_13438_UNKNOWN_CHANGE_TYPE=Unknown change type value {0} ERR_13439_LDIF_ENTRY_WITH_TWO_DNS=A ldif entry should not have two DNs ERR_13440_NO_CHANGE=No changes within entries ERR_13441_BAD_ATTRIBUTE=Bad attribute ERR_13442_ERROR_PARSING_LDIF_BUFFER=Error while parsing the ldif buffer ERR_13443_CANNOT_FIND_FILE=Cannot find file {0} ERR_13444_CANNOT_READ_FILE=Cannot read file {0} ERR_13445_NO_DN=No DN for entry ERR_13446_INVALID_DN=The DN {0} is not valid, at line {1} ERR_13447_BAD_URL_FILE_NOT_FOUND=Bad URL, file not found ERR_13448_FILE_TOO_BIG=File {0} is too big, at line {1} ERR_13449_ERROR_READING_BAD_URL=Bad URL, file can''t be read ERR_13450_CANNOT_CLOSE_FILE=Error while closing the stream: {0}, at line {1} ERR_13451_UNSUPPORTED_PROTOCOL=Unsupported URL protocol, at line {0} ERR_13452_BAD_URL=Bad URL {0}, at line {1} ERR_13453_INVALID_OID=The OID {0} is not valid, at line {1} ERR_13454_BAD_MODIFY_ATTRIBUTE=Bad modify attribute ERR_13455_BAD_MODDN_NO_SUPERIOR=Bad moddn operation, no newsuperior ERR_13456_BAD_OPERATION=Bad operation ERR_13457_MISPLACED_CONTROL=Control misplaced ERR_13458_MISPLACED_CHANGETYPE=ChangeType misplaced ERR_13459_MISPLACED_ATTRIBUTETYPE=AttributeType misplaced ERR_13460_BAD_ATTRIBUTE=Bad attribute ERR_13461_UNKNOWN_ENTRY=Unknown entry ERR_13462_LDIF_PARSING_ERROR=Ldif parsing error ERR_13463_ERROR_WHILE_READING_LDIF_LINE=Error while reading ldif lines ERR_13464_FILENAME_NOT_FOUND=Filename {0} not found. ERR_13465_CANT_DEDUCE_REVERSE_FOR_MOD=Could not deduce reverse modifications from provided modifications: {0} ERR_13466_NEW_SUPERIOR_DN_NULL=newSuperiorDn must not be null ERR_13467_NULL_MODIFIED_DN=modifiedDn must not be null ERR_13468_DONT_MOVE_ROOTDSE=Don''t think about moving the rootDSE. ERR_13469_NULL_READ_DN=The newRdn must not be null ERR_13470_DONT_RENAME_ROOTDSE=Don''t think about renaming the rootDSE. ERR_13471_DELETED_ENTRY_WITH_ATTRIBUTES=Invalid Entry: a deleted entry should not contain attributes ERR_13472_ENTRY_WITH_NO_ATTRIBUTE=Invalid Entry: a added or modified entry should contain attributes ERR_13473_MODDN_WITH_ATTRIBUTES=Invalid Entry: a modifyDN operation entry should not contain attributes ERR_13474_LINE_LENGTH_TOO_SHORT=The length of each line must be at least 2 chars long ERR_13475_UNKNOWN_ATTRIBUTETYPE=The AttributeType is unknonw for this attribute: {0} # api-ldap-model message 13500-13599 ERR_13500_UNDEFINED_CHANGETYPE=Undefined changeType value: {0} ERR_13501_UNKNOWN_JNDI_SCOPE=Unknown JNDI scope constant value: {0} ERR_13502_UNKNOWN_LDAP_URL_SCOPE=Unknown LDAP URL scope value: {0} ERR_13503_RESULT_CODE_SHOULD_BE_IN=The result code can only be one of: {0}, {1}, {2} ERR_13504_FIX_OID=the OID is fixed: {0} ERR_13505_HARDCODED_ZERO_LENGTH_RESPONSE=the response is hardcoded as zero length array ERR_13506_CANNOT_ABANDON_OPERATION=RFC 2251 [Section 4.11]: Abandon, Bind, Unbind, and StartTLS operations cannot be abandoned. ERR_13507_UNRECOGNIZED_JNDI_PROPERTY_VALUE=Unrecognized value ''{0}'' for {1} JNDI property.\nExpected a value of either always, never, searching, or finding. ERR_13508_INVALID_FILTER=The filter {0} is invalid: {1}. ERR_13509_UNEXPECTED_SCOPE=Unexpected scope {0} ERR_13510_UNKNOWN_DEREF_MODE=Unknown derefmode {0} ERR_13511_INVALID_PROXIED_AUTHZ_NULL=Invalid proxied authz value: cannot be null ERR_13512_INVALID_PROXIED_AUTHZ_BAD_DN=Invalid proxied authz value: the DN is not valid ERR_13513_INVALID_PROXIED_AUTHZ_NO_DN_OR_U=Invalid proxied authz value: should start with ''dn:'' or ''u:'' ERR_13514_UNKNOWN_SORT_RESPONSE_RESULT=Unknown sort response result code {0} ERR_13515_UNEXPECTED_MOD_OP=Unexpected ModificationOperation ERR_13516_UNEXPECTED_MESSAGE_TYPE=Unexpected MessageTypeEnum {0} ERR_13517_UNEXPECTED_ALIAS_DEREF_MODE=Unexpected aliasDerefMode {0} ERR_13518_CLASS_INVALID_ENULM_VALUE=Class has bug: check for valid enumeration values # api-ldap-model name 13600-13699 ERR_13600_TYPE_IS_NULL_OR_EMPTY=The type cannot be empty or null ERR_13601_EXPECTED_COMMA_SEMI_COLON=Unexpected character ''{0}'' at position {1}. Expected '','' or '';''. ERR_13602_RDN_EMPTY=RDN must not be empty ERR_13603_NULL_RDN=RDN must not be null ERR_13604_START_AT_EXPECTED=Unexpected character ''{0}'' at position {1}. Expected start of attributeType. ERR_13605_START_AT_DESCR_EXPECTED=Unexpected character ''{0}'' at position {1}. Expected start of attributeType descr. ERR_13606_EXPECTED_NUMERICOID=Unexpected character ''{0}'' at position {1}. Expected numericoid. ERR_13607_DOT_MISSING_IN_OID=Numeric OID must contain at least one dot. ERR_13608_START_AT_NUMERICOID_EXPECTED=Unexpected character ''{0}'' at position {1}. Expected start of attributeType numericoid. ERR_13609_EQUAL_EXPECTED=Unexpected character ''{0}'' at position {1}. Expected EQUALS ''=''. ERR_13610_NO_MORE_CHAR_AVAILABLE=No more characters available at position {0} ERR_13611_VALUE_MISSING_ON_RDN=A value is missing on some RDN ERR_13612_POSITION_NOT_IN_RANGE=The posn({0}) should be in the range [0, {1}] ERR_13613_VALUE_NOT_IN_HEX_FORM_ODD_NUMBER=This value is not in hex form, we have an odd number of hex chars ERR_13614_VALUE_NOT_IN_HEX_FORM=This value is not in hex form ERR_13615_UNESCAPED_CHARS_NOT_ALLOWED=Unescaped special characters are not allowed ERR_13616_CANNOT_SERIALIZE_AVA_UPNAME_NULL=Cannot serialize a wrong ATAV, the upName should not be null or empty ERR_13617_CANNOT_SERIALIZE_AVA_UPTYPE_NULL=Cannot serialize a wrong ATAV, the upType should not be null or empty ERR_13618_CANNOT_SERIALIZE_AVA_NORMTYPE_NULL=Cannot serialize a wrong ATAV, the normType should not be null or empty ERR_13619_CANNOT_SERIALIZE_AVA_VALUE_NULL=Cannot serialize a wrong ATAV, the value should not be null ERR_13620_CANNOT_NORMALIZE_VALUE=Cannot normalize the value ERR_13621_ASSERTION_FAILURE=Assertion failure ERR_13622_DN_OR_RDN_NULL=Either the dn or the rdn is null ERR_13623_INVALID_POSITION=Invalid position: {0} ERR_13624_CANNOT_SERIALIZE_NULL_DN=Cannot serialize a NULL Dn"; ERR_13625_INVALID_RDN=Invalid RDN ERR_13626_INVALID_RDN_DUPLICATE_AVA=Invalid RDN: the {0} is already present in the RDN ERR_13627_NEGATIVE_NUMBER_OF_RDNS=The number of RDNs is negative ERR_13628_NEGATIVE_NUMBER_OF_AVAS=The number of AVAs is negative ERR_13629_NO_ATTRIBUTE_TYPE=The AttributeType is not present ERR_13630_BAD_OID_ATTRIBUTE_TYPE=The parsed attributeType is incorrect, we should have an OID at {0} ERR_13631_WRONG_ESCAPED_SEQUENCE=This value contains some invalid escaped sequence ERR_13632_WRONG_HEX_PAIR=This value contains some invalid hex pair, it should have 2 consecutive hex chars ERR_13633_INVALID_UTFMB=The UTFMB byte sequence {0} is invalid ERR_13634_INCOMPLETE_UTFMB=The UTFMB byte sequence is missing a mandatory byte ERR_13635_INVALID_VALUE_CHARACTER=The Value character ''{0}'' is invalid ERR_13636_INVALID_END_ESCAPED_CHARACTER=The RDN ends with an ''\'' characters without the following any following character ERR_13637_LDAPV2_QUOTED_VALUE_NOT_ACCEPTED=Quoted values aren''t any more accepted ERR_13638_WRONG_ATTRIBUTE_TYPE=Wrong attributeType ''{}'' at {} ERR_13639_UTILITY_CLASS_CANT_BE_INSTANCIATED=This is a utility class and cannot be instantiated # api-ldap-model schema 13700-13899 ERR_13700_CANNOT_MODIFY_LOCKED_SCHEMA_OBJECT=Cannot modify the SchemaObject {0}, it has been locked ERR_13701_CANNOT_MODIFY_AT_REGISTRY_COPY=Cannot modify the AttributeTypeRegistry copy ERR_13702_CANNOT_MODIFY_CMP_REGISTRY_COPY=Cannot modify the ComparatorRegistry copy ERR_13703_CANNOT_MODIFY_DITCR_REGISTRY_COPY=Cannot modify the DITContentRuleRegistry copy ERR_13704_CANNOT_MODIFY_DITSR_REGISTRY_COPY=Cannot modify the DITStructureRuleRegistry copy ERR_13705_CANNOT_MODIFY_SYN_REGISTRY_COPY=Cannot modify the LdapSyntaxRegistry copy ERR_13706_CANNOT_MODIFY_MR_REGISTRY_COPY=Cannot modify the MatchingRuleRegistry copy ERR_13707_CANNOT_MODIFY_MRU_REGISTRY_COPY=Cannot modify the MatchingRuleUseRegistry copy ERR_13708_CANNOT_MODIFY_NF_REGISTRY_COPY=Cannot modify the NameFormRegistry copy ERR_13709_CANNOT_MODIFY_NORM_REGISTRY_COPY=Cannot modify the NormalizerRegistry copy ERR_13710_CANNOT_MODIFY_OC_REGISTRY_COPY=Cannot modify the ObjectClassRegistry copy ERR_13711_CANNOT_MODIFY_SC_REGISTRY_COPY=Cannot modify the SyntaxCheckerRegistry copy ERR_13712_UNKNOWN_SCHEMA_OBJECT_TYPE=Unknown SchemaObject type: {0} ERR_13713_ESCAPED_WRONG_VALUE=escaped can never have such a value: {0} ERR_13714_NULL=Null ERR_13715_OPENLDAP_PARSER_NON_STANDARD=OpenLdapSchemaParser is not a normal schema parser ERR_13716_NULL_OR_EMPTY_STRING_SCHEMA_OBJECT=The schemaObject is either null or is the empty String! ERR_13717_UNEXPECTED_OBJECT_CLASS_TYPE_ENUM=Unexpected ObjectClassTypeEnum: {0} ERR_13718_UNEXPECTED_SCHEMA_OBJECT_TYPE=Unexpected SchemaObjectType: {0} ERR_13719_LOOP_DETECTED=Loop detected: {0} ERR_13720_CANNOT_HANDLE_DN_COMPARISONS=I do not know how to handle dn comparisons with objects of class: {0} ERR_13721_ARGUMENT1_NULL=Argument ''obj1'' is null ERR_13722_ARGUMENT2_NULL=Argument ''obj2'' is null ERR_13723_MATCHING_RULE_NOT_FOUND=Matching rule not found: {0} ERR_13724_INVALID_VALUE=Invalid value: {0} ERR_13725_CANNOT_HANDLE_NAME_AND_OPTIONAL_UID_NORM=I do not know how to handle NameAndOptionalUID normalization with objects of class: {0} ERR_13726_NO_OBJECT_IDENTIFIER_MACRO=No object identifier macro with name {0} ERR_13727_ENTRY_CANNOT_BE_NULL=entry cannot be null ERR_13728_ENTRY_INVALID_CN=entry must have a valid cn attribute ERR_13729_RULE_ID_NOT_FOUND=RuleId {0} not found in ruleId to schema name map! ERR_13730_DIT_STRUCTURE_RULE_ALREADY_REGISTRED=DITStructureRule with RuleId {0} already registered! ERR_13731_DIT_STRUCTURE_RULE_DOES_NOT_EXIST=DITStructureRule for ruleId {0} does not exist! ERR_13732_NAME_CANNOT_BE_NULL=name cannot be null ERR_13733_ARG_NOT_NUMERIC_OID=Looks like the arg is not a numeric OID ERR_13734_OID_NOT_FOUND=OID ''{0}'' not found in oid to schema name map! ERR_13735_ELEMENT_FOR_OID_DOES_NOT_EXIST={0} for OID {1} does not exist! ERR_13736_ELEMENT_FOR_OID_ALREADY_REGISTERED={0} with OID {1} already registered! ERR_13737_ELEMENT_WITH_NAME_ALREADY_REGISTERED={0} with name {1} already registered! ERR_13738_OID_NOT_A_NUMERIC_OID=OID {0} is not a numeric OID ERR_13739_ELEMENT_WITH_OID_NOT_REGISTERED={0} with OID {1} not registered! ERR_13740_CANNOT_FIND_OID_FROM_NAME=Can''t find an OID for the name {0} ERR_13741_OID_NOT_FOUND_IN_REGISTRY=OID ''{0}'' was not found within the OID registry ERR_13742_NO_SCHEMA_OBJECT_WITH_OID=There is no SchemaObject associated with OID ''{0}'' ERR_13743_CANNOT_REGISTER_NULL_SCHEMA_OBJECT=Cannot register a Null SchemaObject ! ERR_13744_SCHEMA_OBJECT_HAS_NO_VALID_OID=The given SchemaObject does not have a valid OID ERR_13745_SCHEMA_OBJECT_WITH_OID_ALREADY_EXIST=There is already a SchemaObject for OID ''{0}'' ERR_13746_CANNOT_BUILD_REFERENCES=Cannot build the references for {0}, error: {1} ERR_13747_CANNOT_REMOVE_REFERENCES=Cannot remove the references for {0}, error: {1} ERR_13748_MATCHING_RULE_NO_SYNTAX=The MatchingRule {0} does not have a syntax. This is invalid ERR_13749_AT_WITH_CYCLE=The AttributeType {0} can''t have itself as a superior, or a cycle has been detected while processing the superior''s tree ERR_13750_REGISTERING_FAILED_ALREADY_PRESENT=Registering of {0}:{1} failed, it''s already present in the Registries ERR_13751_UNREGISTERING_FAILED_NOT_PRESENT=Unregistering of {0}:{1} failed, it''s not present in the Registries ERR_13752_CANNOT_FIND_SUPERIOR=Cannot find the SUPERIOR object {0} while building cross-references for the {1} AttributeType. ERR_13753_CYCLE_DETECTED=A cycle has been detected in the superior hierarchyOid while building cross-references for the {0} AttributeType. ERR_13754_CANNOT_FIND_SYNTAX=Cannot find a Syntax object {0} while building cross-references for the {1} AttributeType. ERR_13755_AT_MUST_HAVE_A_SYNTAX_OID=The AttributeType {0} must have a syntax OID or a superior, it does not have any. ERR_13756_CANNOT_FIND_EQUALITY_MR_OBJECT=Cannot find an Equality MatchingRule object for {0} while building cross-references for the {1} AttributeType. ERR_13757_CANNOT_FIND_EQUALITY_MR_INSTANCE=Cannot find an EQUALITY MatchingRule instance for {0} while building cross-references for the {1} AttributeType. ERR_13758_CANNOT_FIND_ORDERING_MR_OBJECT=Cannot find a Ordering MatchingRule object for {0} while building cross-references for the {1} AttributeType. ERR_13759_CANNOT_FIND_ORDERING_MR_INSTANCE=Cannot find an ORDERING MatchingRule instance for {0} while building cross-references for the {1} AttributeType. ERR_13760_CANNOT_FIND_SUBSTR_MR_OBJECT==Cannot find a SUBSTR MatchingRule object for {0} while building cross-references for the {1} AttributeType. ERR_13761_CANNOT_FIND_SUBSTR_MR_INSTANCE=Cannot find a SUBSTR MatchingRule instance for {0} while building cross-references for the {1} AttributeType. ERR_13762_AT_MUST_HAVE_SUPERIOR_USAGE=The attributeType {0} must have the same USAGE than its superior ERR_13763_AT_MUST_BE_USER_MODIFIABLE=The attributeType {0} is a USER-APPLICATION attribute, it must be USER-MODIFIABLE ERR_13764_AT_COLLECTIVE_SHOULD_BE_USER_APP=The attributeType {0} is a COLLECTIVE AttributeType, it must be a USER-APPLICATION attributeType too. ERR_13765_MR_MUST_REFER_EXISTING_SYNTAX=The created MatchingRule must refers to an existing SYNTAX element ERR_13766_ABSTRACT_OC_CANNOT_INHERIT_FROM_OC=Cannot register the SchemaObject {0}, an ABSTRACT ObjectClass cannot inherit from an {1} ObjectClass:/n {2} ERR_13767_AUX_OC_CANNOT_INHERIT_FROM_STRUCT_OC=Cannot register the SchemaObject {0}, an AUXILIARY ObjectClass cannot inherit from a STRUCTURAL ObjectClass:/n {1} ERR_13768_STRUCT_OC_CANNOT_INHERIT_FROM_AUX_OC=Cannot register the SchemaObject {0}, a STRUCTURAL ObjectClass cannot inherit from an AUXILIARY ObjectClass:/n {1} ERR_13769_CANNOT_REGISTER_SUPERIOR_MISSING=Cannot register the SchemaObject {0}, the given SUPERIOR does not exist: {1} ERR_13770_CANNOT_REGISTER_DUPLICATE_AT_IN_MAY=Cannot register the SchemaObject {0}, there are some duplicate AT in the MAY: {1} ERR_13771_CANNOT_REGISTER_AT_IN_MAY_DOES_NOT_EXIST=Cannot register the SchemaObject {0}, the AT we want to add to MAY does not exist: {1} ERR_13772_CANNOT_REGISTER_DUPLICATE_AT_IN_MUST=Cannot register the SchemaObject {0}, there are some duplicate AT in the MUST: {1} ERR_13773_CANNOT_REGISTER_DUPLICATE_AT_IN_MAY_AND_MUST=Cannot register the SchemaObject {0}, there are some duplicate AT in MAY and MUST: {1} ERR_13774_CANNOT_REGISTER_AT_IN_MUST_DOES_NOT_EXIST=Cannot register the SchemaObject {0}, the AT we want to add to MUST does not exist: {1} ERR_13775_UNDEFINED_MODIFICATION_TYPE=undefined modification type: {0} ERR_13776_CANNOT_SUBTYPE_COLLECTIVE=The Collective Attribute ({0}) cannot be subtyped ({1}) ERR_13777_COLLECTIVE_NOT_MULTI_VALUED=The Collective Attribute ({0}) cannot be single valued ERR_13778_COLLECTIVE_NOT_ALLOWED_IN_MUST=The Collective Attribute ({0}) cannot be added in the MUST list of the {1} ObjectClass ERR_13779_COLLECTIVE_NOT_ALLOWED_IN_MAY=The Collective Attribute ({0}) cannot be added in the MAY list of the {1} ObjectClass ERR_13780_SCHEMA_OBJECT_DESCRIPTION_HAS_ELEMENT_TWICE=Can''t have a {0} twice in an Schema Object Description (line {1}, col {2}) ERR_13781_MR_DESCRIPTION_INVALID=Error, MatchingRule definition invalid (line {0}, col {1}) ERR_13782_END_OF_FILE=End of file met (line {0}, col {1}) ERR_13783_SPACE_EXPECTED=Space expected (line {0}, col {1}) ERR_13784_BAD_OID_TWO_ZEROES=Bad OID, we have a number that starts with ''0'' (line {0}, col {1}) ERR_13785_BAD_OID_CONSECUTIVE_DOTS=Bad OID, we have dots at the wrong place (line {0}, col {1}) ERR_13786_BAD_OID_DOT_AT_THE_END=Bad OID, we can''t have a dot at the end of the OID (line {0}, col {1}) ERR_13787_OID_EXPECTED=An oid is expected (line {0}, col {1}) ERR_13788_LEAD_KEY_CHAR_EXPECTED=leadkeychar expected (line {0}, col {1}) ERR_13789_SIMPLE_QUOTE_EXPECTED_AT_START=Simple quote expected for a descr (line {0}, col {1}) ERR_13790_NOT_A_KEYSTRING=Not a keystring (line {0}, col {1}) ERR_13791_KEYCHAR_EXPECTED=keychar expected, got {0} (line {1}, col {2}) ERR_13792_SIMPLE_QUOTE_EXPECTED_AT_END=Simple quote expected at the end of a descr (line {0}, col {1}) ERR_13793_NO_CLOSING_PAREN=No closing '')'' (line {0}, col {1}) ERR_13794_MORE_OIDS_EXPECTED=more OIDs expected (line {0}, col {1}) ERR_13795_OPENED_BRACKET_NOT_CLOSED=Opened ''{'' hasn''t been closed (line {0}, col {1}) ERR_13796_USAGE_EXPECTED=Expected an USAGE (line {0}, col {1}) ERR_13797_USAGE_UNKNOWN=The USAGE value is unknown (line {0}, col {1}) ERR_13798_AT_DESCRIPTION_INVALID=Error, AttributeType definition invalid (line {0}, col {1}) ERR_13799_SYNTAX_OR_SUP_REQUIRED=One of SYNTAX or SUP is required (line {0}, col {1}) ERR_13800_COLLECTIVE_REQUIRES_USER_APPLICATION=COLLECTIVE requires USAGE userApplications (line {0}, col {1}) ERR_13801_NO_USER_MOD_REQUIRE_OPERATIONAL=NO-USER-MODIFICATION requires an operational USAGE (line {0}, col {1}) ERR_13802_EXTENSION_SHOULD_START_WITH_X=Error, extension should start with ''X-'' (line {0}, col {1}) ERR_13803_OC_DESCRIPTION_INVALID=Error, ObjectClass definition invalid (line {0}, col {1}) ERR_13804_OBJECT_IDENTIFIER_HAS_NO_OID=The ObjectIdentifier does not have any OID (line {0}, col {1}) ERR_13805_OBJECT_IDENTIFIER_INVALID_OID=The ObjectIdentifier has an invalid OID (line {0}, col {1}) ERR_13806_UNEXPECTED_ELEMENT_READ=Unexpected element read: {0} (line {1}, col {2}) ERR_13807_SYN_DESCRIPTION_INVALID=Error, LdapSyntax definition invalid (line {0}, col {1}) ERR_13808_SYNTAX_REQUIRED=SYNTAX is required (line {0}, col {1}) ERR_13809_DCR_DESCRIPTION_INVALID=Error, DitContentRule definition invalid (line {0}, col {1}) ERR_13810_DSR_DESCRIPTION_INVALID=Error, DitStructureRule definition invalid (line {0}, col {1}) ERR_13811_INVALID_RULE_ID=Invalid or missing ruleid (line {0}, col {1}) ERR_13812_FORM_REQUIRED=FORM required (line {0}, col {1}) ERR_13813_MORE_RULE_IDS_EXPECTED=more RULEID expected (line {0}, col {1}) ERR_13814_APPLIES_REQUIRED=APPLIES required (line {0}, col {1}) ERR_13815_MRU_DESCRIPTION_INVALID=Error, MatchingRuleUse definition invalid (line {0}, col {1}) ERR_13816_NF_DESCRIPTION_INVALID=Error, NameForm definition invalid (line {0}, col {1}) ERR_13817_STRUCTURAL_OBJECT_CLASS_REQUIRED=OC required (line {0}, col {1}) ERR_13818_MUST_REQUIRED=MUST required (line {0}, col {1}) ERR_13819_FQCN_REQUIRED=FQCN required (line {0}, col {1}) ERR_13820_BYTE_CODE_REQUIRED=BYTECODE required (line {0}, col {1}) ERR_13821_NORM_DESCRIPTION_INVALID=Error, Normalizer definition invalid (line {0}, col {1}) ERR_13822_INVALID_FQCN_BAD_IDENTIFIER_START=The FQCN is invalid, an identifier starts with an invalid java letter (line {0}, col {1}) ERR_13823_INVALID_FQCN_DOUBLE_DOT=The FQCN is invalid, there are two consecutive dots (line {0}, col {1}) ERR_13824_INVALID_FQCN_BAD_IDENTIFIER=The FQCN is invalid, an identifier has a wrong java letter (line {0}, col {1}) ERR_13825_COMP_DESCRIPTION_INVALID=Error, LdapComparator definition invalid (line {0}, col {1}) ERR_13826_SC_DESCRIPTION_INVALID=Error, SyntaxChecker definition invalid (line {0}, col {1}) ERR_13827_EMPTY_SYNTAX_LEN=The SYNTAX length is empty (line {0}, col {1}) ERR_13828_MISSING_SYNTAX_OID=The SYNTAX has no OID (line {0}, col {1}) ERR_13829_NO_OPENING_PAREN=There is a missing opening ''('' (line {0}, col {1}) ERR_13830_CANNOT_PARSE_NULL_ATTR_TYPE=Cannot parse a null AttributeType ERR_13831_ATTRIBUTE_TYPE_PARSING_FAILURE=Parser failure on attribute type description:\n{0}\nAntlr message: {1}\nAntlr column: {2} ERR_13832_ATTRIBUTE_TYPE_DESC_PARSE_FAILURE=Parser failure on attribute type description:\n\t{0}\nAntlr message: {1} ERR_13833_CANNOT_PARSE_NULL_DCR=Cannot parse a null DITContentRule ERR_13834_DCR_PARSING_FAILURE=Parser failure on DIT content rule description:\n\t{0}\nAntlr message: {1}\nAntlr column: {2} ERR_13835_DCR_DESC_PARSING_FAILURE=Parser failure on DIT content rule description:\n\t{0}\nAntlr message: {1} ERR_13836_CANNOT_PARSE_NULL_DSR=Cannot parse a null DITStructureRule description ERR_13837_DSR_PARSING_FAILURE=Parser failure on DIT structure rule description:\n\t{0}\nAntlr message: {1}nAntlr column: {2} ERR_13838_DSR_DESC_PARSING_FAILURE=Parser failure on DIT structure rule description:\n\t{0}\nAntlr message: {1} ERR_13839_CANNOT_PARSE_NULL_COMP=Cannot parse a null LdapComparator description ERR_13840_COMP_PARSING_FAILURE=Parser failure on comparator description:\n\t{0}\nAntlr message: {1}\nAntlr column: {2} ERR_13841_COMP_DESC_PARSING_FAILURE=Parser failure on comparator description:\n\t{0}\nAntlr message: {1} ERR_13842_CANNOT_PARSE_NULL_SYNTAX=Cannot parse a null LdapSyntax ERR_13843_SYNTAX_PARSING_FAILURE=Parser failure on LDAP syntax description:\n\t{0}\nAntlr message: {1}\nAntlr column: {2} ERR_13844_SYNTAX_DESC_PARSING_FAILURE=Parser failure on LDAP syntax description:\n\t{0}\nAntlr message: {1} ERR_13845_CANNOT_PARSE_NULL_MR=Cannot parse a null MatchingRule ERR_13846_MR_PARSING_FAILURE=Parser failure on matching rule description:\n\t{0}\nAntlr message: {1}\nAntlr column: {2} ERR_13847_MR_DESC_PARSING_FAILURE=Parser failure on matching rule description:\n\t{0}\nAntlr message: {1} ERR_13848_CANNOT_PARSE_NULL_MRU=Cannot parse a null MatchingRuleUse ERR_13849_MRU_PARSING_FAILURE=Parser failure on matching rule description:\n\t{0}\nAntlr message: {1}\nAntlr column: {2} ERR_13850_MRU_DESC_PARSING_FAILURE=Parser failure on matching rule description:\n\t{0}\nAntlr message: {1} ERR_13851_CANNOT_PARSE_NULL_NF=Cannot parse a null NameForm ERR_13852_NF_PARSING_FAILURE=Parser failure on name form description:\n\t{0}\nAntlr message: {1}\nAntlr column: {2} ERR_13853_NF_DESC_PARSING_FAILURE=Parser failure on name form description:\n\t{0}\nAntlr message: {1} ERR_13854_CANNOT_PARSE_NULL_NORM=Cannot parse a null Normalizer description ERR_13855_NORM_PARSING_FAILURE=Parser failure on normalizer description:\n\t{0}\nAntlr message: {1}\nAntlr column: {2} ERR_13856_NORM_DESC_PARSING_FAILURE=Parser failure on normalizer description:\n\t{0}\nAntlr message: {1} ERR_13857_CANNOT_PARSE_NULL_OC=Cannot parse a null ObjectClass description ERR_13858_OC_PARSING_FAILURE=Parser failure on object class description:\n\t{0}\nAntlr message: {1}\nAntlr column: {2} ERR_13859_OC_DESC_PARSING_FAILURE=Parser failure on object class description:\n\t{0}\nAntlr message: {1} ERR_13860_CANNOT_PARSE_NULL_SC=Cannot parse a null SyntaxChecker description ERR_13861_SC_PARSING_FAILURE=Parser failure on syntax checker description:\n\t{0}\nAntlr message: {1}\nAntlr column: {2} ERR_13862_SC_PARSING_FAILURE=Parser failure on syntax checker description:\n\t{0}\nAntlr message: {1} ERR_13863_MR_DOES_NOT_HAVE_A_COMP=The MatchingRule {0} does not have a comparator. This is invalid ERR_13864_AT_DOES_NOT_HAVE_A_SUPERIOR_NOR_SYNTAX=The AttributeType {0} does not have a superior nor a Syntax. This is invalid ERR_13865_ERROR_PARSING_AT=Error parsing attribute type {0}: {1} ERR_13866_MOD_INCREMENT_INVALID_VALUE=Increment operation on {0} with invalid increment {1} ERR_13867_MOD_INCREMENT_NO_ATTRIBUTE=Increment operation on a non existing attribute {0} ERR_13868_MOD_INCREMENT_NO_INT_ATTRIBUTE=Increment operation on a non integer attribute {0} ERR_13869_MOD_INCREMENT_OVERFLOW=Increment operation overflow for attribute {0}, value is {1} # api-ldap-model subtree 13900-13999 ERR_13900_INTEGER_TOKEN_NOT_INTEGER=Value of INTEGER token {0} cannot be converted to an Integer ERR_13901_MESSAGE={0} ERR_13902_FILTER_PARSER_FAILED=filterParser failed. {0} ERR_13903_DN_PARSER_FAILED=dnParser failed for {0} {1} ERR_13904_MISSING_SPACE_AFTER_BASE=The subtreeSpecification base component requires a space before the DN ERR_13905_REQUIRED_SPACE_SS_SPEC_FILTER=A space is required in a SubtreeSpecification filter ERR_13906_SS_INVALID_ITEM=The SubtreeSpecification item OID ''{0}'' does not exist ERR_13907_REQUIRED_SPACE_SS_SPEC_EXCLUSIONS=A space is required in a SubtreeSpecification exclusions ERR_13908_SS_INVALID_DN=The SubtreeSpecification DN ''{0}'' is invalid ERR_13909_SUBTREE_SPECIFICATION_REFINEMENT_TOO_DEEP=The subtreeSpecification refinement is nested deeper than {0} levels # api-ldap-net-mina 14000-14999 ERR_14000_ERROR_ENCODING_MESSAGE=Error while encoding message {0}: {1} # api-ldap-schema-converter 15000-15999 ERR_15000_SCHEMA_ELEMENT_NAME_REQUIRED={0} the schema configuration element must specify a name. ERR_15001_NULL_SCHEMA=Can''t generate a ldif for a null schema ERR_15002_EMPTY_OR_NULL_SCHEMA_OBJECT=The schemaObject is either null or is empty! ERR_15003_PARSER_FAILURE=Parser failure on:\n\t{0}\nAntlr exception trace:\n{1} ERR_15004_CANNOT_GENERATE_SOURCES=Failed while generating sources for {0}: {1} ERR_15005_NO_PROPERTY=the schema property must be set ERR_15006_SPACE_REQUIRED=The schema description requires a space at {0} ERR_15007_UNEXPECTED_ESCAPED_SECOND_CHAR=The second escaped char is not one of ''c'', ''C'' or ''7''. ERR_15008_OID_REQUIRED=The schema description requires and OID, read {0} ERR_15009_MISSING_ESCAPED_CHAR=The schema description descr has an escaped sequence that is not for '' or '\\' ERR_15010_MISSING_QDESCR_LQUOTE=The schema description descr requires an opening simple quote ERR_15011_MISSING_ESCAPED_QUOTE=The schema description descr requires '\\'27, got '\\2'{0} ERR_15012_MISSING_ESCAPED_ESCAPE=The schema description descr requires '\\'5c, got '\\5'{0} ERR_15013_QDESCR_INCOMPLET=The schema description qdescr requires closing simple quote for the qdescr part ERR_15014_AT_WRONG_USAGE= The schema description AttributeType usage is incorrect at, expected on of DirectoryOperation, DistributedOperation or DSAOperation, got {0} ERR_15015_MISSING_DESC_LQUOTE=The schema description DESC requires an opening simple quote ERR_15016_MISSING_QDSTRING_RPAREN=The schema description qdstring requires a closing parenthesis ERR_15017_MISSING_OID_LEN_RIGHT_CURLY=The schema description syntax len is incorrect, there is a missing '}' ERR_15018_MANDATORY_SPACE_MISSING=The schema description is requiring a space ERR_15019_MISSING_OIDS_RPAREN=The schema description oids requires a closing parenthesis ERR_15020_MISSING_SCHEMA_ELEMENT_RPAREN=The schema description element requires a closing parenthesis ERR_15021_NO_SYTNAX_LEN=The schema description syntax expects a length which is absent ERR_15022_SCHEMA_ELEMENT_MISSING_RPAREN=The schema description is missing a final right parenthesis ERR_15023_IMPROPER_EXTENSION_NAME=The schema description extension must start with 'X-' followed by [a-zA-Z-_]+ characters, got {0} # api-ldap-schema-data 16000 - 16999 ERR_16000_CANNOT_OVEWRITE_SCHEMA=Cannot overwrite yet schema output directory already exists: {0} ERR_16001_CANNOT_COPY_NON_EXISTENT=Cannot copy non-existent source file {0} ERR_16002_MORE_THAN_ONE_ENTRY=Cannot have more than one entry in a schema ldif file: {0} ERR_16003_ERROR_PARSING_LDIF=Exception occurred while parsing the ldif file {0}: {1} ERR_16004_ROOT_WITHOUT_SCHEMA=Should not be hitting root without schema/schema pattern. ERR_16005_PARENT_NULL=parent cannot be null ERR_16006_DIRECTORY_CREATION_FAILED=The directory {0} could not be created ERR_16007_BINARY_REQUIRED=The attribute must be binary ERR_16008_AT_ACCESS_FAILURE=Failed to access attribute bytes. ERR_16009_LDIF_LOAD_FAIL=Failed to load schema LDIF file {0} ERR_16010_NO_SHEMA_FILE=Expecting to find a schema.ldif file in provided baseDirectory path ''{0}'' but no such file found. ERR_16011_NULL_ATTRIBUTE={0} entry must have a valid {1} attribute, it''s null ERR_16012_INVALID_COMPARATOR_OID=Comparator OID {0} is not a valid OID ERR_16013_NULL_ENTRY={0} entry cannot be null ERR_16014_NULL_SCHEMA_DESC={0} Schema description cannot be null ERR_16015_NON_EXISTENT_SCHEMA=The schema {0} does not exists or is not loaded ERR_16016_NULL_ENTRY=entry cannot be null ERR_16017_INVALID_CN_AT=entry must have a valid cn attribute ERR_16018_INVALID_AT=entry must have a valid {0} attribute ERR_16019_CANNOT_ADD_SC=Cannot add the SyntaxChecker {0}, as the associated schema ({1}) is not loaded ERR_16020_CANNOT_ADD_SC_IN_REGISTRY=Cannot add the SyntaxChecker {0} into the registries, as the associated schema ({1}) is disabled ERR_16021_DIFFERENT_COMPARATOR_OID=The Comparator''s OID ({0}) is different from the loaded class'' OID ({1}) ERR_16022_CANNOT_ADD_CMP=Cannot add the Comparator {0}, as the associated schema ({1}) is not loaded ERR_16023_CANNOT_ADD_CMP_IN_REGISTRY=Cannot add the Comparator {0} into the registries, as the associated schema ({1}) is disabled ERR_16024_CANNOT_ADD_NORMALIZER=Cannot add the Normalizer {0}, as the associated schema ({1}) is not loaded ERR_16025_CANNOT_ADD_NORMALIZER_IN_REGISTRY=Cannot add the Normalizer {0} into the registries, as the associated schema ({1}) is disabled ERR_16026_CANNOT_ADD_SYNTAX=Cannot add the Syntax {0}, as the associated schema ({1}) is not loaded ERR_16027_CANNOT_ADD_SYNTAX_IN_REGISTRY=Cannot add the Syntax {0} into the registries, as the associated schema ({1}) is disabled ERR_16028_CANNOT_ADD_MR=Cannot add the MatchingRule {0}, as the associated schema ({1}) is not loaded ERR_16029_CANNOT_ADD_MR_IN_REGISTRY=Cannot add the MatchingRule {0} into the registries, as the associated schema ({1}) is disabled ERR_16030_CANNOT_ADD_OC=Cannot add the ObjectClass {0}, as the associated schema ({1}) is not loaded ERR_16031_CANNOT_ADD_OC_IN_REGISTRY=Cannot add the ObjectClass {0} into the registries, as the associated schema ({1}) is disabled ERR_16032_CANNOT_ADD_AT=Cannot add the AttributeType {0}, as the associated schema ({1}) is not loaded ERR_16033_CANNOT_ADD_AT_IN_REGISTRY=Cannot add the AttributeType {0} into the registries, as the associated schema ({1}) is disabled ERR_16034_ENTRY_WITHOUT_VALID_AT={0} entry must have a valid {1} attribute ERR_16035_CANNOT_LOAD_SCHEMA=Cannot load the Schema {0} as one of its dependencies has not been loaded ERR_16036_OID_NOT_UNIQUE=Oid {0} for new schema entity is not unique. ERR_16037_NON_EXISTING_SCHEMA=Cannot add the SchemaObject {0} into a non existing schema {1} ERR_16038_NOT_ASSOCIATED_TO_A_SCHEMA=Cannot inject the SchemaObject {0} as it''s not associated with a schema ERR_16039_OID_DOES_NOT_EXIST=Oid {0} for new schema entity does not exist. ERR_16040_CANNOT_REMOVE_FROM_REGISTRY=Cannot remove {0} for the registries, it would become inconsistent. The following SchemaObjects are referencing this SchemaObject: {1} ERR_16041_CANNOT_DELETE_SCHEMA_OBJECT=Cannot delete the SchemaObject {0} as it''s not associated with a schema ERR_16042_OUTPUT_DIR_CREATION_FAIL=Failed to create outputDirectory: {0} ERR_16043_CANOT_LOAD_SCHEMA=Unable to load schema from the given resource value {0} ERR_16044_CANNOT_LOAD_FILE=Cannot load file {0}: {1} ERR_16045_ERROR_LOADING_RESOURCE=Error while loading resource from class loaded: {0} ERR_16046_BASE_DIR_DOES_NOT_EXIST=Provided baseDirectory ''{0}'' does not exist. ERR_16047_CANNOT_LOAD_RESOURCE=Cannot load resource {0}: {1} ERR_16048_CANNOT_FIND_SC_CTOR=Cannot find the syntax checker class constructor for class {0} ERR_16049_CANNOT_FIND_SC_CLASS=Cannot find the syntax checker class: {0} ERR_16050_CANNOT_LOAD_SC_CTOR=Cannot load the syntax checker class constructor for class {0} ERR_16051_CANNOT_LOAD_SC_CLASS=Cannot load the syntax checker class: {0} ERR_16052_CANNOT_INST_SC_CTOR=Cannot instantiate the syntax checker class constructor for class {0} ERR_16053_CANNOT_INST_SC_CLASS=Cannot instantiate the syntax checker class: {0} ERR_16054_CANNOT_ACCESS_SC_CTOR=Cannot access the syntax checker class constructor for class {0} ERR_16055_CANNOT_ACCESS_SC_CLASS=Cannot access the syntax checker class constructor: {0} ERR_16056_CANNOT_FIND_CMP_CTOR=Cannot find the comparator class constructor for class {0} ERR_16057_CANNOT_FIND_CMP_CLASS=Cannot find the comparator class: {0} ERR_16058_CANNOT_LOAD_CMP_CTOR=Cannot load the comparator class constructor for class {0} ERR_16059_CANNOT_LOAD_CMP_CLASS=Cannot load the comparator class: {0} ERR_16060_CANNOT_INVOKE_CMP_CTOR=Cannot invoke the comparator class constructor for class {0} ERR_16061_CANNOT_INVOKE_CMP_CLASS=Cannot invoke the comparator class: {0} ERR_16062_CANNOT_INST_CMP_CTOR_CLASS=Cannot instantiate the comparator class constructor for class {0} ERR_16063_CANNOT_INST_CMP_CLASS=Cannot instantiate the comparator class: {0} ERR_16064_CANNOT_ACCESS_CMP_CTOR=Cannot access the comparator class constructor for class {0} ERR_16065_CANNOT_ACCESS_CMP_CLASS=Cannot access the comparator class: {0} ERR_16066_CANNOT_FIND_CMP_CTOR_METH_CLASS=Cannot find the comparator class constructor method for class {0} ERR_16067_CANNOT_FIND_CMP_CTOR_METH=Cannot find the comparator class constructor method: {0} ERR_16068_CANNOT_FIND_NORM_CTOR=Cannot find the normalizer class constructor for class {0} ERR_16069_CANNOT_FIND_NORM_CLASS=Cannot find the normalizer class: {0} ERR_16070_CANNOT_LOAD_NORM_CTOR=Cannot load the normalizer class constructor for class {0} ERR_16071_CANNOT_LOAD_NORM_CLASS=Cannot load the normalizer class: {0} ERR_16072_CANNOT_INST_NORM_CTOR_CLASS=Cannot instantiate the normalizer class constructor for class {0} ERR_16073_CANNOT_INST_NORM_CLASS=Cannot instantiate the normalizer class: {0} ERR_16074_CANNOT_ACCESS_NORM_CTOR_CLASS=Cannot access the normalizer class constructor for class {0} ERR_16075_CANNOT_ACCESS_NORM_CTOR=Cannot access the normalizer class constructor: {0} ERR_16076_NOT_A_SCHEMA_DEFINITION=The first entry in the LDIF file is not a schema definition ERR_16077_SCHEMA_MANAGER_CANT_BE_LOADED=SchemaManager can''t be loaded: {0} ERR_16078_CANNOT_LOAD_UNKNOWN_SCHEMA=Cannot load the unknown schema {0} ERR_16079_INVALID_SCHEMA_OBJECT_CANNOT_BE_LOADED=the SchemaObject {0} cannot be added, it''s not a valid LoadableSchemaObject. ERR_16080_SCHEMA_LOADER_CANT_BE_CREATED=Default SchemaLoader cannot be created {0} ERR_16081_WONT_LOAD_CLASS=Refusing to load class ''{0}'' from the m-bytecode attribute : loading schema element implementations from entry-provided bytecode is disabled by default, as the bytecode may originate from an untrusted LDAP peer. Set the ''{1}'' system property to 'true' to explicitly enable it. ERR_16082_CANNOT_INSTANTIATE_CLASS=Refusing to instantiate class ''{0}'' : it is not a subtype of {1} # api-utils 17000 - 17999 ERR_17000_UNEXPECTED_PARSER_CONDITION=Unexpected parser condition throwing IllegalStateException. ERR_17001_FAILED_OPEN_JAR_MANIFEST=Failed to open jar file or manifest. ERR_17002_INTEGER_TOO_BIG=Integer {0} is too big ERR_17003_INTEGER_INVALID=Integer {0} is not valid ERR_17004_UNABLE_DELETE_DIR=Unable to delete directory: {0}. ERR_17005_FILE_MUST_NOT_BE_NULL=File must not be null ERR_17006_DOES_NOT_EXIST={0} does not exist ERR_17007_IS_NOT_DIRECTORY={0} is not a directory ERR_17008_FAIL_LIST_DIR=Failed to list contents of {0} ERR_17009_FILE_DOES_NOT_EXIST=File does not exist: {0} ERR_17010_UNABLE_DELETE_FILE=Unable to delete file: {0} ERR_17011_FILE_IS_DIR=File ''{0}'' exists but is a directory ERR_17012_CANNOT_READ_FILE=File ''{0}'' cannot be read ERR_17013_FILE_DOES_NOT_EXIST=File ''{0}'' does not exist ERR_17014_CANNOT_WRITE_FILE=File ''{0}'' cannot be written to ERR_17015_CANNOT_CREATE_DIR=Directory ''{0}'' could not be created ERR_17016_SOURCE_MUST_NOT_BE_NULL=Source must not be null ERR_17017_DEST_MUST_NOT_BE_NULL=Destination must not be null ERR_17018_SRC_DOES_NOT_EXIST=Source ''{0}'' does not exist ERR_17019_SRC_IS_DIR=Source ''{0}'' exists but is a directory ERR_17020_SRC_AND_DEST_SAME=Source ''{0}'' and destination ''{1}'' are the same ERR_17021_CANNOT_CREATE_DEST_DIR=Destination ''{0}'' directory cannot be created ERR_17022_DEST_READONLY=Destination ''{0}'' exists but is read-only ERR_17023_DEST_IS_DIR=Destination ''{0}'' exists but is a directory" ); ERR_17024_FAILED_COPY_CONTENT=Failed to copy full contents from ''{0}'' to ''{1}'' Expected length: {2} Actual: {3} ERR_17025_INVALID_CHAR=Invalid Character 0x{0} ERR_17026_UNREGISTRED_COMPONENT=Unregistered or previously used component: {0} ERR_17027_WRONG_DATA_LENGTH=Miscalculated data length (wrote {0} instead of {1}) ERR_17028_PARAMETER_CANT_BE_NULL=Parameter may not be null ERR_17029_CHARSET_CANT_BE_NULL=charset may not be null or empty ERR_17030_BAD_ITERATOR_TYPE=bad iterator type: {0} ERR_17031_REMOVE_FOLLOW_NEXT=remove() must follow next() ERR_17032_BELOW_ZERO={0} < 0 ERR_17033_ABOVE_OR_EQUAL={0} >= {1} ERR_17034_ADDING_DUP_KEYS_NOT_ALLOWED=Adding duplicate keys is not permitted. ERR_17035_DUPLICATED_COMMON_ELEMENT=Duplicated common element ''{0}'' detected for Mandatory and Optional components. ERR_17036_UNREGISTRED_COMPONENT=Unregistered or previously used component: {0} ERR_17037_MUST_START_WITH_SHARP=Expected string to start with a ''#'' character. Invalid hex encoded string for empty or null string. ERR_17038_MUST_START_WITH_ESC_SHARP=Expected string to start with a ''\#'' character. Invalid hex encoded string: {0} ERR_17039_NON_NULL_EXPECTED_STRING=Expected string to be non-null with valid index. ERR_17040_EXPECTED_NON_EMPTY_STRING=Expected string to be non-empty with valid index. ERR_17041_VALID_ESC_CHARS_EXPECTED=The DN must contain valid escaped characters. ERR_17042_INITIAL_SIZE_ABOVE_ZERO=initialSize must be greater than zero ERR_17043_GENERALIZED_TIME_NULL=generalizedTime is null ERR_17044_BAD_GENERALIZED_TIME=Generalized Time too short, doesn''t contain field ''minute'' or ''fraction of hour'' or ''timezone''. ERR_17045_BAD_GENERALIZED_TIME=Generalized Time too short, doesn''t contain field ''second'' or ''fraction of minute'' or ''timezone''. ERR_17046_BAD_GENERALIZED_TIME=Generalized Time too short, doesn''t contain field ''fraction of second'' or ''timezone''. ERR_17047_TIME_TOO_SHORT=Invalid Time too short, expected field ''fraction of second'' or ''timezone''. ERR_17048_TIME_TOO_SHORT=Invalid Time too short, expected field ''second'' or ''fraction of minute'' or ''timezone''. ERR_17049_INVALID_GENERALIZED_TIME=Invalid Generalized Time, expected field ''minute'' or ''fraction of hour'' or ''timezone''. ERR_17050_INVALID_DATE_TIME=Invalid date/time values. ERR_17051_CALENDAR_NULL=Calendar must not be null. ERR_17052_TIME_TOO_SHOR_NO_TZ=Generalized Time too short, doesn''t contain field ''timezone''. ERR_17053_MISSING_TZ=Invalid Generalized Time, expected ''timezone'' as the last field. ERR_17054_TZ_MUST_BE_2_OR_4_DIGITS=Invalid Generalized Time, expected field ''timezone'' must contain 2 or 4 digits. ERR_17055_MISSING_FRACTION=Generalized Time too short, doesn''t contain number for ''fraction''. ERR_17056_TIME_TOO_SHORT_NO_SECOND=Generalized Time too short, doesn''t contain field ''second''. ERR_17057_SECOND_NOT_NUM=Invalid Generalized Time, field ''second'' is not numeric. ERR_17058_MISSING_MINUTE=Generalized Time too short, doesn''t contain field ''minute''. ERR_17059_MIN_NOT_NUM=Invalid Generalized Time, field ''minute'' is not numeric. ERR_17060_TIME_TO_SHORT_MISSING_HOUR=Generalized Time too short, doesn''t contain field ''hour''. ERR_17061_HOUR_NOT_NUM=Invalid Generalized Time, field ''hour'' is not numeric. ERR_17062_TIME_TO_SHORT_MISSING_DAY=Generalized Time too short, doesn''t contain field ''day''. ERR_17063_DAY_NOT_NUM=Invalid Generalized Time, field ''day'' is not numeric. ERR_17064_TIME_TO_SHORT_MISSING_MONTH=Generalized Time too short, doesn''t contain field ''month''. ERR_17065_MONTH_NOT_NUM=Invalid Generalized Time, field ''month'' is not numeric. ERR_17066_TIME_TO_SHORT_MISSING_YEAR=Generalized Time too short, doesn''t contain field ''century/year''. ERR_17067_YEAR_NOT_NUM=Invalid Generalized Time, field ''century/year'' is not numeric. ERR_17068_SHOULD_NOT_GET_HERE=Should never get here! ERR_17069_UNEXPECTED_FORMAT=Unexpected format {0} ERR_17070_SIZE_POSITIVE=Size must be equal or greater than zero: {0} ERR_17071_UNEXPECTED_SIZE=Unexpected read size. current: {0}, expected: {1} ); ERR_17072_INTEGER_OVERFLOW=Size cannot be greater than Integer max value: {0}" + size ); ERR_17073_CHAR_REQUIRED=The parsed string requires char ''{0}'' ERR_17074_DESCR_INCORRECT_FIRST_CHAR=The parsed element desrc requires an ALPHA character at first position, got ''{0}'' ERR_17075_MISSING_LOW_SURROGATE_CHAR= The parsed low surrogate is incorrect or missing ERR_17076_IMPROPER_MULTI_BYTE_CHAR=The parsed DN has some improper multi-byte UTF-8 char ERR_17077_MISSING_CLOSING_DQUOTE=The parsed DN has a missing closing double quote ERR_17078_INVALID_INTEGER_STARTING_WITH_ZERO=The integer starts with a ''0'' but is either followed by a digit, or the parsed string is empty ERR_17079_OVERFLOWN_INTEGER=The parser integer has overflowed (it's above 2^32 - 1) with value {1} ERR_17080_INVALID_CHAR_SHOULD_BE_ASCII=The String should only contain ASCII chars, the ''{0}'' character at position {1} is not messages.properties000066400000000000000000000722361525525160600350150ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/main/resources/org/apache/directory/api/i18n# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # # asn1 api # none # asn1 ber <> 1000-1099 MSG_01000_TAG_DECODED=Tag {0} has been decoded MSG_01001_TLV_TREE=TLV Tree : {0} MSG_01002_CURRENT_BYTE= current byte: {0} MSG_01003_PARENT_LENGTH=Parent length: {0} MSG_01004_ROOT_TLV=Root TLV[{0}] MSG_01005_TLV=tlv[{0}, {1}] MSG_01006_LENGTH_DECODED=Length {0} has been decoded MSG_01007_LINE_SEPARATOR1=>>>========================================== MSG_01008_LINE_SEPARATOR2=>>>------------------------------------------ MSG_01009_LINE_SEPARATOR3=<<<------------------------------------------ MSG_01010_LINE_SEPARATOR4=<<<========================================== MSG_01011_DECODING_PDU=--> Decoding a PDU MSG_01012_STATE=--- State = {0} --- MSG_01013_CURRENT_BYTE= current byte : {0} MSG_01014_NO_MORE_BYTE= no more byte to decode in the stream MSG_01015_STOP_DECODING=<-- Stop decoding : {0} MSG_01016_STOP_DECODING_NULL_TLV=<-- Stop decoding: null current TLV MSG_01017_END_DECODING=<-- End decoding : {0} MSG_01018_END_DECODING_NULL_TLV=<-- End decoding: null current TLV # asn1 ber actions 1100-1199 MSG_01100_INTEGER_VALUE=read integer value: {0} MSG_01101_BITSTRING_VALUE=BITSTRING value: {0} # asn1 ber ber 1200-1299 # none # asn1 ber tlv 1300-1399 MSG_01300_BOOLEAN_0X00_0XFF=A boolean must be encoded with a 0x00 or a 0xFF value # dsml-engine 2000-2999 MSG_02000_FAILED_GETTING_NEXT_REQUEST=Failed while getting next request MSG_02001_FAILED_PROCESSING_REQUEST=Failed to process request MSG_02002_FAILED_TO_BIND=Failed to bind MSG_02003_ERROR=Error: {0} # dsml-parser 3000-3999 MSG_03000_FAILED_TO_CREATE_XSLT_TRANSFORMER=Failed to create the XSLT transformer # api-ldap-client-api 4000-4999 # api-ldap-client-api <> 4000-4100 # api-ldap-client-api api 4100-4200 MSG_04100_BIND_FAIL=bind failed: ''{0}'' MSG_04101_BIND_SUCCESSFUL=bind successful: ''{0}'' MSG_04102_BIND_REQUEST=bind request: {0} MSG_04103_NULL_REQUEST=Cannot process a null request MSG_04104_SENDING_REQUEST=Sending request \n{0} MSG_04105_MISSING_PASSWORD=The password is missing MSG_04106_ADDING=Adding <{0}, {1}> MSG_04107_ADD_FAILED=Add failed: {0} MSG_04108_ADD_SUCCESSFUL=Add successful: {0} MSG_04109_ANONYMOUS_BIND=Anonymous Bind request MSG_04110_ANONYMOUS_ASYNC_BIND=Anonymous asynchronous Bind request MSG_04111_ASYNC_BIND=Asynchronous Bind request MSG_04112_BIND=Bind request MSG_04113_COMPARE_FAILED=Compare failed: {0} MSG_04114_COMPARE_SUCCESSFUL=Compare successful: {0} MSG_04115_DELETE_FAILED=Delete failed: {0} MSG_04116_DELETE_SUCCESSFUL=CDelete successful: {0} MSG_04117_EXTENDED_FAILED=Extended failed: {0} MSG_04118_EXTENDED_SUCCESSFUL=Extended successful: {0} MSG_04119_GETTING=Getting <{0}, {1}> MSG_04120_INTERRUPTED_WAITING_FOR_CONNECTION=Interrupted while waiting for connection to establish with server {0}:{1} MSG_04121_LDAP_ALREADY_USING_START_TLS=LDAP session already using startTLS MSG_04122_MODIFY_FAILED=Modify failed: {0} MSG_04123_MODIFY_SUCCESSFUL=Modify successful: {0} MSG_04124_MODIFYDN_FAILED=ModifyDN failed: {0} MSG_04125_MODIFYDN_SUCCESSFUL=ModifyDN successful: {0} MSG_04126_REMOVING=Removing <{0}, {1}> MSG_04127_SASL_PLAIN_BIND=SASL PLAIN Bind request MSG_04128_SEARCH_ENTRY_FOUND=Search entry found: {0} MSG_04129_SEARCH_FAILED=Search failed: {0} MSG_04130_SEARCH_REFERENCE_FOUND=Search reference found: {0} MSG_04131_SEARCH_SUCCESSFUL=Search successful: {0} MSG_04132_SENDING_UNBIND=Sending Unbind request \n{0} MSG_04133_UNBINDSUCCESSFUL=Unbind successful MSG_04134_CLOSING=Closing {0} MSG_04135_KRB5_FILE_CREATED=krb 5 config file created at {0} MSG_04136_NOTIFYING_CLOSE_LISTENERS=Notifying the registered ConnectionClosedEventListeners.. MSG_04137_NOD_RECEIVED=Received a NoD, closing everything MSG_04138_NULL_DN_SEARCH=Received a null dn for a search MSG_04139_NULL_DN_MODIFY=Received a null dn for modification MSG_04140_NULL_ENTRY_MODIFY=Received a null entry for modification MSG_04141_SENDING_CANCEL=Sending cancel signal to future MSG_04142_MESSAGE_RECEIVED=-------> {0} Message received <------- MSG_04143_CONNECTION_RETRYING=------>> Cannot get the connection... Retrying MSG_04144_CONNECTION_ERROR=------>> Connection error: {0} MSG_04145_BIND_REQUEST=Bind request: {0} MSG_04146_ACTIVATING=Activating {0} MSG_04147_REBIND_CONNECTION_DROPPED=Rebind due to connection dropped on {0} MSG_04148_DESTROYING=Destroying {0} MSG_04149_UNABLE_TO_UNBIND=Unable to unbind connection: {0} MSG_04150_CREATING_LDAP_CONNECTION=Creating a LDAP connection MSG_04151_PASSIVATING=Passivating {0} MSG_04152_VALIDATING=Validating {0} MSG_04153_SENDING_NAME_IN_CALLBACK=Sending name {0} in the NameCallback MSG_04154_SENDING_CREDS_IN_CALLBACK=Sending credentials in the PasswordCallback MSG_04155_SENDING_USER_REALM_IN_CALLBACK=Sending the user specified realm value {0} in the RealmCallback MSG_04156_SENDING_DEFAULT_REALM_IN_CALLBACK=No user specified realm value, sending the default realm value {0} in the RealmCallback MSG_04157_SENDING_USER_REALM_IN_CALLBACK=Sending the user specified realm value {0} in the RealmChoiceCallback MSG_04158_UNABLE_TO_BIND=Unable to bind connection: {0} MSG_04159_UNABLE_TO_CLOSE_CONNECTION=Unable to close failed bind connection: {0} MSG_04160_INITIALIZING_SCHEMAS=Initializing schemas MSG_04161_CREATING_ENTRY_CURSOR=Creating EntryCursorImpl {0} MSG_04162_CLOSING_ENTRY_CURSOR=Closing EntryCursorImpl {0} MSG_04163_BORROWED_CONNECTION=Borrowed connection {0} MSG_04164_RETURNED_CONNECTION=Returned connection {0} MSG_04165_NO_FUTURE_ASSOCIATED_TO_MSG_ID_COMPLETED=There is no future associated with operation message ID {0}, the operation has been completed. MSG_04166_NO_FUTURE_ASSOCIATED_TO_MSG_ID_IGNORING=There is no future associated with the messageId {0}, ignoring the message MSG_04167_SCHEMA_LOADED_SUCCESSFULLY=Successfully loaded the schema from file {0} MSG_04168_CHECK_CLIENT_TRUSTED=CheckClientTrusted {0} MSG_04169_CHECK_SERVER_TRUSTED=checkServerTrusted {0} MSG_04170_CREATING_SEARCH_CURSOR=Creating SearchCursorImpl {0} MSG_04171_CLOSING_SEARCH_CURSOR=Closing SearchCursorImpl {0} MSG_04172_REBIND_BIND_CONNECTION=Rebind due to bind on connection {0} MSG_04173_UNBIND_START_TLS=Unbind/rebind due to startTls on {0} MSG_04174_CREATING_NEW_CONNECTION_TEMPLATE=Creating new connection template from connectionPool MSG_04175_TRUST_MANAGER_IO_EXCEPTION=LdapClientTrustStoreManager.getTrustManagers on input stream close operation caught IOException={0} MSG_04176_TRUST_MANAGER_ON_CLASSPATH={0}.getTrustManagers on classpath MSG_04177_CONNECTION_TIMEOUT=Connection timeout after {0}ms. MSH_04178_CLOSE_LATCH_ABORTED=Wait for session closed event has been aborted # api-ldap-codec-core 5000-5999 # api-ldap-codec-core <> 5000-5099 # api-ldap-codec-core actions 5100-5199 MSG_05100_NEW_LIST_CONTROLS_INITIALIZED=A new list of controls has been initialized MSG_05101_NEW_EMPTY_CONTROLS_INITIALIZED=An empty list of controls has been initialized MSG_05102_LDAP_MESSAGE_ID_DECODED=Ldap Message Id has been decoded: {0} MSG_05103_REFERRAL_ERROR_MESSAGE_NOT_ALLOWED=The Referral error message is not allowed when having an error code no equals to REFERRAL MSG_05104_REFERRAL_ERROR_MESSAGE_SET_TO=The referral error message is set to {0} MSG_05105_INITIALISNG_REFERRAL_LIST=Initializing a referrals list MSG_05106_ERROR_MESSAGE_IS=The error message is: {0} MSG_05107_NO_SUCH_OBJECT_MATCHED_DN_NOT_SET=The matched Dn should not be set when the result code is not one of NoSuchObject, AliasProblem, InvalidDNSyntax or AliasDreferencingProblem MSG_05108_MATCHED_DN_IS=The matchedDn is {0} MSG_05109_RESULT_CODE_IS=The result code is set to {0} MSG_05110_ABANDON_MSG_ID_DECODED=AbandonMessage Id has been decoded: {0} MSG_05111_ADDING_TYPE=Adding type {0} MSG_05112_ADDING_VALUE=Adding value {0} MSG_05113_ADDING_ENTRY_WITH_DN=Adding an entry with Dn : {0} MSG_05114_LDAP_VERSION=Ldap version {0} MSG_05115_SASL_CREDS_CREATED=The SaslCredential has been created MSG_05116_BIND_NAME_IS=The Bind name is {0} MSG_05117_SASL_CREDENTIALS_DECODED=The SASL credentials have been decoded MSG_05118_THE_SASL_MECHANISM_IS=The mechanism is: {0} MSG_05119_SIMPLE_CREDENTIAL_DECODED=The simple authentication credentials have been decoded MSG_05120_COMPARE_REQUEST=Compare Request MSG_05121_COMPARING_ATTRIBUTE_VALUE=Comparing attribute value {0} MSG_05122_COMPARING_ATTRIBUTE_DESCRIPTION=Comparing attribute description {0} MSG_05123_COMPARING_DN=Comparing Dn {0} MSG_05124_DELETING_DN=Deleting Dn {0} MSG_05125_EXTENDED_REQUEST_PROCESSED=Extended request being processed ... MSG_05126_OID_READ=OID read: {0} MSG_05127_EXTENDED_VALUE=Extended value: {0} MSG_05128_MODIFYING_TYPE=Modifying type: {0} MSG_05129_NO_VALS_FOR_ATTRIBUTE=No vals for this attribute MSG_05130_SOME_VALS_NEED_DECODING=Some vals are to be decoded MSG_05131_VALUE_MODIFIED=Value modified: {0} MSG_05132_DN_MODIFICATION=Modification of Dn {0} MSG_05133_MODIFY_OPERATION=Modification operation: {0} MSG_05134_MODIFY_DN_REQUEST=ModifyDn request MSG_05135_OID_RDN_ATT_WILL_BE_DELETED=Old Rdn attributes will be deleted MSG_05136_OID_RDN_ATT_WILL_BE_RETAINED=Old Rdn attributes will be retained MSG_05137_MODIFYING_DN=Modifying Dn {0} MSG_05138_MODIFYING_WITH_NEW_RDN=Modifying with new Rdn {0} MSG_05139_NULL_NEW_SUPERIOR=The new superior is null, so we will change the entry MSG_05140_NEW_SUPERIOR_DN=New superior Dn {0} MSG_05141_INITIALIZE_AND_FILTER=Initialize AND filter MSG_05142_INITIALIZE_APPROX_FILTER=Initialize Approx Match filter MSG_05143_INITIALIZE_ATT_DESC_FILTER=Initialize Assertion Value filter MSG_05144_INITIALIZE_ASSERTION_FILTER=Initialize AttributeDesc filter MSG_05145_INITIALIZE_EQ_FILTER=Initialize Equality Match filter MSG_05146_INITIALIZE_EXT_FILTER=Initialize Extensible Match filter MSG_05147_INITIALIZE_GEQ_FILTER=Initialize Greater Or Equal filter MSG_05148_INITIALIZE_LEQ_FILTER=Initialize Less Or Equal filter MSG_05149_INITIALIZE_NOT_FILTER=Initialize NOT filter MSG_05150_INITIALIZE_OR_FILTER=Initialize OR filter MSG_05151_INITIALIZE_PRESENT_FILTER=Initialize Present filter MSG_05152_INITIALIZE_SUBSTRING_FILTER=Initialize Substrings filter MSG_05153_STORED_ANY_SUBSTRING=Stored a any substring: {0} MSG_05154_STORED_FINAL_SUBSTRING=Stored a final substring: {0} MSG_05155_DN_ATTRIBUTES=Dn Attributes: {0} MSG_05156_STORED_MATCH_VALUE=Stored a match value: {0} MSG_05157_SEARCH_REQUEST=Search Request MSG_05158_INITIALIZE_ATT_DESC_LIST=Initialize AttributeDesc list MSG_05159_DECODED_ATT_DESC=Decoded Attribute Description: {0} MSG_05160_SEARCHING_WITH_ROOT_DN=Searching with root Dn: {0} MSG_05161_HANDLING_OBJECT_STRATEGY=Handling object strategy: {0} MSG_05162_SEARCHING_WITH_SCOPE=Searching within {0} scope MSG_05163_SIZE_LIMIT_SET_TO=The sizeLimit value is set to {0} objects MSG_05164_TIME_LIMIT_SET_TO=The timeLimit value is set to {0} seconds MSG_05165_SEARCH_RETURN_TYPE_ONLY=The search will return {0} MSG_05166_STORED_TYPE_MATCHING_RULE=Stored a type matching rule: {0} MSG_05167_ADD_RESPONSE=Add Response MSG_05168_SASL_CREDENTIALS_VALUE_STORED=The SASL credentials value has been stored MSG_05169_COMPARE_RESPONSE=Compare response MSG_05170_DEL_RESPONSE=Del response MSG_05171_EXTENDED_RESPONSE=Extended Response MSG_05172_OID_READ=OID read: {0} MSG_05173_EXTENDED_VALUE=Extended value: {0} MSG_05174_INTERMEDIATE_RESPONSE=Intermediate Response MSG_05175_VALUE_READ=Value read: {0} MSG_05176_MODIFY_RESPONSE=Modify response MSG_05177_MODIFY_DN_RESPONSE=Modify Dn response MSG_05178_SEARCH_RESULT_DONE=Search Result Done found MSG_05179_ATTRIBUTE_TYPE=Attribute type: {0} MSG_05180_NULL_ATTRIBUTE_VALUE=The attribute value is null MSG_05181_ATTRIBUTE_VALUE=Attribute value: {0} MSG_05182_SEARCH_RESULT_ENTRY_DN=Search Result Entry Dn found: {0} MSG_05183_SEARCH_RESULT_REFERENCE_RESPONSE=SearchResultReference response MSG_05184_SEARCH_REFERENCE_URL=Search reference URL found: {0} MSG_05185_MODIFY_REQUEST=Modify Request # api-ldap-codec-core api 5200-5299 MSG_05200_DECODED_LDAP_MESSAGE=Decoded LdapMessage: {0} MSG_05201_MESSAGE_RECEIVED=Message received: {0} MSG_05202_WILL_NOT_USE_SASL_ON_RECEIVE=Will not use SASL on received message. MSG_05203_PARTIAL_SASL_LENGTH_PREFIX=Partial SASL length prefix received: {0}/{1} MSG_05204_PARTIAL_SASL_MESSAGE=Partial SASL message received: {0}/{1} MSG_05205_WILL_USE_SASL_UNWRAP=Will use SASL to unwrap received message of length: {0} MSG_05206_FILTERING_WRITE_REQUEST=Filtering write request: {0} MSG_05207_DISABLING_SASL_FILTER=Disabling SaslFilter once; will not use SASL on write request. MSG_05208_WILL_NOT_USE_SASL_ON_WRITE=Will not use SASL on write request. MSG_05209_SENDING_ENCRYPTED_TOKEN=Sending encrypted token of length {0}. MSG_05210_WILL_USE_SASL_WRAP=Will use SASL to wrap message of length: {0} # api-ldap-codec-core controls 5300-5399 MSG_05300_CHANGE_TYPE=changeType = {0} MSG_05301_PREVIOUS_DN=previousDN = {0} MSG_05302_CHANGE_NUMBER=changeNumber = {0} MSG_05303_SIZE=size = {0} MSG_05304_CHANGE_TYPES=changeTypes = {0} MSG_05305_CHANGES_ONLY=changesOnly = {0} MSG_05306_RETURN_ECS=returnECs = {0} MSG_05307_ATTRIBUTE_TYPE_DESC=AttributeTypeDesc = {0} MSG_05308_REVERSE_ORDER=ReverseOrder = {0} MSG_05309_MATCHING_RULE_OID=MatchingRuleOid = {0} MSG_05310_ATTRIBUTE_TYPE=AttributeType = {0} # api-ldap-codec-core osgi 5400-5499 # none # api-ldap-codec-core search 5500-5599 # api-ldap-codec-standalone 6000-6999 MSG_06000_REGISTERED_CONTROL_FACTORY=Registered pre-bundled control factory: {0} MSG_06001_REGISTERED_EXTENDED_OP_FACTORY=Registered pre-bundled extended operation factory: {0} MSG_06002_REGISTERED_INTERMEDIATE_FACTORY=Registered pre-bundled intermediate response factory: {0} MSG_06003_CONTROL_FACTORY_ALREADY_LOADED=Factory for control {0} was already loaded MSG_06004_REGISTERED_CONTROL_FACTORY=Registered control factory: {0} MSG_06005_EXTENDED_OP_FACTORY_ALREADY_LOADED=Factory for extended operation {0} was already loaded MSG_06006_INTERMEDIATE_FACTORY_ALREADY_LOADED=Factory for Intermediate Response {0} was already loaded MSG_06007_REGISTRED_INTERMEDIATE_RESP_FACTORY=Registered pre-bundled Intermediate Response factory: {0} # api-ldap-extras-aci 7000-7999 MSG_07000_ATTRIBUTE_TYPE_AND_VALUE_FROM_SET=An attributeTypeAndValue from the set: \u20180}={1} MSG_07001_FILTER_SET_PARSED=filterParser parsed {0} MSG_07002_DN_PARSED=recognized a DistinguishedName: {0} MSG_07003_OID_PARSED=recognized an oid: {0} MSG_07004_ACI_ITEM_OR_USER_FIRST_ID_NOT_REQUIRED=The ''itemOrUserFirst'' token is not required and should be removed at {0} MSG_07005_CHECK_ACI_ITEM=Check the ACIItem ''{0}'' MSG_07006_PARSING_DN=Parsing a DN: {0} MSG_07007_PARSING_GRANT_AND_DENIAL=Parsing a grantAndDenial: {0}, {1} MSG_07008_PARSING_ITEM_PERMISSION=Parsing a itemPermission: {0} MSG_07009_PARSING_MAX_COUNT=Parsing a maxCount: {0} MSG_07010_PARSING_MAX_VALUE_COUNT=Parsing a maxValueCount: {0} MSG_07011_PARSING_PROTECTED_ITEM=Parsing a protecteItem: {0}, {1} MSG_07012_PARSING_REFINEMENT=Parsing a refinement: {0}, {1} MSG_07013_PARSING_RESTRICTED_VALUE=Parsing a restrictedValue: {0} MSG_07014_PARSING_SPECIFIC_EXCLUSION=Parsing a specificExclusion: {0} MSG_07015_PARSING_SUBTREE_SPECIFICATION=Parsing a subtreeSpecification: {0} MSG_07016_PARSING_TYPE=Parsing a type: {0} MSG_07017_PARSING_USER_CLASS=Parsing a userClass: {0}, {1} MSG_07018_PARSING_USER_PERMISSION=Parsing a userPermission: {0} MSG_07019_PARSING_ACI_ITEM=Parsing ACIItem: ''{0}'' MSG_07020_PARSING_ACI_ITEM_AUTHENT_LEVEL=Parsing ACIItem's authenticationLevel: {0} MSG_07021_PARSING_ACI_ITEM_ID_TAG=Parsing ACIItem's identificationTag: {0} MSG_07022_PARSING_ACI_ITEM_ITEM_OR_USER_FIRST=Parsing ACIItem's itemOrUserFirst: {0} MSG_07023_PARSING_ACI_ITEM_PRECEDENCE=Parsing ACIItem's precedence: {0} MSG_07024_PARSING_ATTRIBUTE_TYPE_SET=Parsing attributeTypeSet: {0} MSG_07025_PARSING_BASE=Parsing base: {0} MSG_07026_PARSING_CHOP_AFTER=Parsing chopAfter: {0} MSG_07027_PARSING_CHOP_BEFORE=Parsing chopBefore: {0} MSG_07028_PARSING_DNS=Parsing DNs: {0} MSG_07029_PARSING_GRANT_AND_DENIALS=Parsing grantAndDenials: {0} MSG_07030_PARSING_ITEM_FIRST=Parsing itemFirst: {0} MSG_07031_PARSING_ITEM_PERMISSION_GAD=Parsing itemPermission''s grantsAndDenials: {0} MSG_07032_PARSING_ITEM_PERMISSION_PRECEDENCE=Parsing itemPermission''s precedence: {0} MSG_07033_PARSING_ITEM_PERMISSION_USER_CLASS=Parsing itemPermission''s userClass: {0} MSG_07034_PARSING_ITEM_PERMISSIONS=Parsing itemPermissions: {0} MSG_07035_PARSING_MAXIMUM=Parsing maximum: {0} MSG_07036_PARSING_MINIMUM=Parsing minimum: {0} MSG_07037_PARSING_PROTECTED_ITEMS=Parsing protectedItems: {0} MSG_07038_PARSING_REFINEMENTS=Parsing refinements: {0} MSG_07039_PARSING_SPECIFIC_EXCLUSIONS=Parsing specificExclusions: {0} MSG_07040_PARSING_USER_CLASSES=Parsing userClasses: {0} MSG_07041_PARSING_USER_FIRST=Parsing userFirst: {0} MSG_07042_PARSING_USER_PERMISSION_GAD=Parsing userPermission''s grantsAndDenials: {0} MSG_07043_PARSING_USER_PERMISSION_PRECEDENCE=Parsing userPermission''s precedence: {0} MSG_07044_PARSING_USER_PERMISSION_PROTECTED_ITEM=Parsing userPermission''s protectedItems: {0} MSG_07045_PARSING_USER_PERMISSIONS=Parsing userPermissions: {0} MSG_07046_PARSING_VALUES_IN=Parsing valuesIn: {0} # none # api-ldap-extras-codec 8000-8999 # api-ldap-extras-codec <> 8000-8099 MSG_08000_COOKIE=cookie = {0} MSG_08001_REFRESH_DELETES=refreshDeletes = {0} # api-ldap-extras-codec controls 8100-8199 MSG_08100_MODE=Mode = {0} MSG_08101_FLAGS=flags = {0} MSG_08102_MAX_RETURN_LENGTH=maxReturnLength = {0} MSG_08103_PP_RESPONSE_CONTROL_CONTAINER_INITIALIZED=PasswordPolicyResponseControlContainer initialized MSG_08104_RELOAD_HINT=reloadHint = {0} MSG_08105_SYNC_STATE_TYPE=SyncStateType = {0} MSG_08106_ENTRY_UUID=entryUUID = {0} MSG_08107_VLV_REQUEST_CONTAINER_INITIALIZED=VirtualListViewRequestContainer initialized MSG_08108_PARENTS_FIRST=parentsFirst = {0} MSG_08109_MAX_ATTRIBUTE_COUNT=maxAttributeCount = {0} # api-ldap-extras-codec extended 8200-8399 MSG_08200_CANCEL_ID=CancelId = {0} MSG_08201_CONTROL_OID=Control OID: {0} MSG_08202_CONTROL_CRITICALITY=Control criticality: {0} MSG_08203_CONTROL_VALUE=Control value: {0} MSG_08204_DELAY=Delay = {0} MSG_08205_GEN_PASSWORD=GenPassword = (ignored for security reasons) MSG_08206_IDENTIFIER=Identifier = {0} MSG_08207_ISSUER_DN=Issuer Dn = {0} MSG_08208_NEW_PASSWORD=NewPassword = (ignored for security reasons) MSG_08209_OLD_PASSWORD=OldPassword = (ignored for security reasons) MSG_08210_PARAMETER_TYPE_FOUND=Parameter type found: {0} MSG_08211_PARAMETER_VALUE_FOUND=Parameter value found: {0} MSG_08212_PROCEDURE_FOUND=Procedure found: {0} MSG_08213_SP_LANGUAGE_FOUND=SP language found: {0} MSG_08214_STORES_A_REFERRAL=Stores a referral: {0} MSG_08215_TARGET_DN=Target Dn = {0} MSG_08216_TIME_OFFLINE=Time Offline = {0} MSG_08217_USER_IDENTITY=UserIdentity = {0} MSG_08218_KEY_ALGORITHM=Key algorithm = {0} MSG_08219_SUBJECT_DN=Subject Dn = {0} # api-ldap-extras-codec intermediate 8300-8399 MSG_08300_NEW_COOKIE=newcookie = {0} MSG_08301_REFRESH_DONE=refreshDone = {0} MSG_08302_UUID=UUID = {0} # api-ldap-extras-codec-api 9000-9999 # api-ldap-extras-codec-api <> 9000 - 9099 # none # api-ldap-extras-codec-api controls 9100 - 9199 # none # api-ldap-extras-codec-api extended 9200 - 9299 # none # api-ldap-extras-codec-api intermediate 9300 - 9399 # none # api-ldap-extras-sp 10000-10999 # none # api-ldap-extras-trigger 11000-11999 # none # api-ldap-extra-utils <> 12000-12999 # none # api-ldap-model <> 13000-13999 # none # api-ldap-model cursor 13100-13199 MSG_13100_CLOSING_EMPTY_CURSOR=Closing EmptyCursor {0} MSG_13101_CLOSING_LIST_CURSOR=Closing ListCursor {0} MSG_13102_CLOSING_SET_CURSOR=Closing SetCursor {0} MSG_13102_CLOSING_SINGLETON_CURSOR=Closing SingletonCursor {0} MSG_13103_CREATING_EMPTY_CURSOR=Creating EmptyCursor: {0} MSG_13104_CREATING_LIST_CURSOR=Creating ListCursor {0} MSG_13105_CREATING_SET_CURSOR=Creating SetCursor {0} MSG_13106_CREATING_SINGLE_CURSOR=Creating SingletonCursor {0} # api-ldap-model entry 13200-13299 MSG_13200_CANT_STORE_ATTRIBUTE=The attribute ''{0}'' cannot be stored MSG_13201_DN_CANT_BE_NORMALIZED=The Dn ''{0}'' cannot be normalized MSG_13202_AT_IS_NULL=The attributeType is null MSG_13203_MISSING_ATTRIBUTE_IN_ENTRY=The attribute ''{0}'' does not exist in the entry # api-ldap-model filter 13300-13399 # none # api-ldap-model ldif 13400-13499 MSG_13400_LDIF_VERSION=Ldif version: {0} MSG_13401_PARSED_NO_ENTRY=Parsed no entry. MSG_13402_PARSED_ONE_ENTRY=Parsed one entry. MSG_13403_PARSED_N_ENTRIES=Parsed {0} entries. MSG_13404_READ_MODIF=Read a modification: {0} MSG_13405_READ_ATTR=Read an attribute: {0} MSG_13406_READ_ENTRY=Read an entry: {0} MSG_13407_STARTS_PARSING_LDIF=Starts parsing ldif buffer MSG_13408_END_OF_LDIF=The entry is empty: end of ldif file MSG_13409_HAS_NEXT_FALSE=hasNext(): -- returning false MSG_13410_HAS_NEXT_TRUE=hasNext(): -- returning true MSG_13411_NEXT_CALLED=next(): -- called MSG_13412_NEXT_RETURNING_LDIF=next(): -- returning ldif {0}\n MSG_13413_NO_VERSION_ASSUMING_1=No version information: assuming version: 1 MSG_13414_LDIF_FILE_EMPTY=The ldif file is empty # api-ldap-model message 13500-13599 MSG_13500_ATTRIBUTE_NOT_IN_SCHEMA=Requested attribute {0} does not exist in the schema, it will be ignored # api-ldap-model name 13600-13699 MSG_13600_DN_NOT_IN_CACHE_CREATING=Dn {} not found in the cache, creating MSG_13601_DN_FOUND_IN_CACHE=Dn {} found in the cache MSG_13602_PARSED_ATTRIBUTE_TYPE=Parsed attributeType ''{}'' MSG_13603_DN_CACHE_HIT=Dn cache hit - {0} , miss - {1} and is normalized = {2} MSG_13604_CANNOT_PARSE_ATTRIBUTE_TYPE=Cannot parse an attributeType at {0} # api-ldap-model schema 13700-13899 MSG_13700_FAILED_TO_NORMALIZE=Failed to normalize: {0} MSG_13701_SYNTAX_VALID=Syntax valid for ''{0}'' MSG_13702_REMOVED_FROM_REGISTRY=Removed {0} with oid {1} from the registry MSG_13703_AT_WITHOUT_EQ_MR=Attribute {0} does not have an EQUALITY MatchingRule: using NoopNormalizer MSG_13704_CANT_FIND_AT_WITH_SUPERIOR=Cannot find the AttributeType {0} for the AttributeType {1} SUPERIOR MSG_13705_CANT_FIND_AT_IN_MAY=Cannot find the AttributeType {0} for the ObjectClass {1} MAY MSG_13706_CANT_FIND_AT_IN_MUST=Cannot find the AttributeType {0} for the ObjectClass {1} MUST MSG_13707_CANT_FIND_AT_FOR_MR=Cannot find the Comparator {0} for the MatchingRule {1} MSG_13708_CANT_FIND_MR_FOR_AT=Cannot find the MatchingRule {0} for the AttributeType {1} MSG_13709_CANT_FIND_NORM_FOR_MR=Cannot find the Normalizer {0} for the MatchingRule {1} MSG_13710_CANT_FIND_OC_WITH_SUPERIOR=Cannot find the ObjectClass {0} for the ObjectClass {1} SUPERIORS MSG_13711_CANT_FIND_SYN_FOR_AT=Cannot find the Syntax {0} for the AttributeType {1} MSG_13712_CANT_FIND_SYN_FOR_MR=Cannot find the Syntax {0} for the MatchingRule {1} MSG_13713_CANT_FIND_SC_FOR_SYN=Cannot find the SyntaxChecker {0} for the Syntax {1} MSG_13714_CHECKING_ATTRIBUTE_TYPES=Checking AttributeTypes... MSG_13715_CHECKING_MATCHING_RULES=Checking MatchingRules... MSG_13716_CHECKING_OBJECT_CLASSES=Checking ObjectClasses... MSG_13717_CHECKING_SYNTAXES=Checking Syntaxes MSG_13718_PARSING_A=Parsing a {}: {} MSG_13719_REGISTRING_FAILED_ALREADY_PRESENT=Registering of {}:{} failed, is already present in the Registries MSG_13720_REGISTRING=Registering {}:{} MSG_13721_REMOVED_WITH_RULE_ID=Removed {} with ruleId {} from the registry MSG_13722_RENAMED_SCHEMA_NAME_TO=Renamed {} schemaName to {} MSG_13723_FOUND_WITH_OID=Found {0} with oid: {1} MSG_13724_FOUND_WITH_RULE_ID=Found {0} with ruleId: {1} MSG_13725_AT_WITH_NO_SYNTAX=The AttributeType {0} has no Syntax MSG_13726_MR_WITH_NO_COMPARATOR=The MatchingRule {0} has no Comparator MSG_13727_MR_WITH_NO_NORMALIZER=The MatchingRule {0} has no Normalizer MSG_13728_MR_WITH_NO_SYNTAX=The MatchingRule {0} has no Syntax MSG_13729_SYN_WITH_NO_SYNTAX_CHECKER=The Syntax {0} has no SyntaxChecker MSG_13730_SYN_DOES_NOT_REFERENCE=The Syntax {0}:{1} does not reference any {2} MSG_13731_REGISTRED_FOR_OID=registered {0} for OID {1} MSG_13732_NOT_REFERENCE_ANY=The {0}:{1} does not reference any {2} MSG_13733_NOT_REFERENCED_BY_ANY=The {0}:{1} is not referenced by any {2} MSG_13734_NOT_REFERENCED=The {0}:{1} is not referenced MSG_13735_REFERENCED=The {0}:{1} is referenced MSG_13736_UNREGISTERED_SCHEMA_OBJECT=Unregistered SchemaObject ''{0}'' with OID: {1} MSG_13737_UNREGISTERED_FOR_OID=Unregistered {0} for OID {1} MSG_13738_UNREGISTERED_=Unregistered {0}:{1} MSG_13739_UNREGISTERED_FAILED_NOT_PRESENT=Unregistering of {0}:{1} failed, is not present in the Registries MSG_13740_UNREGISTERED_FAILED_NOT_FOUND=Unregistering of {0}:{1} failed, not found in Registries MSG_13741_UNREGISTRING=Unregistering {0}:{1} MSG_13742_REGISTERED_SCHEMA_OBJECT=registered SchemaObject ''{0}'' with OID: {1} MSG_13743_COMPARING_BITSTRING=comparing BitString objects ''{0}'' with ''{1}'' MSG_13744_COMPARING_CSN_SID=comparing CSN SID objects ''{0}'' with ''{1}'' MSG_13745_COMPARING_CSN=comparing CSN objects ''{0}'' with ''{1}'' MSG_13746_COMPARING_INTEGER=comparing Integer objects ''{0}'' with ''{1}'' MSG_13747_COMPARING_OBJECT_IDENTIFIER=comparing ObjectIdentifier objects ''{0}'' with ''{1}'' MSG_13748_COMPARING_OBJECT_IDENTIFIER_FIRST_COMPONENT=comparing ObjectIdentifierFirstComponent objects ''{0}'' with ''{1}'' MSG_13749_COMPARING_STRING=comparing String objects ''{0}'' with ''{1}'' MSG_13750_COMPARING_TELEPHONE_NUMBER=comparing TelephoneNumber objects ''{0}'' with ''{1}'' MSG_13751_COMPARING_UUID=comparing UUID objects ''{0}'' with ''{1}'' MSG_13752_COMPARING_BOOLEAN=comparing boolean objects ''{0}'' with ''{1}'' MSG_13753_COMPARING_GENERALIZED_TIME_ORDERING=comparing generalizedTimeOrdering objects ''{0}'' with ''{1}'' MSG_13754_COMPARING_NUMERIC_STRING_ORDERING=comparing numericStringOrdering objects ''{0}'' with ''{1}'' MSG_13755_COMPARING_OBJECTS=comparing objects ''{0}'' with ''{1}'' MSG_13756_LOOKED_UP_NAME=looked up names ''{0}'' for OID ''{1}'' # api-ldap-net-mina 14000-14999 MSG_14000_DECODING_PDU=Decoding the PDU: MSG_14001_NULL_BUFFER=NULL buffer, what the HELL ??? MSG_14002_DECODED_LDAP_MESSAGE=Decoded LdapMessage: {0} MSG_14003_ENCODED_LDAP_MESSAGE=Encoded LdapMessage \n {0}\n : # api-ldap-schema-converter 15000-15999 MSG_15000_NO_SCHEMA_DEFINED=No schemas defined! MSG_15001_GENERATING_SCHEMA=Generating {0} schema. # api-ldap-schema-data 16000-16999 MSG_16000_BASE_PATH=BASE_PATH set to {0}, outputDirectory set to {1} MSG_16001_CREATING_DIR=Creating output directory: {0} MSG_16002_DIR_EXISTS=Output directory exists: no need to create. MSG_16003_COPYFILE=copyFile(): source = {0}, destination = {1} MSG_16004_SCHEMA_DIR_ABSENT=Schema directory ''{0}'' does NOT exist: extracted state set to false. MSG_16005_SCHEMA_DIR_PRESENT=Schema directory ''{0}'' does exist: extracted state set to true. MSG_16006_INITIALIZING_SCHEMA=Initializing schema MSG_16007_SCHEMA_INITIALIZED=Schema Initialized ... \n{0} MSG_16008_LOADING_FROM_USER_SCHEMA=loading from the user provider schema resource {0} MSG_16009_ELEMENT_DOES_NOT_EXIST=element {0} does not exist MSG_16010_USING_BASE_SCHEMA_DIR=Using ''{0}'' as the base schema load directory. MSG_16011_SCHEMA_XSCHEMA_DIFF=Schema ({0}) and X-SCHEMA ({1}) are different: {2} MSG_16012_URL_SCHEMA_ALL_LDIF=URL of the all schema ldif file {0} MSG_16013_SCHEMA_IS_NULL=The schema is null MSG_16014_LOADING_DISABLED_SCHEMA=Loading {0} disabled schema: \n{1} MSG_16015_LOADING_ENABLED_SCHEMA=Loading {0} enabled schema: \n{1} MSG_16016_UNLOADING_SCHEMA=Unloading {0} schema: \n{1} MSG_16017_UNACCEPTED_DISABLED_SCHEMA=The schema is disabled and the registries does not accepted disabled schema MSG_16018_SCHEMA_ALREADY_LOADED={0} schema has already been loaded MSG_16019_ENABLED_SCHEMA_ADDED=Added {0} into the enabled schema {1} MSG_16020_CANNOT_LOAD_SCHEMAOBJECT=Cannot add the SchemaObject {0} into the registries, the resulting registries would be inconsistent: {1} MSG_16021_ADDED_INTO_DISABLED_SCHEMA=Added {0} into the disabled schema {1} MSG_16022_REMOVED_FROM_ENABLED_SCHEMA=Removed {0} from the enabled schema {1} MSG_16023_CANNOT_DELETE_SCHEMAOBJECT=Cannot delete the SchemaObject {0} from the registries, the resulting registries would be inconsistent: {1} MSG_16024_REMOVED_FROM_DISABLED_SCHEMA=Removed {0} from the disabled schema {1} # api-util 17000-17999 MSG_17000_NO_EXPORT_FOUND=No export found for candidate: {0} MSG_17001_PROCESSING_EXPORTS=Processing exports for candidate: {0}\n\n{1}\n MSG_17002_ADDED_PACKAGE=Added package: {0} MSG_17003_ACCEPTED_CANDIDATE_WITH_FILTER=Accepted candidate with filter: {0} MSG_17004_ACCEPTED_CANDIDATE_NO_FILTER=Accepted candidate without filter: {0} MSG_17005_REJECTING_CANDIDATE=Rejecting candidate: {0} MSG_17006_COMPARING_OBJECTSTRING=comparing OctetString objects ''{0}'' with ''{1}'' MSG_17007_SYNTAX_VALID=Syntax valid for ''{0}'' MSG_17008_SYNTAX_INVALID=Syntax invalid for ''{0}'' MSG_17009_NO_EXACT_MATCH=Could not find accessible exact match for candidateMethod {0} apache-directory-ldap-api-cfb3cee/i18n/src/site/000077500000000000000000000000001525525160600215775ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/i18n/src/site/site.xml000066400000000000000000000025151525525160600232700ustar00rootroot00000000000000 apache-directory-ldap-api-cfb3cee/integ-osgi/000077500000000000000000000000001525525160600213325ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/.gitignore000066400000000000000000000001051525525160600233160ustar00rootroot00000000000000target bin .classpath .project .settings *.log *.iml *.ipr META-INF apache-directory-ldap-api-cfb3cee/integ-osgi/pom.xml000066400000000000000000000142241525525160600226520ustar00rootroot00000000000000 4.0.0 org.apache.directory.api api-parent 2.1.9 api-integ-osgi Apache Directory API OSGi Integration Tests apache.snapshots https://repository.apache.org/snapshots/ org.apache.directory.api api-ldap-client-api org.apache.directory.api api-ldap-net-mina org.apache.directory.api api-ldap-schema-converter org.apache.directory.api api-ldap-extras-aci org.apache.directory.api api-ldap-extras-util org.apache.directory.api api-ldap-extras-sp org.apache.directory.api api-ldap-extras-trigger org.apache.directory.api api-dsml-engine xml-apis xml-apis org.apache.servicemix.bundles org.apache.servicemix.bundles.javax-inject 1_3 test junit junit 4.13.2 test org.ops4j.pax.exam pax-exam-container-forked test org.ops4j.pax.exam pax-exam-junit4 test org.ops4j.pax.exam pax-exam-link-mvn test org.ops4j.pax.url pax-url-aether test org.apache.felix org.apache.felix.framework test org.apache.maven.plugins maven-dependency-plugin copy-dependencies generate-resources runtime ${project.build.directory}/test-classes/deps.txt maven-surefire-plugin 1 false 1 1 org.eclipse.m2e lifecycle-mapping 1.0.0 org.apache.maven.plugins maven-dependency-plugin [2.8,) copy-dependencies apache-directory-ldap-api-cfb3cee/integ-osgi/src/000077500000000000000000000000001525525160600221215ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/000077500000000000000000000000001525525160600231005ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/000077500000000000000000000000001525525160600240215ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/000077500000000000000000000000001525525160600246105ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/000077500000000000000000000000001525525160600260315ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/000077500000000000000000000000001525525160600300355ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/000077500000000000000000000000001525525160600306065ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/000077500000000000000000000000001525525160600315475ustar00rootroot00000000000000ApiAsn1ApiOsgiTest.java000066400000000000000000000025701525525160600357070ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import org.apache.directory.api.asn1.EncoderException; import org.apache.directory.api.asn1.util.BitString; import org.apache.directory.api.asn1.util.Oid; public class ApiAsn1ApiOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.asn1.api"; } @Override protected void useBundleClasses() throws Exception { new EncoderException( "foo" ); Oid.fromString( "1.2.3" ); new BitString( 8 ); } } ApiAsn1BerOsgiTest.java000066400000000000000000000027141525525160600357060ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import org.apache.directory.api.asn1.actions.CheckNotNullLength; import org.apache.directory.api.asn1.ber.Asn1Container; import org.apache.directory.api.asn1.ber.tlv.BerValue; import org.apache.directory.api.asn1.ber.tlv.TLV; public class ApiAsn1BerOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.asn1.ber"; } @Override protected void useBundleClasses() throws Exception { new CheckNotNullLength(); new BerValue().init( 5 ); new TLV( 1 ).getValue(); } } ApiDsmlEngineOsgiTest.java000066400000000000000000000023711525525160600364770ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import org.apache.directory.api.dsmlv2.engine.Dsmlv2Engine; public class ApiDsmlEngineOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.dsmlv2.engine"; } @Override protected void useBundleClasses() throws Exception { new Dsmlv2Engine( "host", 9999, "user", "password" ); } } ApiDsmlParserOsgiTest.java000066400000000000000000000055121525525160600365260ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import org.apache.directory.api.dsmlv2.ParserUtils; import org.apache.directory.api.dsmlv2.request.AddRequestDsml; import org.apache.directory.api.dsmlv2.request.Dsmlv2Grammar; import org.apache.directory.api.dsmlv2.request.SearchRequestDsml; import org.apache.directory.api.dsmlv2.response.LdapResultDsml; import org.apache.directory.api.dsmlv2.response.SearchResponse; import org.apache.directory.api.dsmlv2.response.SearchResultDoneDsml; import org.apache.directory.api.dsmlv2.response.SearchResultEntryDsml; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.message.AddRequestImpl; import org.apache.directory.api.ldap.model.message.LdapResultImpl; import org.apache.directory.api.ldap.model.message.ReferralImpl; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.ldap.model.url.LdapUrl; import org.dom4j.tree.BaseElement; public class ApiDsmlParserOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.dsmlv2.parser"; } @Override protected void useBundleClasses() throws Exception { new Dsmlv2Grammar(); new AddRequestDsml( null ); new SearchRequestDsml( null ); ParserUtils.base64Encode( "abc" ); new Dn( "cn=foo" ); new LdapUrl( "ldap://example.com/" ); ResultCodeEnum.TOO_LATE.getMessage(); ParserUtils.needsBase64Encoding( null ); ParserUtils.parseAndVerifyRequestID( "5", null ); new BaseElement( "foo" ); context.getService( context.getServiceReference( LdapApiService.class.getName() ) ); new AddRequestImpl(); new ReferralImpl(); new LdapResultImpl(); new SearchResponse(); new LdapResultDsml( null, null, null ); new SearchResultEntryDsml( null ); new SearchResultDoneDsml( null ); } } ApiI18nOsgiTest.java000066400000000000000000000026241525525160600351720ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import static org.junit.Assert.assertNotNull; import org.apache.directory.api.i18n.I18n; public class ApiI18nOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.i18n"; } @Override protected void useBundleClasses() throws Exception { I18n errorCode = I18n.ERR_01200_BAD_TRANSITION_FROM_STATE; assertNotNull( errorCode ); assertNotNull( errorCode.getErrorCode() ); assertNotNull( I18n.err( errorCode ) ); } } ApiLdapClientApiOsgiTest.java000066400000000000000000000060541525525160600371250ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import org.apache.commons.pool2.PooledObjectFactory; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import org.apache.directory.api.ldap.codec.api.SaslFilter; import org.apache.directory.api.ldap.model.constants.SaslQoP; import org.apache.directory.ldap.client.api.DefaultPoolableLdapConnectionFactory; import org.apache.directory.ldap.client.api.Krb5LoginConfiguration; import org.apache.directory.ldap.client.api.LdapConnection; import org.apache.directory.ldap.client.api.LdapConnectionConfig; import org.apache.directory.ldap.client.api.LdapConnectionPool; import org.apache.directory.ldap.client.api.LdapNetworkConnection; import org.apache.directory.ldap.client.api.SaslGssApiRequest; import org.apache.directory.ldap.client.api.future.AddFuture; import org.apache.directory.ldap.client.api.search.FilterBuilder; import org.apache.directory.ldap.client.template.LdapConnectionTemplate; public class ApiLdapClientApiOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.ldap.client.api"; } @Override protected void useBundleClasses() throws Exception { new LdapNetworkConnection().close(); new SaslGssApiRequest(); new Krb5LoginConfiguration(); new AddFuture( new LdapNetworkConnection(), 2 ); new LdapConnectionTemplate( new LdapConnectionPool( new DefaultPoolableLdapConnectionFactory( new LdapConnectionConfig() ) ) ); FilterBuilder.and( FilterBuilder.not( FilterBuilder.contains( "cn", "a", "b" ) ) ).toString(); // Test for DIRAPI-239 PooledObjectFactory factory = new DefaultPoolableLdapConnectionFactory( new LdapConnectionConfig() ); GenericObjectPoolConfig config = new GenericObjectPoolConfig(); LdapConnectionPool ldapConnectionPool = new LdapConnectionPool( factory, config ); ldapConnectionPool.getLdapApiService(); ldapConnectionPool.getTestOnBorrow(); ldapConnectionPool.close(); // Test SaslFilter SaslFilter.OFFSET.toString(); SaslQoP.AUTH_CONF.name(); org.apache.mina.core.buffer.IoBuffer.isUseDirectBuffer(); } } ApiLdapCodecCoreOsgiTest.java000066400000000000000000000075741525525160600371130ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import javax.inject.Inject; import org.apache.directory.api.ldap.codec.LdapStatesEnum; import org.apache.directory.api.ldap.codec.actions.request.add.InitAddRequest; import org.apache.directory.api.ldap.codec.actions.request.bind.InitBindRequest; import org.apache.directory.api.ldap.codec.actions.request.search.InitSearchRequest; import org.apache.directory.api.ldap.codec.actions.response.add.InitAddResponse; import org.apache.directory.api.ldap.codec.actions.response.bind.InitBindResponse; import org.apache.directory.api.ldap.codec.actions.response.search.done.InitSearchResultDone; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory; import org.apache.directory.api.ldap.codec.api.SaslFilter; import org.apache.directory.api.ldap.codec.search.AndFilter; import org.apache.directory.api.ldap.codec.search.SubstringFilter; import org.apache.directory.api.ldap.model.constants.SaslQoP; import org.apache.directory.api.ldap.model.message.SearchRequestImpl; import org.apache.directory.api.ldap.model.message.controls.SortRequest; import org.junit.Test; import org.osgi.framework.ServiceReference; public class ApiLdapCodecCoreOsgiTest extends ApiOsgiTestBase { @Inject LdapApiService ldapApiService; @Override protected String getBundleName() { return "org.apache.directory.api.ldap.codec.core"; } @Override protected void useBundleClasses() throws Exception { LdapStatesEnum.END_STATE.isEndState(); new InitBindRequest(); new InitBindResponse(); new InitAddRequest(); new InitAddResponse(); new InitSearchRequest(); new InitSearchResultDone(); new AndFilter(); new SubstringFilter(); new SearchRequestImpl(); // Test SaslFilter SaslFilter.OFFSET.toString(); SaslQoP.AUTH_CONF.name(); org.apache.mina.core.buffer.IoBuffer.isUseDirectBuffer(); } @Test public void testInjectLdapApiService() { assertNotNull( ldapApiService ); } @Test public void testLookupLdapApiService() { ServiceReference serviceReference = context.getServiceReference( LdapApiService.class ); Object service = context.getService( serviceReference ); assertNotNull( service ); assertTrue( service instanceof LdapApiService ); } @Test public void testLdapApiServiceFactoryIsInitializedByOsgi() { assertTrue( LdapApiServiceFactory.isInitialized() ); assertFalse( LdapApiServiceFactory.isUsingStandaloneImplementation() ); LdapApiService ldapApiService = LdapApiServiceFactory.getSingleton(); assertNotNull( ldapApiService ); assertNotNull( ldapApiService.getProtocolCodecFactory() ); assertTrue( ldapApiService.isControlRegistered( SortRequest.OID ) ); } } ApiLdapExtrasAciOsgiTest.java000066400000000000000000000043401525525160600371340ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import org.apache.directory.api.ldap.aci.ACIItemParser; import org.apache.directory.api.ldap.aci.GrantAndDenial; import org.apache.directory.api.ldap.aci.MicroOperation; import org.apache.directory.api.ldap.aci.ProtectedItem; import org.apache.directory.api.ldap.aci.UserClass; public class ApiLdapExtrasAciOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.ldap.extras.aci"; } @Override protected void useBundleClasses() throws Exception { GrantAndDenial.GRANT_BROWSE.toString(); MicroOperation.BROWSE.getName(); UserClass.THIS_ENTRY.toString(); ProtectedItem.ENTRY.toString(); new ACIItemParser( null ).check( "" ); new ACIItemParser( null ).parse( "" ); String spec = "{ identificationTag \"test\", precedence 14, authenticationLevel simple, " + "itemOrUserFirst userFirst: { userClasses { allUsers }, userPermissions { { " + "precedence 1, protectedItems { attributeType { userPassword } }, grantsAndDenials " + "{ denyRead, denyReturnDN, denyBrowse } }, { precedence 2, protectedItems " + "{ entry, allUserAttributeTypesAndValues }, grantsAndDenials " + "{ grantReturnDN, grantRead, grantBrowse } } } } }"; new ACIItemParser( null ).parse( spec ); } } ApiLdapExtrasCodecApiOsgiTest.java000066400000000000000000000111631525525160600401100ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import org.apache.directory.api.ldap.extras.controls.SynchronizationModeEnum; import org.apache.directory.api.ldap.extras.controls.ad.AdDirSyncRequestImpl; import org.apache.directory.api.ldap.extras.controls.ad.AdDirSyncResponseImpl; import org.apache.directory.api.ldap.extras.controls.ad.AdShowDeletedImpl; import org.apache.directory.api.ldap.extras.controls.ad.AdPolicyHintsImpl; import org.apache.directory.api.ldap.extras.controls.changeNotifications.ChangeNotificationsImpl; import org.apache.directory.api.ldap.extras.controls.passwordExpired.PasswordExpiredResponseImpl; import org.apache.directory.api.ldap.extras.controls.permissiveModify.PermissiveModifyImpl; import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyRequestImpl; import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyResponseImpl; import org.apache.directory.api.ldap.extras.controls.syncrepl.syncDone.SyncDoneValueImpl; import org.apache.directory.api.ldap.extras.controls.syncrepl.syncRequest.SyncRequestValueImpl; import org.apache.directory.api.ldap.extras.controls.syncrepl.syncState.SyncStateValueImpl; import org.apache.directory.api.ldap.extras.controls.vlv.VirtualListViewRequestImpl; import org.apache.directory.api.ldap.extras.controls.vlv.VirtualListViewResponseImpl ; import org.apache.directory.api.ldap.extras.extended.endTransaction.EndTransactionRequestImpl; import org.apache.directory.api.ldap.extras.extended.endTransaction.EndTransactionResponseImpl; import org.apache.directory.api.ldap.extras.extended.pwdModify.PasswordModifyRequestImpl; import org.apache.directory.api.ldap.extras.extended.pwdModify.PasswordModifyResponseImpl; import org.apache.directory.api.ldap.extras.extended.startTls.StartTlsRequestImpl; import org.apache.directory.api.ldap.extras.extended.startTls.StartTlsResponseImpl; import org.apache.directory.api.ldap.extras.extended.startTransaction.StartTransactionRequestImpl; import org.apache.directory.api.ldap.extras.extended.startTransaction.StartTransactionResponseImpl; import org.apache.directory.api.ldap.extras.extended.whoAmI.WhoAmIRequestImpl; import org.apache.directory.api.ldap.extras.extended.whoAmI.WhoAmIResponseImpl; import org.apache.directory.api.ldap.model.name.Dn; public class ApiLdapExtrasCodecApiOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.ldap.extras.codec.api"; } @Override protected void useBundleClasses() throws Exception { SynchronizationModeEnum.REFRESH_AND_PERSIST.getValue(); // Controls new AdDirSyncRequestImpl().getOid(); new AdDirSyncResponseImpl().getOid(); new AdPolicyHintsImpl().getOid(); new AdShowDeletedImpl().getOid(); new ChangeNotificationsImpl().getOid(); new PasswordExpiredResponseImpl().getTimeBeforeExpiration(); new PasswordPolicyRequestImpl().getOid(); new PasswordPolicyResponseImpl().getGraceAuthNRemaining(); new PermissiveModifyImpl().getOid(); new SyncDoneValueImpl().getOid(); new SyncRequestValueImpl().getOid(); new SyncStateValueImpl( true ).getCookie(); new VirtualListViewRequestImpl().getOid(); new VirtualListViewResponseImpl().getOid(); // Extended operations new EndTransactionRequestImpl(); new EndTransactionResponseImpl(); new PasswordModifyRequestImpl().getUserIdentity(); new PasswordModifyResponseImpl( 5 ).setResponseName( "foo" ); new StartTlsRequestImpl(); new StartTlsResponseImpl(); new StartTransactionRequestImpl(); new StartTransactionResponseImpl(); new WhoAmIRequestImpl(); new WhoAmIResponseImpl().setDn( new Dn( "uid=admin,ou=system" ) ); } } ApiLdapExtrasCodecOsgiTest.java000066400000000000000000000113121525525160600374520ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import javax.inject.Inject; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.extras.controls.passwordExpired.PasswordExpiredResponse; import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyRequest; import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyResponse; import org.apache.directory.api.ldap.extras.extended.pwdModify.PasswordModifyRequest; import org.apache.directory.api.ldap.extras.extended.pwdModify.PasswordModifyResponse; import org.apache.directory.api.ldap.extras.extended.startTls.StartTlsRequest; import org.apache.directory.api.ldap.extras.extended.startTls.StartTlsResponse; import org.apache.directory.api.ldap.extras.intermediate.syncrepl.SyncInfoValue; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.ldap.model.message.ExtendedRequest; import org.apache.directory.api.ldap.model.message.ExtendedResponse; import org.apache.directory.api.ldap.model.message.IntermediateResponse; import org.apache.directory.api.ldap.model.message.extended.NoticeOfDisconnect; public class ApiLdapExtrasCodecOsgiTest extends ApiOsgiTestBase { @Inject LdapApiService ldapApiService; @Override protected String getBundleName() { return "org.apache.directory.api.ldap.extras.codec"; } @Override protected void useBundleClasses() throws Exception { Control peResponse = ldapApiService.getResponseControlFactories() .get( PasswordExpiredResponse.OID ).newControl(); assertNotNull( peResponse ); assertTrue( peResponse instanceof PasswordExpiredResponse ); Control ppRequest = ldapApiService.getRequestControlFactories() .get( PasswordPolicyRequest.OID ).newControl(); assertNotNull( ppRequest ); assertTrue( ppRequest instanceof PasswordPolicyRequest ); Control ppResponse = ldapApiService.getResponseControlFactories() .get( PasswordPolicyResponse.OID ).newControl(); assertNotNull( ppResponse ); assertTrue( ppResponse instanceof PasswordPolicyResponse ); ExtendedRequest startTlsRequest = ldapApiService.getExtendedRequestFactories() .get( StartTlsRequest.EXTENSION_OID ).newRequest(); assertNotNull( startTlsRequest ); assertTrue( startTlsRequest instanceof StartTlsRequest ); ExtendedResponse startTlsResponse = ldapApiService.getExtendedResponseFactories() .get( StartTlsRequest.EXTENSION_OID ).newResponse(); assertNotNull( startTlsResponse ); assertTrue( startTlsResponse instanceof StartTlsResponse ); ExtendedRequest modifyPasswordRequest = ldapApiService.getExtendedRequestFactories() .get( PasswordModifyRequest.EXTENSION_OID ).newRequest(); assertNotNull( modifyPasswordRequest ); assertTrue( modifyPasswordRequest instanceof PasswordModifyRequest ); ExtendedResponse passwordModifyResponse = ldapApiService.getExtendedResponseFactories() .get( PasswordModifyRequest.EXTENSION_OID ).newResponse(); assertNotNull( passwordModifyResponse ); assertTrue( passwordModifyResponse instanceof PasswordModifyResponse ); ExtendedResponse noticeOfDisconnectResponse = ldapApiService.getExtendedResponseFactories() .get( NoticeOfDisconnect.EXTENSION_OID ).newResponse(); assertNotNull( noticeOfDisconnectResponse ); assertTrue( noticeOfDisconnectResponse instanceof NoticeOfDisconnect ); IntermediateResponse syncInfoResponse = ldapApiService.getIntermediateResponseFactories() .get( SyncInfoValue.OID ).newResponse(); assertNotNull( syncInfoResponse ); assertTrue( syncInfoResponse instanceof SyncInfoValue ); } } ApiLdapExtrasSpOsgiTest.java000066400000000000000000000023531525525160600370240ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import org.apache.directory.api.ldap.sp.LdapContextParameter; public class ApiLdapExtrasSpOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.ldap.extras.sp"; } @Override protected void useBundleClasses() throws Exception { new LdapContextParameter( "foo" ); } } ApiLdapExtrasTriggerOsgiTest.java000066400000000000000000000025671525525160600400540ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import org.apache.directory.api.ldap.trigger.TriggerSpecificationParser; public class ApiLdapExtrasTriggerOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.ldap.extras.trigger"; } @Override protected void useBundleClasses() throws Exception { String spec = "AFTER Delete CALL \"BackupUtilities.backupDeletedEntry\" ($name, $deletedEntry);"; new TriggerSpecificationParser().parse( spec ); } } ApiLdapExtrasUtilOsgiTest.java000066400000000000000000000030531525525160600373550ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import static org.junit.Assert.assertEquals; import javax.naming.Name; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.ldap.util.JndiUtils; import org.apache.directory.api.ldap.util.tree.DnNode; public class ApiLdapExtrasUtilOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.ldap.extras.util"; } @Override protected void useBundleClasses() throws Exception { Dn dn = new Dn( "cn=foo" ); Name name = JndiUtils.toName( dn ); assertEquals( name.toString(), dn.toString() ); new DnNode().add( dn ).getParent(); } } ApiLdapModelOsgiTest.java000066400000000000000000000052311525525160600363110ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import org.apache.directory.api.ldap.model.entry.AttributeUtils; import org.apache.directory.api.ldap.model.entry.DefaultAttribute; import org.apache.directory.api.ldap.model.entry.DefaultEntry; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.filter.EqualityNode; import org.apache.directory.api.ldap.model.message.BindRequestImpl; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.ldap.model.schema.LdapSyntax; import org.apache.directory.api.ldap.model.schema.SchemaObject; import org.apache.directory.api.ldap.model.schema.parsers.ObjectClassDescriptionSchemaParser; import org.apache.directory.api.ldap.model.schema.registries.Registries; import org.apache.directory.api.ldap.model.url.LdapUrl; public class ApiLdapModelOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.ldap.model"; } @Override protected void useBundleClasses() throws Exception { new Dn( "dc=example,dc=com" ); new Dn( "cn=a+sn=b,dc=example,dc=com" ); new Value( "foo" ); new DefaultAttribute( "cn" ); new DefaultEntry(); AttributeUtils.toJndiAttribute( new DefaultAttribute( "cn" ) ); new BindRequestImpl(); new EqualityNode( "cn", "foo" ); new LdapUrl( "ldap://ldap.example.com:10389/dc=example,dc=com?objectclass" ); new ObjectClassDescriptionSchemaParser() .parse( "( 2.5.6.0 NAME 'top' DESC 'top of the superclass chain' ABSTRACT MUST objectClass )" ); SchemaObject schemaObject = new LdapSyntax( "1.2.3" ); new Registries().getGlobalOidRegistry().register( schemaObject ); new Registries().getLoadedSchemas(); } } ApiLdapNetMinaOsgiTest.java000066400000000000000000000042621525525160600366070ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import javax.inject.Inject; import org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolCodecFactory; import org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolDecoder; import org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolEncoder; import org.junit.Test; import org.osgi.framework.ServiceReference; public class ApiLdapNetMinaOsgiTest extends ApiOsgiTestBase { @Inject LdapProtocolCodecFactory ldapProtocolCodecFactory; @Override protected String getBundleName() { return "org.apache.directory.api.ldap.net.mina"; } @Override protected void useBundleClasses() throws Exception { new LdapProtocolDecoder( null ); new LdapProtocolEncoder(); } @Test public void testInjectLdapProtocolCodecFactory() { assertNotNull( ldapProtocolCodecFactory ); } @Test public void testLookupLdapProtocolCodecFactory() { ServiceReference serviceReference = context.getServiceReference( LdapProtocolCodecFactory.class ); Object service = context.getService( serviceReference ); assertNotNull( service ); assertTrue( service instanceof LdapProtocolCodecFactory ); } } ApiLdapSchemaConverterOsgiTest.java000066400000000000000000000036201525525160600403410ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import java.io.ByteArrayInputStream; import java.io.StringWriter; import java.io.Writer; import java.util.ArrayList; import java.util.List; import org.apache.directory.api.ldap.schema.converter.Schema; import org.apache.directory.api.ldap.schema.converter.SchemaToLdif; import org.apache.directory.api.util.Strings; public class ApiLdapSchemaConverterOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.ldap.schema.converter"; } @Override protected void useBundleClasses() throws Exception { List schemas = new ArrayList(); Schema schema = new Schema(); schema.setName( "foo" ); schema.setInput( new ByteArrayInputStream( Strings.getBytesUtf8( "attributetype ( 1.3.6.1.4.1.18060.0.4.2.3.14 NAME ( 'at' 'attribute' ) )" ) ) ); Writer out = new StringWriter( 2048 ); schema.setOutput( out ); schemas.add( schema ); SchemaToLdif.transform( schemas ); } } ApiLdapSchemaDataOsgiTest.java000066400000000000000000000033271525525160600372470ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import java.io.IOException; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.ldap.schema.loader.JarLdifSchemaLoader; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; public class ApiLdapSchemaDataOsgiTest extends ApiOsgiTestBase { @Override protected String getBundleName() { return "org.apache.directory.api.ldap.schema"; } @Override protected void useBundleClasses() throws LdapException, IOException { JarLdifSchemaLoader loader = new JarLdifSchemaLoader(); loader.getAllEnabled(); loader.getAllSchemas(); SchemaManager schemaManager = new DefaultSchemaManager(); schemaManager.getEnabled(); schemaManager.getDisabled(); } } ApiOsgiTestBase.java000066400000000000000000000115631525525160600353270ustar00rootroot00000000000000apache-directory-ldap-api-cfb3cee/integ-osgi/src/test/java/org/apache/directory/api/osgi/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.api.osgi; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.ops4j.pax.exam.CoreOptions.composite; import static org.ops4j.pax.exam.CoreOptions.junitBundles; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.options; import static org.ops4j.pax.exam.CoreOptions.systemPackages; import static org.ops4j.pax.exam.CoreOptions.systemProperty; import static org.ops4j.pax.exam.CoreOptions.url; import java.io.File; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.inject.Inject; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; import org.ops4j.pax.exam.spi.reactors.PerClass; import org.ops4j.pax.exam.util.PathUtils; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; @RunWith(PaxExam.class) @ExamReactorStrategy(PerClass.class) public abstract class ApiOsgiTestBase { @Inject protected BundleContext context; private static Set skips = new HashSet(); @Configuration public Option[] config() throws IOException { List