apache-ldap-api-1.0.0-src/all/0040755 0000767 0000024 00000000000 13114115502 017447 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/all/api-all/0040755 0000767 0000024 00000000000 13114114302 020763 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/all/src/0040755 0000767 0000024 00000000000 13114114302 020233 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/all/src/main/0040755 0000767 0000024 00000000000 13114114302 021157 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/all/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114302 024747 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/all/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114302 026107 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/0040755 0000767 0000024 00000000000 13114114416 017544 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/0040755 0000767 0000024 00000000000 13114114427 020317 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/META-INF/0040755 0000767 0000024 00000000000 13114114427 021457 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/0040755 0000767 0000024 00000000000 13114114302 021076 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/0040755 0000767 0000024 00000000000 13114114302 022022 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/java/0040755 0000767 0000024 00000000000 13114114302 022743 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/0040755 0000767 0000024 00000000000 13114114302 023532 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114302 024753 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114302 026757 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114302 027530 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/0040755 0000767 0000024 00000000000 13114114302 030372 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/util/0040755 0000767 0000024 00000000000 13114114302 031347 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/resources/0040755 0000767 0000024 00000000000 13114114302 024034 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/site/0040755 0000767 0000024 00000000000 13114114302 022042 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/test/0040755 0000767 0000024 00000000000 13114114302 022055 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/test/java/0040755 0000767 0000024 00000000000 13114114302 022776 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/test/java/org/0040755 0000767 0000024 00000000000 13114114302 023565 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114302 025006 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114302 027012 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114302 027563 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/test/java/org/apache/directory/api/asn1/0040755 0000767 0000024 00000000000 13114114302 030425 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/test/java/org/apache/directory/api/asn1/util/0040755 0000767 0000024 00000000000 13114114302 031402 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/test/resources/0040755 0000767 0000024 00000000000 13114114302 024067 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/0040755 0000767 0000024 00000000000 13114114447 020320 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/META-INF/0040755 0000767 0000024 00000000000 13114114447 021460 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/0040755 0000767 0000024 00000000000 13114114301 021074 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/0040755 0000767 0000024 00000000000 13114114301 022020 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/0040755 0000767 0000024 00000000000 13114114301 022741 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/0040755 0000767 0000024 00000000000 13114114301 023530 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114301 024751 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114301 026755 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114301 027526 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/0040755 0000767 0000024 00000000000 13114114301 030370 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/0040755 0000767 0000024 00000000000 13114114302 032031 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/0040755 0000767 0000024 00000000000 13114114302 031141 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/0040755 0000767 0000024 00000000000 13114114302 032567 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/0040755 0000767 0000024 00000000000 13114114302 031746 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/resources/0040755 0000767 0000024 00000000000 13114114301 024032 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/site/0040755 0000767 0000024 00000000000 13114114301 022040 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/0040755 0000767 0000024 00000000000 13114114301 022053 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/0040755 0000767 0000024 00000000000 13114114301 022774 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/0040755 0000767 0000024 00000000000 13114114301 023563 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114301 025004 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114301 027010 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114301 027561 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/api/asn1/0040755 0000767 0000024 00000000000 13114114301 030423 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/0040755 0000767 0000024 00000000000 13114114301 031173 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/0040755 0000767 0000024 00000000000 13114114302 032001 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/resources/0040755 0000767 0000024 00000000000 13114114301 024065 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/src/0040755 0000767 0000024 00000000000 13114114301 020324 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/asn1/src/site/0040755 0000767 0000024 00000000000 13114114301 021270 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/distribution/0040755 0000767 0000024 00000000000 13114116247 021425 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/distribution/src/0040755 0000767 0000024 00000000000 13114114302 022202 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/distribution/src/main/0040755 0000767 0000024 00000000000 13114114302 023126 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/distribution/src/main/assembly/0040755 0000767 0000024 00000000000 13114114303 024746 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/distribution/src/main/release/0040755 0000767 0000024 00000000000 13114114303 024547 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/distribution/src/main/release/licenses/0040755 0000767 0000024 00000000000 13114114303 026354 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/0040755 0000767 0000024 00000000000 13114115132 017635 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/0040755 0000767 0000024 00000000000 13114115356 021112 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/META-INF/0040755 0000767 0000024 00000000000 13114115356 022252 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/0040755 0000767 0000024 00000000000 13114114273 021676 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/main/0040755 0000767 0000024 00000000000 13114114273 022622 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/main/java/0040755 0000767 0000024 00000000000 13114114273 023543 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/main/java/org/0040755 0000767 0000024 00000000000 13114114273 024332 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114273 025553 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114273 027557 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114273 030330 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/main/java/org/apache/directory/api/dsmlv2/0040755 0000767 0000024 00000000000 13114114273 031537 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/main/java/org/apache/directory/api/dsmlv2/engine/0040755 0000767 0000024 00000000000 13114114275 033006 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/main/resources/0040755 0000767 0000024 00000000000 13114114273 024634 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/site/0040755 0000767 0000024 00000000000 13114114275 022644 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/0040755 0000767 0000024 00000000000 13114115145 021135 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/META-INF/0040755 0000767 0000024 00000000000 13114115145 022275 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/0040755 0000767 0000024 00000000000 13114114301 021715 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/checkstyle/0040755 0000767 0000024 00000000000 13114114302 024054 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/0040755 0000767 0000024 00000000000 13114114301 022641 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/0040755 0000767 0000024 00000000000 13114114301 023562 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/0040755 0000767 0000024 00000000000 13114114301 024351 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114301 025572 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114301 027576 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114301 030347 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/0040755 0000767 0000024 00000000000 13114114302 031557 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/actions/0040755 0000767 0000024 00000000000 13114114302 033217 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/0040755 0000767 0000024 00000000000 13114114302 033247 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/0040755 0000767 0000024 00000000000 13114114302 033415 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/resources/0040755 0000767 0000024 00000000000 13114114301 024653 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/resources/org/0040755 0000767 0000024 00000000000 13114114301 025442 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/resources/org/apache/0040755 0000767 0000024 00000000000 13114114301 026663 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/resources/org/apache/directory/0040755 0000767 0000024 00000000000 13114114301 030667 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/resources/org/apache/directory/shared/0040755 0000767 0000024 00000000000 13114114301 032135 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/resources/org/apache/directory/shared/dsmlv2/0040755 0000767 0000024 00000000000 13114114301 033344 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/site/0040755 0000767 0000024 00000000000 13114114301 022661 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/0040755 0000767 0000024 00000000000 13114114274 022705 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/0040755 0000767 0000024 00000000000 13114114273 023625 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/0040755 0000767 0000024 00000000000 13114114273 024414 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114273 025635 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114273 027641 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114273 030412 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/0040755 0000767 0000024 00000000000 13114114275 031623 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/abandonRequest/0040755 0000767 0000024 00000000000 13114114275 034576 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/addRequest/0040755 0000767 0000024 00000000000 13114114275 033724 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/addResponse/0040755 0000767 0000024 00000000000 13114114275 034072 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/authRequest/0040755 0000767 0000024 00000000000 13114114275 034135 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/authResponse/0040755 0000767 0000024 00000000000 13114114275 034303 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/batchRequest/0040755 0000767 0000024 00000000000 13114114275 034255 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/batchResponse/0040755 0000767 0000024 00000000000 13114114275 034423 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/compareRequest/0040755 0000767 0000024 00000000000 13114114275 034622 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000145 13114114275 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/compareResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/compareResponse/0040755 0000767 0000024 00000000000 13114114275 034770 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/delRequest/0040755 0000767 0000024 00000000000 13114114275 033740 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/delResponse/0040755 0000767 0000024 00000000000 13114114275 034106 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/errorResponse/0040755 0000767 0000024 00000000000 13114114275 034473 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000145 13114114275 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/extendedRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/extendedRequest/0040755 0000767 0000024 00000000000 13114114275 034774 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114275 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/extendedResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/extendedResponse0040755 0000767 0000024 00000000000 13114114275 035063 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modDNRequest/0040755 0000767 0000024 00000000000 13114114275 034175 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modDNResponse/0040755 0000767 0000024 00000000000 13114114275 034343 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modifyRequest/0040755 0000767 0000024 00000000000 13114114275 034463 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modifyResponse/0040755 0000767 0000024 00000000000 13114114275 034631 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchRequest/0040755 0000767 0000024 00000000000 13114114275 034441 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/0040755 0000767 0000024 00000000000 13114114275 034607 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000165 13114114275 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/s0040755 0000767 0000024 00000000000 13114114275 034772 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000166 13114114275 011635 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/s0040755 0000767 0000024 00000000000 13114114275 034772 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000172 13114114275 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/s0040755 0000767 0000024 00000000000 13114114275 034772 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/soap/0040755 0000767 0000024 00000000000 13114114275 032565 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/0040755 0000767 0000024 00000000000 13114114301 024706 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/0040755 0000767 0000024 00000000000 13114114274 025506 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/0040755 0000767 0000024 00000000000 13114114274 026727 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/0040755 0000767 0000024 00000000000 13114114274 030733 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114274 031504 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/0040755 0000767 0000024 00000000000 13114114301 032702 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114277 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0040755 0000767 0000024 00000000000 13114114277 035076 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000145 13114114276 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0040755 0000767 0000024 00000000000 13114114276 035016 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114276 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0040755 0000767 0000024 00000000000 13114114276 035105 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114277 011635 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0040755 0000767 0000024 00000000000 13114114277 035151 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114300 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0040755 0000767 0000024 00000000000 13114114300 035135 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0040755 0000767 0000024 00000000000 13114114301 035071 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0040755 0000767 0000024 00000000000 13114114276 035106 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0040755 0000767 0000024 00000000000 13114114276 035121 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0040755 0000767 0000024 00000000000 13114114276 035116 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000145 13114114277 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0040755 0000767 0000024 00000000000 13114114277 035033 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0040755 0000767 0000024 00000000000 13114114301 035106 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0040755 0000767 0000024 00000000000 13114114276 035156 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0040755 0000767 0000024 00000000000 13114114276 035106 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0040755 0000767 0000024 00000000000 13114114300 035074 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114277 011636 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0040755 0000767 0000024 00000000000 13114114277 035025 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0040755 0000767 0000024 00000000000 13114114300 035012 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0040755 0000767 0000024 00000000000 13114114276 035127 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0040755 0000767 0000024 00000000000 13114114276 035136 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0040755 0000767 0000024 00000000000 13114114300 035071 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000160 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0040755 0000767 0000024 00000000000 13114114300 035071 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0040755 0000767 0000024 00000000000 13114114301 035101 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000172 13114114301 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0040755 0000767 0000024 00000000000 13114114301 035101 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000173 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0040755 0000767 0000024 00000000000 13114114301 035101 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000177 13114114301 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0040755 0000767 0000024 00000000000 13114114301 035101 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/soap/0040755 0000767 0000024 00000000000 13114114276 033657 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/src/0040755 0000767 0000024 00000000000 13114114273 020431 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/src/site/0040755 0000767 0000024 00000000000 13114114275 021377 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/0040755 0000767 0000024 00000000000 13114114350 017456 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/META-INF/0040755 0000767 0000024 00000000000 13114114350 020616 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/0040755 0000767 0000024 00000000000 13114114303 020243 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/checkstyle/0040755 0000767 0000024 00000000000 13114114303 022401 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/0040755 0000767 0000024 00000000000 13114114303 021167 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/java/0040755 0000767 0000024 00000000000 13114114303 022110 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/java/org/0040755 0000767 0000024 00000000000 13114114303 022677 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114303 024120 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114303 026124 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114303 026675 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/java/org/apache/directory/api/i18n/0040755 0000767 0000024 00000000000 13114114303 027454 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/resources/0040755 0000767 0000024 00000000000 13114114302 023200 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/resources/org/0040755 0000767 0000024 00000000000 13114114302 023767 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/resources/org/apache/0040755 0000767 0000024 00000000000 13114114302 025210 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/resources/org/apache/directory/0040755 0000767 0000024 00000000000 13114114302 027214 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/resources/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114302 027765 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/resources/org/apache/directory/api/i18n/0040755 0000767 0000024 00000000000 13114114303 030545 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/site/0040755 0000767 0000024 00000000000 13114114303 021207 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/0040755 0000767 0000024 00000000000 13114116150 020005 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/0040755 0000767 0000024 00000000000 13114114302 020571 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/checkstyle/0040755 0000767 0000024 00000000000 13114114302 022727 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/site/0040755 0000767 0000024 00000000000 13114114302 021535 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/0040755 0000767 0000024 00000000000 13114114302 021550 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/0040755 0000767 0000024 00000000000 13114114302 022471 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/0040755 0000767 0000024 00000000000 13114114302 023260 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114302 024501 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114302 026505 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114302 027256 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114302 030176 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/aci/0040755 0000767 0000024 00000000000 13114114302 030732 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/codec/0040755 0000767 0000024 00000000000 13114114302 031253 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/codec/api/0040755 0000767 0000024 00000000000 13114114302 032024 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/0040755 0000767 0000024 00000000000 13114114302 031337 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/0040755 0000767 0000024 00000000000 13114114302 031276 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/0040755 0000767 0000024 00000000000 13114114302 032216 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/schema/0040755 0000767 0000024 00000000000 13114114302 031436 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/0040755 0000767 0000024 00000000000 13114114302 034434 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/subtree/0040755 0000767 0000024 00000000000 13114114302 031647 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/resources/0040755 0000767 0000024 00000000000 13114114302 023562 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/0040755 0000767 0000024 00000000000 13114116171 020747 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/0040755 0000767 0000024 00000000000 13114114302 021530 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/main/0040755 0000767 0000024 00000000000 13114114302 022454 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/main/java/0040755 0000767 0000024 00000000000 13114114302 023375 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/main/resources/0040755 0000767 0000024 00000000000 13114114302 024466 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/0040755 0000767 0000024 00000000000 13114114302 022507 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/0040755 0000767 0000024 00000000000 13114114302 023430 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/0040755 0000767 0000024 00000000000 13114114302 024217 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114302 025440 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114302 027444 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114302 030215 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/0040755 0000767 0000024 00000000000 13114114302 031156 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/resources/0040755 0000767 0000024 00000000000 13114114302 024521 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/0040755 0000767 0000024 00000000000 13114116217 021032 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/0040755 0000767 0000024 00000000000 13114114273 021621 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/main/0040755 0000767 0000024 00000000000 13114114273 022545 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/main/java/0040755 0000767 0000024 00000000000 13114114273 023466 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/main/resources/0040755 0000767 0000024 00000000000 13114114273 024557 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/test/0040755 0000767 0000024 00000000000 13114114273 022600 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/test/java/0040755 0000767 0000024 00000000000 13114114273 023521 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/test/java/org/0040755 0000767 0000024 00000000000 13114114273 024310 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114273 025531 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114273 027535 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114273 030306 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/test/java/org/apache/directory/api/osgi/0040755 0000767 0000024 00000000000 13114114274 031250 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi2/src/test/resources/0040755 0000767 0000024 00000000000 13114114274 024613 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/0040755 0000767 0000024 00000000000 13114114470 017622 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/0040755 0000767 0000024 00000000000 13114115310 021072 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/all/0040755 0000767 0000024 00000000000 13114115665 021657 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/all/src/0040755 0000767 0000024 00000000000 13114114304 022433 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/all/src/main/0040755 0000767 0000024 00000000000 13114114304 023357 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/all/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114304 027147 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/all/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114304 030307 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/0040755 0000767 0000024 00000000000 13114115324 021650 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/META-INF/0040755 0000767 0000024 00000000000 13114115324 023010 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/0040755 0000767 0000024 00000000000 13114114305 022435 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/checkstyle/0040755 0000767 0000024 00000000000 13114114305 024573 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/0040755 0000767 0000024 00000000000 13114114305 023361 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/0040755 0000767 0000024 00000000000 13114114305 024302 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/0040755 0000767 0000024 00000000000 13114114305 025071 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114305 026312 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114305 030316 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/0040755 0000767 0000024 00000000000 13114114305 031236 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/0040755 0000767 0000024 00000000000 13114114305 032514 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/0040755 0000767 0000024 00000000000 13114114306 033266 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114305 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/callback/apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/callbac0040755 0000767 0000024 00000000000 13114114305 034567 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114305 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/exception/apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/excepti0040755 0000767 0000024 00000000000 13114114305 034647 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000145 13114114306 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/0040755 0000767 0000024 00000000000 13114114306 034600 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000145 13114114306 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/0040755 0000767 0000024 00000000000 13114114306 034533 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/0040755 0000767 0000024 00000000000 13114114305 034327 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000155 13114114305 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/exception/apache-ldap-api-1.0.0-src/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/ex0040755 0000767 0000024 00000000000 13114114305 034664 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/main/resources/0040755 0000767 0000024 00000000000 13114114305 025373 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/site/0040755 0000767 0000024 00000000000 13114114305 023401 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/test/0040755 0000767 0000024 00000000000 13114114304 023413 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/test/java/0040755 0000767 0000024 00000000000 13114114305 024335 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/test/java/org/0040755 0000767 0000024 00000000000 13114114305 025124 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114305 026345 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114305 030351 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/test/java/org/apache/directory/ldap/0040755 0000767 0000024 00000000000 13114114305 031271 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/test/java/org/apache/directory/ldap/client/0040755 0000767 0000024 00000000000 13114114305 032547 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/test/java/org/apache/directory/ldap/client/api/0040755 0000767 0000024 00000000000 13114114305 033320 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000145 13114114305 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/test/java/org/apache/directory/ldap/client/api/search/apache-ldap-api-1.0.0-src/ldap/client/api/src/test/java/org/apache/directory/ldap/client/api/search/0040755 0000767 0000024 00000000000 13114114305 034565 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/api/src/test/resources/0040755 0000767 0000024 00000000000 13114114305 025426 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/src/0040755 0000767 0000024 00000000000 13114114304 021663 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/client/src/site/0040755 0000767 0000024 00000000000 13114114304 022627 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/0040755 0000767 0000024 00000000000 13114114664 020704 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/0040755 0000767 0000024 00000000000 13114114677 021640 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/META-INF/0040755 0000767 0000024 00000000000 13114114677 023000 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/0040755 0000767 0000024 00000000000 13114114304 022412 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/checkstyle/0040755 0000767 0000024 00000000000 13114114305 024551 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/0040755 0000767 0000024 00000000000 13114114303 023335 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/0040755 0000767 0000024 00000000000 13114114303 024256 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/0040755 0000767 0000024 00000000000 13114114303 025045 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114303 026266 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114303 030272 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114303 031043 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114303 031763 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/0040755 0000767 0000024 00000000000 13114114304 033041 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000145 13114114303 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000164 13114114303 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/abandonRequest/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000160 13114114304 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/addRequest/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000161 13114114304 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/addResponse/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000161 13114114304 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/bindRequest/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000162 13114114303 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/bindResponse/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000164 13114114304 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/compareRequest/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000165 13114114303 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/compareResponse/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114304 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/controls/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000160 13114114303 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/delRequest/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000161 13114114303 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/delResponse/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000165 13114114303 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/extendedRequest/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000166 13114114304 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/extendedResponse/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000172 13114114304 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/intermediateResponse/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000161 13114114303 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/ldapMessage/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000160 13114114304 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/ldapResult/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000165 13114114303 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/modifyDnRequest/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000166 13114114304 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/modifyDnResponse/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000163 13114114304 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/modifyRequest/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000164 13114114303 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/modifyResponse/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000163 13114114304 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/searchRequest/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000172 13114114304 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/searchRequest/filter/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000166 13114114304 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/searchResultDone/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000167 13114114304 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/searchResultEntry/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114304 034501 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000173 13114114303 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/searchResultReference/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000163 13114114303 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/unbindRequest/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/actions/0040755 0000767 0000024 00000000000 13114114303 034500 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/0040755 0000767 0000024 00000000000 13114114305 033613 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114304 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034625 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114304 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/cascade/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034625 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000162 13114114304 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/manageDsaIT/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034625 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000163 13114114304 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/proxiedauthz/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034625 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000155 13114114303 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114303 034624 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000171 13114114304 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/entryChange/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034625 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000171 13114114304 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/pagedSearch/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034625 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000176 13114114304 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/persistentSearch/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034625 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000170 13114114304 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/subentries/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034625 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114304 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034625 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114304 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorato0040755 0000767 0000024 00000000000 13114114304 034562 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/0040755 0000767 0000024 00000000000 13114114304 034002 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/0040755 0000767 0000024 00000000000 13114114304 034306 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/site/0040755 0000767 0000024 00000000000 13114114304 023356 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/0040755 0000767 0000024 00000000000 13114114304 023371 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/0040755 0000767 0000024 00000000000 13114114304 024312 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/0040755 0000767 0000024 00000000000 13114114304 025101 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114304 026322 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114304 030326 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114304 031077 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114304 032017 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/0040755 0000767 0000024 00000000000 13114114305 033075 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000145 13114114305 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/abandon/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/abandon/0040755 0000767 0000024 00000000000 13114114305 034477 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/add/0040755 0000767 0000024 00000000000 13114114305 033625 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/bind/0040755 0000767 0000024 00000000000 13114114305 034011 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000145 13114114305 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/compare/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/compare/0040755 0000767 0000024 00000000000 13114114305 034523 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114304 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034660 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000163 13114114305 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls/proxiedauthz/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114305 034661 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000155 13114114304 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls/search/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114304 034660 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000171 13114114305 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls/search/entryChange/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114305 034661 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000171 13114114305 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls/search/pagedSearch/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114305 034661 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000176 13114114305 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls/search/persistentSearch/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114305 034661 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000170 13114114305 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls/search/subentries/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114305 034661 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114305 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls/sort/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/controls0040755 0000767 0000024 00000000000 13114114305 034661 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/del/0040755 0000767 0000024 00000000000 13114114305 033641 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114305 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/extended/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/extended0040755 0000767 0000024 00000000000 13114114305 034616 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114304 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/intermediate/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/intermed0040755 0000767 0000024 00000000000 13114114304 034624 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/modify/0040755 0000767 0000024 00000000000 13114114305 034364 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114304 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/modifyDn/apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/modifyDn0040755 0000767 0000024 00000000000 13114114304 034566 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/osgi/0040755 0000767 0000024 00000000000 13114114304 034035 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/search/0040755 0000767 0000024 00000000000 13114114305 034342 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/java/org/apache/directory/api/ldap/codec/unbind/0040755 0000767 0000024 00000000000 13114114304 034353 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/core/src/test/resources/0040755 0000767 0000024 00000000000 13114114304 025403 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/src/0040755 0000767 0000024 00000000000 13114114303 021461 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/src/site/0040755 0000767 0000024 00000000000 13114114303 022425 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/0040755 0000767 0000024 00000000000 13114115111 023020 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/0040755 0000767 0000024 00000000000 13114114304 023612 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/checkstyle/0040755 0000767 0000024 00000000000 13114114305 025751 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/0040755 0000767 0000024 00000000000 13114114304 024536 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114304 030326 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114304 031466 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/java/0040755 0000767 0000024 00000000000 13114114304 025457 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/java/org/0040755 0000767 0000024 00000000000 13114114304 026246 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114304 027467 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114304 031473 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114304 032244 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114304 033164 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/0040755 0000767 0000024 00000000000 13114114304 034241 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114305 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/st0040755 0000767 0000024 00000000000 13114114305 034611 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/site/0040755 0000767 0000024 00000000000 13114114304 024556 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/0040755 0000767 0000024 00000000000 13114114304 024571 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/java/0040755 0000767 0000024 00000000000 13114114304 025512 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/java/org/0040755 0000767 0000024 00000000000 13114114304 026301 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114304 027522 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114304 031526 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114304 032277 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114304 033217 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/java/org/apache/directory/api/ldap/codec/0040755 0000767 0000024 00000000000 13114114304 034274 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114305 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/java/org/apache/directory/api/ldap/codec/standalone/apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/java/org/apache/directory/api/ldap/codec/st0040755 0000767 0000024 00000000000 13114114305 034644 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/codec/standalone/src/test/resources/0040755 0000767 0000024 00000000000 13114114304 026603 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/0040755 0000767 0000024 00000000000 13114115000 021116 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/0040755 0000767 0000024 00000000000 13114115177 021671 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/META-INF/0040755 0000767 0000024 00000000000 13114115177 023031 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/0040755 0000767 0000024 00000000000 13114114325 022452 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/checkstyle/0040755 0000767 0000024 00000000000 13114114325 024610 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/0040755 0000767 0000024 00000000000 13114114325 023376 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/antlr/0040755 0000767 0000024 00000000000 13114114325 024516 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114325 027166 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114325 030326 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/java/0040755 0000767 0000024 00000000000 13114114325 024317 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/java/org/0040755 0000767 0000024 00000000000 13114114325 025106 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114325 026327 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114325 030333 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114325 031104 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114325 032024 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/0040755 0000767 0000024 00000000000 13114114325 032560 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114325 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/apache-ldap-api-1.0.0-src/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedI0040755 0000767 0000024 00000000000 13114114325 034603 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/site/0040755 0000767 0000024 00000000000 13114114325 023416 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/0040755 0000767 0000024 00000000000 13114114325 023431 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/java/0040755 0000767 0000024 00000000000 13114114325 024352 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/java/org/0040755 0000767 0000024 00000000000 13114114325 025141 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114325 026362 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114325 030366 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114325 031137 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114325 032057 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/java/org/apache/directory/api/ldap/aci/0040755 0000767 0000024 00000000000 13114114325 032613 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114325 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/java/org/apache/directory/api/ldap/aci/protectedItem/apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/java/org/apache/directory/api/ldap/aci/protectedI0040755 0000767 0000024 00000000000 13114114325 034636 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/aci/src/test/resources/0040755 0000767 0000024 00000000000 13114114325 025443 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/0040755 0000767 0000024 00000000000 13114115047 022206 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/META-INF/0040755 0000767 0000024 00000000000 13114115047 023346 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/0040755 0000767 0000024 00000000000 13114114326 022774 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/checkstyle/0040755 0000767 0000024 00000000000 13114114326 025132 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/0040755 0000767 0000024 00000000000 13114114326 023720 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114326 027510 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114326 030650 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/0040755 0000767 0000024 00000000000 13114114325 024640 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/0040755 0000767 0000024 00000000000 13114114325 025427 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114325 026650 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114325 030654 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114325 031425 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114325 032345 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/0040755 0000767 0000024 00000000000 13114114326 033654 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114326 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114326 034722 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000161 13114114326 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ad_impl/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114326 034722 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114326 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications_impl/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114326 034722 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000177 13114114326 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify_impl/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114326 034722 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000166 13114114326 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114326 034722 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000167 13114114326 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114326 034722 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000162 13114114326 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114326 034722 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114325 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034717 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000162 13114114325 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034717 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000171 13114114326 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/cancel/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114326 034720 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000201 13114114326 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/certGeneration/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114326 034720 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000205 13114114326 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulDisconnect/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114326 034720 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000203 13114114326 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulShutdown/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114326 034720 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000174 13114114326 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114326 034720 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000173 13114114326 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114326 034720 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114326 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/storedProcedure/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114326 034720 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000171 13114114326 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114326 034720 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/site/0040755 0000767 0000024 00000000000 13114114326 023740 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/0040755 0000767 0000024 00000000000 13114114325 023752 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/0040755 0000767 0000024 00000000000 13114114325 024673 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/0040755 0000767 0000024 00000000000 13114114325 025462 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114325 026703 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114325 030707 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114325 031460 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114325 032400 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/0040755 0000767 0000024 00000000000 13114114325 033706 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114325 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/controls/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114325 034754 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114325 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/controls/ad/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114325 034754 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000161 13114114325 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/controls/ppolicy/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114325 034754 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000167 13114114325 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114325 034754 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000155 13114114325 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/controls/vlv/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/contr0040755 0000767 0000024 00000000000 13114114325 034754 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114325 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034752 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000162 13114114325 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034752 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000171 13114114325 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/cancel/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034752 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000201 13114114325 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/certGeneration/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034752 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000205 13114114325 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulDisconnect/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034752 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000203 13114114325 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulShutdown/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034752 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000174 13114114325 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034752 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114325 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/storedProcedure/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034752 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000171 13114114325 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/exten0040755 0000767 0000024 00000000000 13114114325 034752 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec/src/test/resources/0040755 0000767 0000024 00000000000 13114114325 025764 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/0040755 0000767 0000024 00000000000 13114115010 022743 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/META-INF/0040755 0000767 0000024 00000000000 13114115010 024103 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/0040755 0000767 0000024 00000000000 13114114325 023542 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/checkstyle/0040755 0000767 0000024 00000000000 13114114325 025700 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/0040755 0000767 0000024 00000000000 13114114325 024466 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114325 030256 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114325 031416 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/0040755 0000767 0000024 00000000000 13114114324 025406 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/0040755 0000767 0000024 00000000000 13114114324 026175 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114324 027416 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114324 031422 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114324 032173 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114324 033113 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/0040755 0000767 0000024 00000000000 13114114324 034421 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000155 13114114325 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/c0040755 0000767 0000024 00000000000 13114114325 034565 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000160 13114114325 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/ad/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/c0040755 0000767 0000024 00000000000 13114114325 034565 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000201 13114114325 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/changeNotifications/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/c0040755 0000767 0000024 00000000000 13114114325 034565 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000176 13114114325 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/permissiveModify/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/c0040755 0000767 0000024 00000000000 13114114325 034565 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000165 13114114325 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/c0040755 0000767 0000024 00000000000 13114114325 034565 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000166 13114114325 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/c0040755 0000767 0000024 00000000000 13114114325 034565 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000177 13114114325 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl/syncDone/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/c0040755 0000767 0000024 00000000000 13114114325 034565 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000204 13114114325 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl/syncInfoValue/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/c0040755 0000767 0000024 00000000000 13114114325 034565 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000200 13114114325 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl/syncState/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/c0040755 0000767 0000024 00000000000 13114114325 034565 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000161 13114114325 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/c0040755 0000767 0000024 00000000000 13114114325 034565 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000155 13114114324 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/e0040755 0000767 0000024 00000000000 13114114324 034566 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000164 13114114325 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/cancel/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/e0040755 0000767 0000024 00000000000 13114114325 034567 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000174 13114114325 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/certGeneration/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/e0040755 0000767 0000024 00000000000 13114114325 034567 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000200 13114114325 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/gracefulDisconnect/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/e0040755 0000767 0000024 00000000000 13114114325 034567 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000176 13114114325 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/gracefulShutdown/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/e0040755 0000767 0000024 00000000000 13114114325 034567 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000167 13114114325 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/pwdModify/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/e0040755 0000767 0000024 00000000000 13114114325 034567 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000166 13114114325 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/startTls/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/e0040755 0000767 0000024 00000000000 13114114325 034567 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000175 13114114325 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/storedProcedure/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/e0040755 0000767 0000024 00000000000 13114114325 034567 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000164 13114114325 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/whoAmI/apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/e0040755 0000767 0000024 00000000000 13114114325 034567 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/site/0040755 0000767 0000024 00000000000 13114114325 024506 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/test/0040755 0000767 0000024 00000000000 13114114324 024520 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/codec-api/src/test/resources/0040755 0000767 0000024 00000000000 13114114324 026532 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/0040755 0000767 0000024 00000000000 13114115414 021551 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/META-INF/0040755 0000767 0000024 00000000000 13114115414 022711 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/0040755 0000767 0000024 00000000000 13114114326 022341 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/checkstyle/0040755 0000767 0000024 00000000000 13114114326 024477 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/main/0040755 0000767 0000024 00000000000 13114114326 023265 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114326 027055 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114326 030215 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/main/java/0040755 0000767 0000024 00000000000 13114114326 024206 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/main/java/org/0040755 0000767 0000024 00000000000 13114114326 024775 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114326 026216 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114326 030222 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114326 030773 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114326 031713 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/main/java/org/apache/directory/api/ldap/sp/0040755 0000767 0000024 00000000000 13114114326 032335 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/site/0040755 0000767 0000024 00000000000 13114114326 023305 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/test/0040755 0000767 0000024 00000000000 13114114326 023320 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/test/java/0040755 0000767 0000024 00000000000 13114114326 024241 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/test/java/org/0040755 0000767 0000024 00000000000 13114114326 025030 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114326 026251 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114326 030255 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114326 031026 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114326 031746 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/sp/src/test/resources/0040755 0000767 0000024 00000000000 13114114326 025332 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/src/0040755 0000767 0000024 00000000000 13114114325 021716 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/src/site/0040755 0000767 0000024 00000000000 13114114325 022662 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/0040755 0000767 0000024 00000000000 13114115435 022575 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/META-INF/0040755 0000767 0000024 00000000000 13114115435 023735 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/0040755 0000767 0000024 00000000000 13114114324 023360 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/checkstyle/0040755 0000767 0000024 00000000000 13114114325 025517 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/0040755 0000767 0000024 00000000000 13114114324 024304 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/antlr/0040755 0000767 0000024 00000000000 13114114325 025425 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114324 030074 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114324 031234 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/java/0040755 0000767 0000024 00000000000 13114114324 025225 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/java/org/0040755 0000767 0000024 00000000000 13114114324 026014 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114324 027235 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114324 031241 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114324 032012 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114324 032732 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/main/java/org/apache/directory/api/ldap/trigger/0040755 0000767 0000024 00000000000 13114114325 034376 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/site/0040755 0000767 0000024 00000000000 13114114324 024324 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/test/0040755 0000767 0000024 00000000000 13114114324 024337 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/test/java/0040755 0000767 0000024 00000000000 13114114324 025260 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/test/java/org/0040755 0000767 0000024 00000000000 13114114324 026047 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114324 027270 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114324 031274 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114324 032045 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114324 032765 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/test/java/org/apache/directory/api/ldap/trigger/0040755 0000767 0000024 00000000000 13114114324 034430 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/test/java/org/apache/directory/shared/0040755 0000767 0000024 00000000000 13114114324 032542 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/trigger/src/test/resources/0040755 0000767 0000024 00000000000 13114114324 026351 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/0040755 0000767 0000024 00000000000 13114115374 022111 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/META-INF/0040755 0000767 0000024 00000000000 13114115374 023251 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/0040755 0000767 0000024 00000000000 13114114326 022674 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/checkstyle/0040755 0000767 0000024 00000000000 13114114326 025032 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/0040755 0000767 0000024 00000000000 13114114326 023620 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114326 027410 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114326 030550 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/java/0040755 0000767 0000024 00000000000 13114114326 024541 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/java/org/0040755 0000767 0000024 00000000000 13114114326 025330 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114326 026551 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114326 030555 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114326 031326 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114326 032246 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/java/org/apache/directory/api/ldap/util/0040755 0000767 0000024 00000000000 13114114326 033223 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/main/java/org/apache/directory/api/ldap/util/tree/0040755 0000767 0000024 00000000000 13114114326 034162 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/site/0040755 0000767 0000024 00000000000 13114114326 023640 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/test/0040755 0000767 0000024 00000000000 13114114326 023653 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/test/java/0040755 0000767 0000024 00000000000 13114114326 024574 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/test/java/org/0040755 0000767 0000024 00000000000 13114114326 025363 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114326 026604 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114326 030610 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114326 031361 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114326 032301 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/test/java/org/apache/directory/api/ldap/util/0040755 0000767 0000024 00000000000 13114114326 033256 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/test/java/org/apache/directory/api/ldap/util/tree/0040755 0000767 0000024 00000000000 13114114326 034215 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/extras/util/src/test/resources/0040755 0000767 0000024 00000000000 13114114326 025665 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/0040755 0000767 0000024 00000000000 13114114524 020722 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/META-INF/0040755 0000767 0000024 00000000000 13114114524 022062 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/0040755 0000767 0000024 00000000000 13114114311 021503 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/checkstyle/0040755 0000767 0000024 00000000000 13114114311 023641 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/0040755 0000767 0000024 00000000000 13114114311 022427 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/antlr/0040755 0000767 0000024 00000000000 13114114306 023553 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114311 026217 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114311 027357 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/0040755 0000767 0000024 00000000000 13114114305 023353 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/0040755 0000767 0000024 00000000000 13114114305 024142 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114305 025363 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114305 027367 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114305 030140 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114305 031060 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/0040755 0000767 0000024 00000000000 13114114311 032155 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/0040755 0000767 0000024 00000000000 13114114307 034176 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/csn/0040755 0000767 0000024 00000000000 13114114306 032744 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/0040755 0000767 0000024 00000000000 13114114307 033477 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/0040755 0000767 0000024 00000000000 13114114311 033316 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/exception/0040755 0000767 0000024 00000000000 13114114307 034160 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/0040755 0000767 0000024 00000000000 13114114307 033447 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/0040755 0000767 0000024 00000000000 13114114307 033100 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114307 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymiz0040755 0000767 0000024 00000000000 13114114307 034665 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/0040755 0000767 0000024 00000000000 13114114307 033606 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114306 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/controls/apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/contr0040755 0000767 0000024 00000000000 13114114306 034653 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114306 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/extended/apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/exten0040755 0000767 0000024 00000000000 13114114306 034651 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/0040755 0000767 0000024 00000000000 13114114310 033074 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/0040755 0000767 0000024 00000000000 13114114306 034023 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/0040755 0000767 0000024 00000000000 13114114311 033415 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114310 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/comparators/apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/compar0040755 0000767 0000024 00000000000 13114114310 034616 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114311 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normal0040755 0000767 0000024 00000000000 13114114311 034626 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114310 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parser0040755 0000767 0000024 00000000000 13114114310 034631 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114310 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/regist0040755 0000767 0000024 00000000000 13114114310 034632 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000161 13114114310 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/helper/apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/regist0040755 0000767 0000024 00000000000 13114114310 034632 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114311 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntax0040755 0000767 0000024 00000000000 13114114311 034664 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/0040755 0000767 0000024 00000000000 13114114307 033633 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/0040755 0000767 0000024 00000000000 13114114306 032763 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/site/0040755 0000767 0000024 00000000000 13114114311 022447 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/0040755 0000767 0000024 00000000000 13114114311 022462 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/0040755 0000767 0000024 00000000000 13114114311 023403 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/0040755 0000767 0000024 00000000000 13114114311 024172 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114311 025413 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114311 027417 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114311 030170 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114311 031110 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/0040755 0000767 0000024 00000000000 13114114312 032211 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/csn/0040755 0000767 0000024 00000000000 13114114312 032774 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/cursor/0040755 0000767 0000024 00000000000 13114114312 033526 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/0040755 0000767 0000024 00000000000 13114114312 033352 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/filter/0040755 0000767 0000024 00000000000 13114114312 033476 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/ldif/0040755 0000767 0000024 00000000000 13114114311 033126 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/message/0040755 0000767 0000024 00000000000 13114114312 033635 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114312 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/message/controls/apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/message/contr0040755 0000767 0000024 00000000000 13114114312 034703 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/name/0040755 0000767 0000024 00000000000 13114114311 033130 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/password/0040755 0000767 0000024 00000000000 13114114312 034053 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/0040755 0000767 0000024 00000000000 13114114312 033451 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114312 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/comparators/apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/compar0040755 0000767 0000024 00000000000 13114114312 034653 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114311 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/normalizers/apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/normal0040755 0000767 0000024 00000000000 13114114311 034661 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114312 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/parsers/apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/parser0040755 0000767 0000024 00000000000 13114114312 034666 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114312 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/registries/apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/regist0040755 0000767 0000024 00000000000 13114114312 034667 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114311 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntax0040755 0000767 0000024 00000000000 13114114311 034717 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114312 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntax0040755 0000767 0000024 00000000000 13114114312 034720 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000157 13114114312 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/parser/apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntax0040755 0000767 0000024 00000000000 13114114312 034720 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/java/org/apache/directory/api/ldap/model/url/0040755 0000767 0000024 00000000000 13114114312 033013 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/resources/0040755 0000767 0000024 00000000000 13114114311 024474 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/resources/org/0040755 0000767 0000024 00000000000 13114114311 025263 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/resources/org/apache/0040755 0000767 0000024 00000000000 13114114311 026504 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/resources/org/apache/directory/0040755 0000767 0000024 00000000000 13114114311 030510 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/resources/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114311 031261 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/resources/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114311 032201 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/resources/org/apache/directory/api/ldap/model/0040755 0000767 0000024 00000000000 13114114311 033301 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/resources/org/apache/directory/api/ldap/model/schema/0040755 0000767 0000024 00000000000 13114114311 034541 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114311 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/model/src/test/resources/org/apache/directory/api/ldap/model/schema/parsers/apache-ldap-api-1.0.0-src/ldap/model/src/test/resources/org/apache/directory/api/ldap/model/schema/p0040755 0000767 0000024 00000000000 13114114311 034721 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/0040755 0000767 0000024 00000000000 13114114750 020411 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/0040755 0000767 0000024 00000000000 13114114756 021343 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/META-INF/0040755 0000767 0000024 00000000000 13114114756 022503 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/0040755 0000767 0000024 00000000000 13114114326 022123 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/checkstyle/0040755 0000767 0000024 00000000000 13114114326 024261 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/0040755 0000767 0000024 00000000000 13114114326 023047 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/java/0040755 0000767 0000024 00000000000 13114114326 023770 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/java/org/0040755 0000767 0000024 00000000000 13114114326 024557 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114326 026000 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114326 030004 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114326 030555 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114326 031475 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/0040755 0000767 0000024 00000000000 13114114326 032552 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/0040755 0000767 0000024 00000000000 13114114326 034413 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114326 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/apache-ldap-api-1.0.0-src/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/m0040755 0000767 0000024 00000000000 13114114326 034570 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/site/0040755 0000767 0000024 00000000000 13114114326 023067 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/test/0040755 0000767 0000024 00000000000 13114114326 023102 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/test/java/0040755 0000767 0000024 00000000000 13114114326 024023 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/mina/src/test/resources/0040755 0000767 0000024 00000000000 13114114326 025114 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/src/0040755 0000767 0000024 00000000000 13114114326 021177 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/net/src/site/0040755 0000767 0000024 00000000000 13114114326 022143 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/0040755 0000767 0000024 00000000000 13114115226 021062 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/0040755 0000767 0000024 00000000000 13114115461 023072 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/META-INF/0040755 0000767 0000024 00000000000 13114115461 024232 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/0040755 0000767 0000024 00000000000 13114114313 023654 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/checkstyle/0040755 0000767 0000024 00000000000 13114114312 026011 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/0040755 0000767 0000024 00000000000 13114114313 024600 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/antlr/0040755 0000767 0000024 00000000000 13114114313 025720 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114312 030367 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/appended-resources/META-INF/0040755 0000767 0000024 00000000000 13114114313 031530 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/java/0040755 0000767 0000024 00000000000 13114114312 025520 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/java/org/0040755 0000767 0000024 00000000000 13114114312 026307 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114312 027530 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114312 031534 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114312 032305 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114312 033225 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/0040755 0000767 0000024 00000000000 13114114312 034465 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114313 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/c0040755 0000767 0000024 00000000000 13114114313 034631 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/main/resources/0040755 0000767 0000024 00000000000 13114114313 026612 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/site/0040755 0000767 0000024 00000000000 13114114313 024620 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/0040755 0000767 0000024 00000000000 13114114312 024632 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/java/0040755 0000767 0000024 00000000000 13114114312 025553 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/java/org/0040755 0000767 0000024 00000000000 13114114312 026342 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114312 027563 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114312 031567 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114312 032340 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114312 033260 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/java/org/apache/directory/api/ldap/schema/0040755 0000767 0000024 00000000000 13114114312 034520 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114313 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/java/org/apache/directory/api/ldap/schema/converter/apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/java/org/apache/directory/api/ldap/schema/c0040755 0000767 0000024 00000000000 13114114313 034664 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/resources/0040755 0000767 0000024 00000000000 13114114312 026644 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/resources/org/0040755 0000767 0000024 00000000000 13114114312 027433 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/resources/org/apache/0040755 0000767 0000024 00000000000 13114114312 030654 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/resources/org/apache/directory/0040755 0000767 0000024 00000000000 13114114312 032660 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/resources/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114312 033431 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/resources/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114312 034351 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114312 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/resources/org/apache/directory/api/ldap/schema/apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/resources/org/apache/directory/api/ldap/sch0040755 0000767 0000024 00000000000 13114114312 035047 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000163 13114114313 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/resources/org/apache/directory/api/ldap/schema/converter/apache-ldap-api-1.0.0-src/ldap/schema/converter/src/test/resources/org/apache/directory/api/ldap/sch0040755 0000767 0000024 00000000000 13114114313 035050 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/0040755 0000767 0000024 00000000000 13114115234 021772 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/META-INF/0040755 0000767 0000024 00000000000 13114115234 023132 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/0040755 0000767 0000024 00000000000 13114114324 022560 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/checkstyle/0040755 0000767 0000024 00000000000 13114114313 024714 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/0040755 0000767 0000024 00000000000 13114114313 023502 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/0040755 0000767 0000024 00000000000 13114114313 024423 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/0040755 0000767 0000024 00000000000 13114114313 025212 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114313 026433 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114313 030437 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114313 031210 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114313 032130 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/0040755 0000767 0000024 00000000000 13114114313 033370 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114313 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/extractor/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/extrac0040755 0000767 0000024 00000000000 13114114313 034577 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114313 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/extractor/impl/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/extrac0040755 0000767 0000024 00000000000 13114114313 034577 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114313 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/loader/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/loader0040755 0000767 0000024 00000000000 13114114313 034557 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114313 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/manager/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/manage0040755 0000767 0000024 00000000000 13114114313 034541 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114313 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/manager/impl/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/manage0040755 0000767 0000024 00000000000 13114114313 034541 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/0040755 0000767 0000024 00000000000 13114114313 025514 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/0040755 0000767 0000024 00000000000 13114114313 026754 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/0040755 0000767 0000024 00000000000 13114114324 030657 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/0040755 0000767 0000024 00000000000 13114114324 033232 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000157 13114114323 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attri0040755 0000767 0000024 00000000000 13114114323 034736 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114322 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objec0040755 0000767 0000024 00000000000 13114114322 034674 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000157 13114114323 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=syntaxcheckers/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=synta0040755 0000767 0000024 00000000000 13114114323 034751 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114323 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=syntaxes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=synta0040755 0000767 0000024 00000000000 13114114323 034751 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/0040755 0000767 0000024 00000000000 13114114320 032512 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114320 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=attribut0040755 0000767 0000024 00000000000 13114114320 034732 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114320 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=comparators/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=comparat0040755 0000767 0000024 00000000000 13114114320 034702 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114320 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=matchingrules/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=matching0040755 0000767 0000024 00000000000 13114114320 034666 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114320 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=normalizers/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=normaliz0040755 0000767 0000024 00000000000 13114114320 034727 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114317 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=objectcl0040755 0000767 0000024 00000000000 13114114317 034667 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114320 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=syntaxcheckers/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=syntaxch0040755 0000767 0000024 00000000000 13114114320 034735 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114317 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=syntaxes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=syntaxes0040755 0000767 0000024 00000000000 13114114317 034760 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachedns/0040755 0000767 0000024 00000000000 13114114321 033220 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000157 13114114321 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachedns/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachedns/ou=attri0040755 0000767 0000024 00000000000 13114114321 034725 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114321 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachedns/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachedns/ou=objec0040755 0000767 0000024 00000000000 13114114321 034664 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/0040755 0000767 0000024 00000000000 13114114321 033362 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000160 13114114321 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=attr0040755 0000767 0000024 00000000000 13114114321 034716 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000155 13114114321 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=comparators/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=comp0040755 0000767 0000024 00000000000 13114114321 034702 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000157 13114114321 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=matchingrules/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=matc0040755 0000767 0000024 00000000000 13114114321 034670 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000155 13114114321 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=normalizers/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=norm0040755 0000767 0000024 00000000000 13114114321 034717 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000157 13114114321 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=obje0040755 0000767 0000024 00000000000 13114114321 034663 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000160 13114114321 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=syntaxcheckers/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=synt0040755 0000767 0000024 00000000000 13114114321 034741 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114321 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=syntaxes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=apachemeta/ou=synt0040755 0000767 0000024 00000000000 13114114321 034741 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=autofs/0040755 0000767 0000024 00000000000 13114114324 032576 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114324 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=autofs/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=autofs/ou=attribut0040755 0000767 0000024 00000000000 13114114324 035016 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114324 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=autofs/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=autofs/ou=objectcl0040755 0000767 0000024 00000000000 13114114324 034745 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=collective/0040755 0000767 0000024 00000000000 13114114321 033423 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000160 13114114321 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=collective/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=collective/ou=attr0040755 0000767 0000024 00000000000 13114114321 034757 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=corba/0040755 0000767 0000024 00000000000 13114114321 032360 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114321 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=corba/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=corba/ou=attribute0040755 0000767 0000024 00000000000 13114114321 034745 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114321 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=corba/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=corba/ou=objectcla0040755 0000767 0000024 00000000000 13114114321 034670 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=core/0040755 0000767 0000024 00000000000 13114114316 032226 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114316 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=core/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=core/ou=attributet0040755 0000767 0000024 00000000000 13114114316 034777 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114316 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=core/ou=comparators/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=core/ou=comparator0040755 0000767 0000024 00000000000 13114114316 034757 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114316 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=core/ou=matchingrules/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=core/ou=matchingru0040755 0000767 0000024 00000000000 13114114316 034751 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114317 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=core/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=core/ou=objectclas0040755 0000767 0000024 00000000000 13114114317 034722 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=core/ou=syntaxes/0040755 0000767 0000024 00000000000 13114114316 034545 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=cosine/0040755 0000767 0000024 00000000000 13114114313 032553 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114313 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=cosine/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=cosine/ou=attribut0040755 0000767 0000024 00000000000 13114114313 034773 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114313 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=cosine/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=cosine/ou=objectcl0040755 0000767 0000024 00000000000 13114114313 034722 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=dhcp/0040755 0000767 0000024 00000000000 13114114325 032214 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114324 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=dhcp/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=dhcp/ou=attributet0040755 0000767 0000024 00000000000 13114114324 034764 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114324 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=dhcp/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=dhcp/ou=objectclas0040755 0000767 0000024 00000000000 13114114324 034706 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=inetorgperson/0040755 0000767 0000024 00000000000 13114114324 034173 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000163 13114114324 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=inetorgperson/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=inetorgperson/ou=a0040755 0000767 0000024 00000000000 13114114324 034775 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000162 13114114324 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=inetorgperson/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=inetorgperson/ou=o0040755 0000767 0000024 00000000000 13114114324 035013 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=java/0040755 0000767 0000024 00000000000 13114114320 032212 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114320 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=java/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=java/ou=attributet0040755 0000767 0000024 00000000000 13114114320 034763 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114320 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=java/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=java/ou=objectclas0040755 0000767 0000024 00000000000 13114114320 034705 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=krb5kdc/0040755 0000767 0000024 00000000000 13114114316 032623 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000155 13114114316 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=krb5kdc/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=krb5kdc/ou=attribu0040755 0000767 0000024 00000000000 13114114316 034657 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114316 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=krb5kdc/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=krb5kdc/ou=objectc0040755 0000767 0000024 00000000000 13114114316 034616 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=mozilla/0040755 0000767 0000024 00000000000 13114114324 032744 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000155 13114114324 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=mozilla/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=mozilla/ou=attribu0040755 0000767 0000024 00000000000 13114114324 035000 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114324 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=mozilla/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=mozilla/ou=objectc0040755 0000767 0000024 00000000000 13114114324 034737 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/0040755 0000767 0000024 00000000000 13114114322 032064 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114322 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=attributety0040755 0000767 0000024 00000000000 13114114322 035026 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114321 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=comparators/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=comparators0040755 0000767 0000024 00000000000 13114114321 034777 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114321 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=matchingrules/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=matchingrul0040755 0000767 0000024 00000000000 13114114321 034762 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114322 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=normalizers/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=normalizers0040755 0000767 0000024 00000000000 13114114322 035013 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114322 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=objectclass0040755 0000767 0000024 00000000000 13114114322 034742 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114322 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=syntaxcheckers/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=syntaxcheck0040755 0000767 0000024 00000000000 13114114322 034772 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=nis/ou=syntaxes/0040755 0000767 0000024 00000000000 13114114322 034403 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=other/0040755 0000767 0000024 00000000000 13114114313 032414 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=pwdpolicy/0040755 0000767 0000024 00000000000 13114114317 033311 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000157 13114114317 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=pwdpolicy/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=pwdpolicy/ou=attri0040755 0000767 0000024 00000000000 13114114317 035016 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000156 13114114317 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=pwdpolicy/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=pwdpolicy/ou=objec0040755 0000767 0000024 00000000000 13114114317 034755 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=rfc2307bis/0040755 0000767 0000024 00000000000 13114114314 033060 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000160 13114114314 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=rfc2307bis/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=rfc2307bis/ou=attr0040755 0000767 0000024 00000000000 13114114314 034414 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000157 13114114314 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=rfc2307bis/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=rfc2307bis/ou=obje0040755 0000767 0000024 00000000000 13114114314 034361 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=samba/0040755 0000767 0000024 00000000000 13114114320 032354 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114320 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=samba/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=samba/ou=attribute0040755 0000767 0000024 00000000000 13114114320 034741 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000152 13114114320 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=samba/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=samba/ou=objectcla0040755 0000767 0000024 00000000000 13114114320 034664 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/0040755 0000767 0000024 00000000000 13114114316 032622 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114314 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=attributetypes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=attribut0040755 0000767 0000024 00000000000 13114114314 035040 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114314 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=comparators/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=comparat0040755 0000767 0000024 00000000000 13114114314 035010 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114315 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=matchingrules/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=matching0040755 0000767 0000024 00000000000 13114114315 034775 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114315 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=normalizers/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=normaliz0040755 0000767 0000024 00000000000 13114114315 035036 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000153 13114114316 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=objectclasses/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=objectcl0040755 0000767 0000024 00000000000 13114114316 034771 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114315 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=syntaxcheckers/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=syntaxch0040755 0000767 0000024 00000000000 13114114315 035044 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114316 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=syntaxes/apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/resources/schema/ou=schema/cn=system/ou=syntaxes0040755 0000767 0000024 00000000000 13114114316 035062 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/main/scripts/0040755 0000767 0000024 00000000000 13114114313 025171 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/site/0040755 0000767 0000024 00000000000 13114114324 023524 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/0040755 0000767 0000024 00000000000 13114114313 023535 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/0040755 0000767 0000024 00000000000 13114114313 024456 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/0040755 0000767 0000024 00000000000 13114114313 025245 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114313 026466 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114313 030472 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114313 031243 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/0040755 0000767 0000024 00000000000 13114114313 032163 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/0040755 0000767 0000024 00000000000 13114114313 033423 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000151 13114114313 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/extractor/apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/extrac0040755 0000767 0000024 00000000000 13114114313 034632 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000146 13114114313 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader0040755 0000767 0000024 00000000000 13114114313 034612 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114313 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/manager/apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/manage0040755 0000767 0000024 00000000000 13114114313 034574 5ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000154 13114114313 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/manager/impl/apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/manage0040755 0000767 0000024 00000000000 13114114313 034574 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/schema/data/src/test/resources/0040755 0000767 0000024 00000000000 13114114313 025547 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/src/0040755 0000767 0000024 00000000000 13114114326 020411 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/ldap/src/site/0040755 0000767 0000024 00000000000 13114114326 021355 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/src/0040755 0000767 0000024 00000000000 13114114273 017472 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/src/main/0040755 0000767 0000024 00000000000 13114114273 020416 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/src/main/appended-resources/0040755 0000767 0000024 00000000000 13114114274 024207 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/src/site/0040755 0000767 0000024 00000000000 13114114274 020437 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/src/site/resources/0040755 0000767 0000024 00000000000 13114114273 022450 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/src/site/resources/images/0040755 0000767 0000024 00000000000 13114114275 023717 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/0040755 0000767 0000024 00000000000 13114114373 017661 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/META-INF/0040755 0000767 0000024 00000000000 13114114373 021021 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/0040755 0000767 0000024 00000000000 13114114302 020440 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/checkstyle/0040755 0000767 0000024 00000000000 13114114303 022577 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/0040755 0000767 0000024 00000000000 13114114302 021364 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/java/0040755 0000767 0000024 00000000000 13114114302 022305 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/java/org/0040755 0000767 0000024 00000000000 13114114302 023074 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/java/org/apache/0040755 0000767 0000024 00000000000 13114114302 024315 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114302 026321 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114302 027072 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/java/org/apache/directory/api/util/0040755 0000767 0000024 00000000000 13114114303 030050 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/java/org/apache/directory/api/util/exception/0040755 0000767 0000024 00000000000 13114114302 032045 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/resources/0040755 0000767 0000024 00000000000 13114114302 023376 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/resources/org/0040755 0000767 0000024 00000000000 13114114302 024165 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/resources/org/apache/0040755 0000767 0000024 00000000000 13114114302 025406 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/main/resources/org/apache/directory/0040755 0000767 0000024 00000000000 13114114302 027412 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/site/0040755 0000767 0000024 00000000000 13114114302 021404 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/test/0040755 0000767 0000024 00000000000 13114114302 021417 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/test/java/0040755 0000767 0000024 00000000000 13114114302 022340 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/test/java/org/0040755 0000767 0000024 00000000000 13114114302 023127 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/test/java/org/apache/0040755 0000767 0000024 00000000000 13114114302 024350 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/test/java/org/apache/directory/0040755 0000767 0000024 00000000000 13114114302 026354 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/test/java/org/apache/directory/api/0040755 0000767 0000024 00000000000 13114114302 027125 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/test/java/org/apache/directory/api/util/0040755 0000767 0000024 00000000000 13114114303 030103 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/test/java/org/apache/directory/api/util/exception/0040755 0000767 0000024 00000000000 13114114303 032101 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/util/src/test/resources/0040755 0000767 0000024 00000000000 13114114303 023432 5ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/all/dependency-reduced-pom.xml0100644 0000767 0000024 00000006233 13114115502 024512 0ustar00elecharnystaff0000000 0000000 api-parent org.apache.directory.api 1.0.0 4.0.0 api-all Apache Directory API All maven-shade-plugin package shade ${project.groupId} true true org.slf4j slf4j-api 1.7.25 compile org.apache.servicemix.bundles org.apache.servicemix.bundles.xpp3 1.1.4c_7 compile org.apache.servicemix.bundles org.apache.servicemix.bundles.dom4j 1.6.1_5 compile xml-apis xml-apis 1.0.b2 compile commons-pool commons-pool 1.6 compile org.apache.mina mina-core 2.0.16 compile commons-lang commons-lang 2.6 compile commons-collections commons-collections 3.2.2 compile org.apache.servicemix.bundles org.apache.servicemix.bundles.antlr 2.7.7_5 compile commons-codec commons-codec 1.10 compile apache-ldap-api-1.0.0-src/all/pom.xml0100644 0000767 0000024 00000010657 13114114302 020767 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-parent 1.0.0 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 apache-ldap-api-1.0.0-src/all/src/main/appended-resources/META-INF/LICENSE0100644 0000767 0000024 00000002125 13114114302 027111 0ustar00elecharnystaff0000000 0000000 -------------------------------------------------------------- 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-ldap-api-1.0.0-src/all/src/main/appended-resources/META-INF/NOTICE0100644 0000767 0000024 00000000064 13114114302 027010 0ustar00elecharnystaff0000000 0000000 This software includes code generated by ANTLR 2. apache-ldap-api-1.0.0-src/asn1/api/META-INF/MANIFEST.MF0100644 0000767 0000024 00000002302 13114114427 023103 0ustar00elecharnystaff0000000 0000000 Manifest-Version: 1.0 Bnd-LastModified: 1496357143001 Build-Jdk: 1.8.0_102 Built-By: elecharny Bundle-Description: ASN.1 API Bundle-DocURL: https://www.apache.org/ Bundle-License: https://www.apache.org/licenses/LICENSE-2.0.txt Bundle-ManifestVersion: 2 Bundle-Name: Apache Directory API ASN.1 API Bundle-SymbolicName: org.apache.directory.api.asn1.api Bundle-Vendor: The Apache Software Foundation Bundle-Version: 1.0.0 Created-By: Apache Maven Bundle Plugin Export-Package: org.apache.directory.api.asn1;version="1.0.0",org.apache .directory.api.asn1.util;version="1.0.0";uses:="org.apache.directory.ap i.asn1" Implementation-Title: Apache Directory API ASN.1 API Implementation-URL: http://directory.apache.org/api-parent/api-asn1-pare nt/api-asn1-api/ Implementation-Vendor: The Apache Software Foundation Implementation-Vendor-Id: org.apache.directory.api Implementation-Version: 1.0.0 Import-Package: org.apache.directory.api.i18n;version="1.0.0" Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))" Specification-Title: Apache Directory API ASN.1 API Specification-Vendor: The Apache Software Foundation Specification-Version: 1.0.0 Tool: Bnd-3.3.0.201609221906 apache-ldap-api-1.0.0-src/asn1/api/pom.xml0100644 0000767 0000024 00000006372 13114114302 021631 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-asn1-parent 1.0.0 api-asn1-api Apache Directory API ASN.1 API bundle ASN.1 API org.apache.directory.junit junit-addons test log4j log4j test org.slf4j slf4j-log4j12 test org.slf4j slf4j-api 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-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/Asn1Object.java0100644 0000767 0000024 00000002767 13114114302 033177 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/Decoder.java0100755 0000767 0000024 00000004131 13114114302 032601 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; } ././@LongLink0100644 0000000 0000000 00000000145 13114114302 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/DecoderException.javaapache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/DecoderException.java0100755 0000767 0000024 00000003213 13114114302 034460 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/Encoder.java0100644 0000767 0000024 00000003407 13114114302 032615 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; } ././@LongLink0100644 0000000 0000000 00000000145 13114114302 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/EncoderException.javaapache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/EncoderException.java0100755 0000767 0000024 00000003652 13114114302 034501 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/package.html0100644 0000767 0000024 00000002616 13114114302 032655 0ustar00elecharnystaff0000000 0000000 Provides the fundamental stateful codec interfaces.

Package Specification

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see: ././@LongLink0100644 0000000 0000000 00000000151 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Asn1StringUtils.javaapache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Asn1StringUtils.0100644 0000767 0000024 00000006544 13114114302 034370 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 Asn1StringUtils() { } /** * 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(); } /** * 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; } } apache-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/util/BitString.java0100644 0000767 0000024 00000015665 13114114302 034131 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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_00029_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_00030_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_00030_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_00031_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; } /** * @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-ldap-api-1.0.0-src/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java0100644 0000767 0000024 00000140133 13114114302 032724 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.asn1.util; import java.io.IOException; import java.io.OutputStream; import java.math.BigInteger; 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; private static final BigInteger JOINT_ISO_ITU_T = new BigInteger( "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 { START, STATE_A, STATE_B, STATE_C, STATE_D, STATE_E, STATE_F, STATE_G, STATE_H, STATE_I, STATE_J, STATE_K, STATE_L, 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_00033_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 9 bytes, we won't be able to store the value in a long... // Compute the number of necessary bytes int nbBytes = valLength * 7 / 8; if ( valLength % 7 != 0 ) { nbBytes++; } byte[] result = new byte[nbBytes]; // Now iterate on the incoming bytes int pos = nbBytes - 1; int valEnd = valStart + valLength - 1; int j = 0; while ( j < valLength - 8 ) { result[pos--] = ( byte ) ( ( oidBytes[valEnd - j - 1] << 7 ) | ( oidBytes[valEnd - j] & 0x7F ) ); result[pos--] = ( byte ) ( ( oidBytes[valEnd - j - 2] << 6 ) | ( ( oidBytes[valEnd - j - 1] & 0x7E ) >> 1 ) ); result[pos--] = ( byte ) ( ( oidBytes[valEnd - j - 3] << 5 ) | ( ( oidBytes[valEnd - j - 2] & 0x7C ) >> 2 ) ); result[pos--] = ( byte ) ( ( oidBytes[valEnd - j - 4] << 4 ) | ( ( oidBytes[valEnd - j - 3] & 0x78 ) >> 3 ) ); result[pos--] = ( byte ) ( ( oidBytes[valEnd - j - 5] << 3 ) | ( ( oidBytes[valEnd - j - 4] & 0x70 ) >> 4 ) ); result[pos--] = ( byte ) ( ( oidBytes[valEnd - j - 6] << 2 ) | ( ( oidBytes[valEnd - j - 5] & 0x60 ) >> 5 ) ); result[pos--] = ( byte ) ( ( oidBytes[valEnd - j - 7] << 1 ) | ( ( oidBytes[valEnd - j - 6] & 0x40 ) >> 6 ) ); j += 8; } switch ( valLength - j ) { case 7 : result[pos--] = ( byte ) ( ( oidBytes[5] << 7 ) | ( oidBytes[6] & 0x7F ) ); result[pos--] = ( byte ) ( ( oidBytes[4] << 6 ) | ( ( oidBytes[5] & 0x7E ) >> 1 ) ); result[pos--] = ( byte ) ( ( oidBytes[3] << 5 ) | ( ( oidBytes[4] & 0x7C ) >> 2 ) ); result[pos--] = ( byte ) ( ( oidBytes[2] << 4 ) | ( ( oidBytes[3] & 0x78 ) >> 3 ) ); result[pos--] = ( byte ) ( ( oidBytes[1] << 3 ) | ( ( oidBytes[2] & 0x70 ) >> 4 ) ); result[pos--] = ( byte ) ( ( oidBytes[0] << 2 ) | ( ( oidBytes[1] & 0x60 ) >> 5 ) ); result[pos] = ( byte ) ( ( oidBytes[0] & 0x40 ) >> 6 ); break; case 6 : result[pos--] = ( byte ) ( ( oidBytes[4] << 7 ) | ( oidBytes[5] & 0x7F ) ); result[pos--] = ( byte ) ( ( oidBytes[3] << 6 ) | ( ( oidBytes[4] & 0x7E ) >> 1 ) ); result[pos--] = ( byte ) ( ( oidBytes[2] << 5 ) | ( ( oidBytes[3] & 0x7C ) >> 2 ) ); result[pos--] = ( byte ) ( ( oidBytes[1] << 4 ) | ( ( oidBytes[2] & 0x78 ) >> 3 ) ); result[pos--] = ( byte ) ( ( oidBytes[0] << 3 ) | ( ( oidBytes[1] & 0x70 ) >> 4 ) ); result[pos] = ( byte ) ( ( oidBytes[0] & 0x60 ) >> 5 ); break; case 5 : result[pos--] = ( byte ) ( ( oidBytes[3] << 7 ) | ( oidBytes[4] & 0x7F ) ); result[pos--] = ( byte ) ( ( oidBytes[2] << 6 ) | ( ( oidBytes[3] & 0x7E ) >> 1 ) ); result[pos--] = ( byte ) ( ( oidBytes[1] << 5 ) | ( ( oidBytes[2] & 0x7C ) >> 2 ) ); result[pos--] = ( byte ) ( ( oidBytes[0] << 4 ) | ( ( oidBytes[1] & 0x78 ) >> 3 ) ); result[pos] = ( byte ) ( ( oidBytes[0] & 0x70 ) >> 4 ); break; case 4 : result[pos--] = ( byte ) ( ( oidBytes[2] << 7 ) | ( oidBytes[3] & 0x7F ) ); result[pos--] = ( byte ) ( ( oidBytes[1] << 6 ) | ( ( oidBytes[2] & 0x7E ) >> 1 ) ); result[pos--] = ( byte ) ( ( oidBytes[0] << 5 ) | ( ( oidBytes[1] & 0x7C ) >> 2 ) ); result[pos] = ( byte ) ( ( oidBytes[0] & 0x78 ) >> 3 ); break; case 3 : result[pos--] = ( byte ) ( ( oidBytes[1] << 7 ) | ( oidBytes[2] & 0x7F ) ); result[pos--] = ( byte ) ( ( oidBytes[0] << 6 ) | ( ( oidBytes[1] & 0x7E ) >> 1 ) ); result[pos] = ( byte ) ( ( oidBytes[0] & 0x7C ) >> 2 ); break; case 2 : result[pos--] = ( byte ) ( ( oidBytes[0] << 7 ) | ( oidBytes[1] & 0x7F ) ); result[pos] = ( byte ) ( ( oidBytes[0] & 0x7E ) >> 1 ); break; case 1 : result[pos] = ( byte ) ( oidBytes[0] & 0x7F ); break; default : // Exist to please checkstyle... break; } BigInteger bigInteger; if ( ( result[0] & 0x80 ) == 0x80 ) { byte[] newResult = new byte[result.length + 1]; System.arraycopy( result, 0, newResult, 1, result.length ); result = newResult; } bigInteger = new BigInteger( result ); if ( firstArc ) { // This is a joint-iso-itu-t(2) arc bigInteger = bigInteger.subtract( JOINT_ISO_ITU_T ); builder.append( '2' ); } 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_00033_INVALID_OID, Arrays.toString( oidBytes ) ) ); } if ( one < 2 ) { builder.append( one ); value = two; } } firstArc = false; } // normal processing builder.append( '.' ).append( value ); } valStart = i; valLength = 0; value = 0; } } return new Oid( builder.toString(), oidBytes ); } /** * Process state A *
     * (Start) --['0','1']--> (A)
     * (start) --['2']--> (F)
     * 
*/ 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_00033_INVALID_OID, "Should start with 0, 1 or 2" ) ); } } /** * Process state B *
     * (A) --['.']--> (B)
     * 
*/ 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_00033_INVALID_OID, "a '.' is expected" ) ); } return OidFSAState.STATE_B; } /** * Process state B *
     * (B) --['0']--> (D)
     * (B) --['1'..'3']--> (C)
     * (B) --['4'..'9']--> (E)
     * 
*/ 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_00033_INVALID_OID, "a digit is expected" ) ); } } /** * Process state C *
     * (C) --['.']--> (K)
     * (C) --['0'..'9']--> (E)
     * 
*/ 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_00033_INVALID_OID, "a digit is expected" ) ); } } /** * Process state D and E *
     * (D) --['.']--> (K)
     * (E) --['.']--> (K)
     * 
*/ 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_00033_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)
     * 
*/ 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_00033_INVALID_OID, "a '.' is expected" ) ); } return OidFSAState.STATE_G; } /** * Process state G *
     * (G) --['0']--> (I)
     * (G) --['1'..'9']--> (H)
     * 
*/ 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_00033_INVALID_OID, "a digit is expected" ) ); } } /** * Process state H *
     * (H) --['.']--> (K)
     * (H) --['0'..'9']--> (J)
     * 
*/ 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_00033_INVALID_OID, "a digit is expected" ) ); } } /** * Process state I *
     * (I) --['.']--> (K)
     * 
*/ 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_00033_INVALID_OID, "a digit is expected" ) ); } } /** * Process state J *
     * (J) --['.']--> (K)
     * (J) --['0'..'9']--> (J)
     * 
*/ 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_00033_INVALID_OID, "a digit is expected" ) ); } } /** * Process state J *
     * (K) --['0']--> (M)
     * (K) --['1'..'9']--> (L)
     * 
*/ 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_00033_INVALID_OID, "a digit is expected" ) ); } } /** * Process state J *
     * (L) --['.']--> (K)
     * (L) --['0'..'9']--> (L)
     * 
*/ 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_00033_INVALID_OID, "a digit or a dot is expected" ) ); } } /** * Process state J *
     * (M) --['.']--> (K)
     * 
*/ 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_00033_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. */ 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_00033_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, bufPos, arcNbChars, 0, 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_00033_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( java.nio.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-ldap-api-1.0.0-src/asn1/api/src/site/site.xml0100644 0000767 0000024 00000002011 13114114302 023517 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/api/src/test/java/org/apache/directory/api/asn1/util/BitStringTest.javaapache-ldap-api-1.0.0-src/asn1/api/src/test/java/org/apache/directory/api/asn1/util/BitStringTest.ja0100644 0000767 0000024 00000016035 13114114302 034465 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.asn1.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.apache.directory.api.asn1.DecoderException; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Test the Bit String primitive * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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 */ @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 */ @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 */ @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 */ @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() ) ); } } apache-ldap-api-1.0.0-src/asn1/api/src/test/java/org/apache/directory/api/asn1/util/OidTest.java0100644 0000767 0000024 00000075672 13114114302 033636 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.asn1.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.Arrays; import org.apache.directory.api.asn1.DecoderException; import org.junit.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 */ @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 */ @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 */ @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 ) ); } } apache-ldap-api-1.0.0-src/asn1/api/src/test/resources/log4j.properties0100755 0000767 0000024 00000002342 13114114302 027225 0ustar00elecharnystaff0000000 0000000 ############################################################################# # 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. ############################################################################# 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=DEBUGapache-ldap-api-1.0.0-src/asn1/ber/META-INF/MANIFEST.MF0100644 0000767 0000024 00000003630 13114114447 023111 0ustar00elecharnystaff0000000 0000000 Manifest-Version: 1.0 Bnd-LastModified: 1496357159585 Build-Jdk: 1.8.0_102 Built-By: elecharny Bundle-Description: A BER Codec Implementation for ASN.1 Bundle-DocURL: https://www.apache.org/ Bundle-License: https://www.apache.org/licenses/LICENSE-2.0.txt Bundle-ManifestVersion: 2 Bundle-Name: Apache Directory API ASN.1 BER Bundle-SymbolicName: org.apache.directory.api.asn1.ber Bundle-Vendor: The Apache Software Foundation Bundle-Version: 1.0.0 Created-By: Apache Maven Bundle Plugin Export-Package: org.apache.directory.api.asn1.actions;version="1.0.0";us es:="org.apache.directory.api.asn1,org.apache.directory.api.asn1.ber,or g.apache.directory.api.asn1.ber.grammar",org.apache.directory.api.asn1. ber;version="1.0.0";uses:="org.apache.directory.api.asn1,org.apache.dir ectory.api.asn1.ber.grammar,org.apache.directory.api.asn1.ber.tlv",org. apache.directory.api.asn1.ber.grammar;version="1.0.0";uses:="org.apache .directory.api.asn1,org.apache.directory.api.asn1.ber,org.apache.direct ory.api.asn1.ber.tlv",org.apache.directory.api.asn1.ber.tlv;version="1. 0.0";uses:="org.apache.directory.api.asn1,org.apache.directory.api.asn1 .util" Implementation-Title: Apache Directory API ASN.1 BER Implementation-URL: http://directory.apache.org/api-parent/api-asn1-pare nt/api-asn1-ber/ Implementation-Vendor: The Apache Software Foundation Implementation-Vendor-Id: org.apache.directory.api Implementation-Version: 1.0.0 Import-Package: org.apache.directory.api.asn1;version="1.0.0",org.apache .directory.api.asn1.util;version="1.0.0",org.apache.directory.api.i18n; version="1.0.0",org.apache.directory.api.util;version="1.0.0",org.slf4j ;version="[1.7,1.8)" Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))" Specification-Title: Apache Directory API ASN.1 BER Specification-Vendor: The Apache Software Foundation Specification-Version: 1.0.0 Tool: Bnd-3.3.0.201609221906 apache-ldap-api-1.0.0-src/asn1/ber/pom.xml0100644 0000767 0000024 00000007547 13114114302 021635 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-asn1-parent 1.0.0 api-asn1-ber Apache Directory API ASN.1 BER bundle A BER Codec Implementation for ASN.1 org.apache.directory.junit junit-addons test ${project.groupId} api-i18n ${project.groupId} api-asn1-api ${project.groupId} api-util org.slf4j slf4j-api findbugs annotations provided 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} ././@LongLink0100644 0000000 0000000 00000000162 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadBitString.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadB0100644 0000767 0000024 00000005616 13114114302 034422 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); /** Speedup for logs */ private static final boolean IS_DEBUG = LOG.isDebugEnabled(); /** * 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 ) { LOG.error( I18n.err( I18n.ERR_04066 ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04067 ) ); } byte[] data = tlv.getValue().getData(); setBitString( data, container ); if ( IS_DEBUG ) { LOG.debug( "BITSTRING value : {}", Strings.dumpBytes( data ) ); } } } ././@LongLink0100644 0000000 0000000 00000000160 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadInteger.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadI0100644 0000767 0000024 00000010131 13114114302 034415 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); /** Speedup for logs */ private static final boolean IS_DEBUG = LOG.isDebugEnabled(); /** 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 ) { LOG.error( I18n.err( I18n.ERR_04066 ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04067 ) ); } BerValue value = tlv.getValue(); try { int number = IntegerDecoder.parse( value, minValue, maxValue ); if ( IS_DEBUG ) { LOG.debug( "read integer value : {}", number ); } setIntegerValue( number, container ); } catch ( IntegerDecoderException ide ) { LOG.error( I18n.err( I18n.ERR_04070, Strings.dumpBytes( value.getData() ), ide .getLocalizedMessage() ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( ide.getMessage(), ide ); } } } ././@LongLink0100644 0000000 0000000 00000000164 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadOctetString.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadO0100644 0000767 0000024 00000006610 13114114302 034432 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ) ) { LOG.error( I18n.err( I18n.ERR_04066 ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04067 ) ); } BerValue value = tlv.getValue(); // The data should not be null if ( ( value.getData() == null ) && ( !canBeNull ) ) { LOG.error( I18n.err( I18n.ERR_04066 ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04067 ) ); } setOctetString( value.getData(), container ); } } ././@LongLink0100644 0000000 0000000 00000000157 13114114302 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/CheckNotNullLength.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/CheckNotNullL0100644 0000767 0000024 00000004173 13114114302 034423 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ) { LOG.error( I18n.err( I18n.ERR_04066 ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04067 ) ); } } } ././@LongLink0100644 0000000 0000000 00000000152 13114114302 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer0100644 0000767 0000024 00000015413 13114114302 034473 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.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 maximum allowed size for a PDU. Default to MAX int value */ private int maxPDUSize = Integer.MAX_VALUE; /** 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(); 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; } } ././@LongLink0100644 0000000 0000000 00000000146 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Container.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Container.jav0100644 0000767 0000024 00000012142 13114114302 034305 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); /** * @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(); /** * @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(); /** * @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 ); /** * @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(); /** * @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 ); } apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java0100644 0000767 0000024 00000066030 13114114302 034076 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 class Asn1Decoder implements TLVBerDecoderMBean { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( Asn1Decoder.class ); /** A speedup for logger */ private static final boolean IS_DEBUG = LOG.isDebugEnabled(); /** 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. */ public 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 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 ( IS_DEBUG ) { byte tag = container.getCurrentTLV().getTag(); LOG.debug( "Tag {} has been decoded", Asn1StringUtils.dumpByte( tag ) ); } return MORE; } else { // The stream has been exhausted return END; } } /** * Dump the current TLV tree * * @param container The container */ private 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 ( IS_DEBUG ) { LOG.debug( "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 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 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 > 4 ) { String msg = I18n.err( I18n.ERR_00005_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_00006_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 */ private boolean treatLengthPendingState( ByteBuffer stream, Asn1Container container ) { if ( stream.hasRemaining() ) { TLV tlv = container.getCurrentTLV(); int length = tlv.getLength(); while ( tlv.getLengthBytesRead() < tlv.getLengthNbBytes() ) { byte octet = stream.get(); if ( IS_DEBUG ) { LOG.debug( " current byte : {}", Asn1StringUtils.dumpByte( octet ) ); } tlv.incLengthBytesRead(); length = ( length << 8 ) | ( octet & 0x00FF ); 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 String getParentLength( TLV tlv ) { StringBuilder buffer = new StringBuilder(); buffer.append( "TLV expected length stack : " ); while ( true ) { if ( tlv == null ) { buffer.append( " - null" ); break; } else { buffer.append( " - " ).append( tlv.getExpectedLength() ); } tlv = tlv.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 void treatLengthEndState( Asn1Container container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); if ( tlv == null ) { String msg = I18n.err( I18n.ERR_00007_TLV_NULL ); LOG.error( msg ); throw new DecoderException( msg ); } int length = tlv.getLength(); // 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 ( IS_DEBUG ) { LOG.debug( "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 ( IS_DEBUG ) { LOG.debug( "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(); int currentLength = tlv.getSize(); if ( expectedLength < currentLength ) { // The expected length is lower than the Value length of the // current TLV. This is an error... LOG.debug( "tlv[{}, {}]", Integer.valueOf( expectedLength ), Integer.valueOf( currentLength ) ); throw new DecoderException( I18n.err( I18n.ERR_00008_VALUE_LENGTH_ABOVE_EXPECTED_LENGTH, Integer .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. parentTLV.setExpectedLength( 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 ( IS_DEBUG ) { LOG.debug( "Length {} has been 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 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 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 boolean treatTLVDoneState( ByteBuffer stream, Asn1Container container ) throws DecoderException { if ( IS_DEBUG ) { 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_00009_MORE_TLV_EXPECTED ) ); throw new DecoderException( I18n.err( I18n.ERR_00010_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 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_00042_PDU_SIZE_TOO_LONG, container.getDecodedBytes(), container .getMaxPDUSize() ); LOG.error( message ); throw new DecoderException( message ); } if ( IS_DEBUG ) { LOG.debug( ">>>==========================================" ); LOG.debug( "--> Decoding a PDU" ); LOG.debug( ">>>------------------------------------------" ); } while ( hasRemaining ) { if ( IS_DEBUG ) { LOG.debug( "--- State = {} ---", container.getState() ); if ( stream.hasRemaining() ) { byte octet = stream.get( stream.position() ); LOG.debug( " current byte : {}", Asn1StringUtils.dumpByte( octet ) ); } else { LOG.debug( " no more byte to decode in the stream" ); } } 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_00043_REMAINING_BYTES_FOR_DECODED_PDU ) ); } hasRemaining = false; break; default: break; } } if ( IS_DEBUG ) { LOG.debug( "<<<------------------------------------------" ); if ( container.getState() == TLVStateEnum.PDU_DECODED ) { if ( container.getCurrentTLV() != null ) { LOG.debug( "<-- Stop decoding : {}", container.getCurrentTLV().toString() ); } else { LOG.debug( "<-- Stop decoding : null current TLV" ); } } else { if ( container.getCurrentTLV() != null ) { LOG.debug( "<-- End decoding : {}", container.getCurrentTLV().toString() ); } else { LOG.debug( "<-- End decoding : null current TLV" ); } } LOG.debug( "<<<==========================================" ); } } /** * {@inheritDoc} */ @Override public int getMaxLengthLength() { return maxLengthLength; } /** * {@inheritDoc} */ @Override public int getMaxTagLength() { return maxTagLength; } /** * {@inheritDoc} */ @Override public void disallowIndefiniteLength() { this.indefiniteLengthAllowed = false; } /** * {@inheritDoc} */ @Override public void allowIndefiniteLength() { this.indefiniteLengthAllowed = true; } /** * {@inheritDoc} */ @Override public boolean isIndefiniteLengthAllowed() { return indefiniteLengthAllowed; } /** * {@inheritDoc} */ @Override public void setMaxLengthLength( int maxLengthLength ) throws DecoderException { if ( ( this.indefiniteLengthAllowed ) && ( maxLengthLength > 126 ) ) { throw new DecoderException( I18n.err( I18n.ERR_00011_LENGTH_TOO_LONG_FOR_DEFINITE_FORM ) ); } this.maxLengthLength = maxLengthLength; } /** * {@inheritDoc} */ @Override public void setMaxTagLength( int maxTagLength ) { this.maxTagLength = maxTagLength; } } ././@LongLink0100644 0000000 0000000 00000000160 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/AbstractGrammar.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/AbstractG0100644 0000767 0000024 00000007706 13114114302 034373 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.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 ); /** Speedup for logs */ private static final boolean IS_DEBUG = LOG.isDebugEnabled(); /** * 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() { } /** * {@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 ( transition == null ) { String errorMessage = I18n.err( I18n.ERR_00001_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 ( IS_DEBUG ) { LOG.debug( transition.toString() ); } if ( transition.hasAction() ) { Action action = transition.getAction(); action.action( container ); } container.setTransition( transition.getCurrentState() ); } } ././@LongLink0100644 0000000 0000000 00000000147 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/Action.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/Action.ja0100644 0000767 0000024 00000003004 13114114302 034312 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; } ././@LongLink0100644 0000000 0000000 00000000150 13114114302 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/Grammar.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/Grammar.j0100644 0000767 0000024 00000003427 13114114302 034333 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 { /** * 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 ); } ././@LongLink0100644 0000000 0000000 00000000156 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/GrammarAction.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/GrammarAc0100644 0000767 0000024 00000003416 13114114302 034345 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; } } ././@LongLink0100644 0000000 0000000 00000000162 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/GrammarTransition.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/GrammarTr0100644 0000767 0000024 00000011600 13114114302 034401 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.asn1.ber.grammar; import org.apache.directory.api.asn1.ber.Asn1Container; 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; /** * 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. */ public GrammarTransition( Enum previousState, Enum currentState, int currentTag, Action action ) { this.previousState = previousState; this.currentState = currentState; this.action = action; this.currentTag = currentTag; } /** * Creates a new GrammarTransition object. * * @param previousState the previous state * @param currentState The current state * @param currentTag the current TLV's tag */ public GrammarTransition( Enum previousState, Enum currentState, int currentTag ) { this.previousState = previousState; this.currentState = currentState; this.currentTag = currentTag; } /** * 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. */ public GrammarTransition( Enum previousState, Enum currentState, UniversalTag currentTag, Action action ) { this.previousState = previousState; this.currentState = currentState; this.action = action; this.currentTag = currentTag.getValue(); } /** * Creates a new GrammarTransition object. * * @param previousState the previous state * @param currentState The current state * @param currentTag the current TLV's tag */ public GrammarTransition( Enum previousState, Enum currentState, UniversalTag currentTag ) { this.previousState = previousState; this.currentState = currentState; this.currentTag = currentTag.getValue(); } /** * 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; } /** * @return Returns the action associated with the transition */ public Action getAction() { return action; } /** * @return The current state */ public Enum getCurrentState() { return currentState; } /** * @return The previous state */ public Enum getPreviousState() { return previousState; } /** * @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 ); } return sb.toString(); } } ././@LongLink0100644 0000000 0000000 00000000147 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/States.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/States.ja0100644 0000767 0000024 00000002334 13114114302 034345 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.asn1.ber.grammar; /** * Interface to get custom function from enum when casting. * * @author Apache Directory Project */ public interface States { /** * @return True if this is the END_STATE */ boolean isEndState(); /** * @return The START_STATE of the enum */ Enum getStartState(); } ././@LongLink0100644 0000000 0000000 00000000145 13114114302 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java0100644 0000767 0000024 00000073112 13114114302 034317 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.Asn1StringUtils; import org.apache.directory.api.asn1.util.BitString; import org.apache.directory.api.asn1.util.Oid; import org.apache.directory.api.i18n.I18n; /** * 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; } /** * @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 { 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 { 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 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_00003_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_00004_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_00003_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_00004_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_00003_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_00004_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_00003_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_00004_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_00003_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_00004_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_00003_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_00004_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_00003_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_00004_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 * @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_00003_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_00004_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_00003_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_00004_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(); } }././@LongLink0100644 0000000 0000000 00000000153 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BooleanDecoder.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BooleanDecode0100644 0000767 0000024 00000004263 13114114302 034356 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); 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_00034_0_BYTES_LONG_BOOLEAN ) ); } if ( bytes.length != 1 ) { throw new BooleanDecoderException( I18n.err( I18n.ERR_00035_N_BYTES_LONG_BOOLEAN ) ); } if ( ( bytes[0] != 0 ) && ( bytes[0] != ( byte ) 0xFF ) ) { LOG.warn( "A boolean must be encoded with a 0x00 or a 0xFF value" ); } return bytes[0] != 0; } } ././@LongLink0100644 0000000 0000000 00000000164 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BooleanDecoderException.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BooleanDecode0100644 0000767 0000024 00000002626 13114114302 034357 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); } } ././@LongLink0100644 0000000 0000000 00000000153 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/IntegerDecoder.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/IntegerDecode0100644 0000767 0000024 00000015464 13114114302 034401 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 }; 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_00038_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 byts 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... */ 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_00036_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_00036_0_BYTES_LONG_INTEGER ) ); } result = bytes[1] & 0x00FF; result = ( result << 8 ) | ( bytes[2] & 0x00FF ); result = ( result << 8 ) | ( bytes[3] & 0x00FF ); result = ( result << 8 ) | ( bytes[4] & 0x00FF ); } else { throw new IntegerDecoderException( I18n.err( I18n.ERR_00036_0_BYTES_LONG_INTEGER ) ); } break; 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_00037_ABOVE_4_BYTES_INTEGER ) ); } if ( !positive ) { result = -( ( ( ~result ) + 1 ) & MASK[bytes.length - 1] ); } return result; } } ././@LongLink0100644 0000000 0000000 00000000164 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/IntegerDecoderException.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/IntegerDecode0100755 0000767 0000024 00000002631 13114114302 034374 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); } } ././@LongLink0100644 0000000 0000000 00000000150 13114114302 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/LongDecoder.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/LongDecoder.j0100644 0000767 0000024 00000007062 13114114302 034310 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 }; 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_00038_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_00039_0_BYTES_LONG_LONG ) ); } if ( bytes.length > 8 ) { throw new LongDecoderException( I18n.err( I18n.ERR_00039_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; } } ././@LongLink0100644 0000000 0000000 00000000161 13114114302 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/LongDecoderException.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/LongDecoderEx0100644 0000767 0000024 00000002616 13114114302 034355 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); } } apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java0100644 0000767 0000024 00000025246 13114114302 033264 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; } /** * @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; } /** * @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; } } /** * @return The parent. */ public TLV getParent() { return 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; } /** * @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; } /** * @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; } /** * @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++; } /** * @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( ", " ); sb.append( value.toString() ); sb.append( "]" ); return sb.toString(); } } ././@LongLink0100644 0000000 0000000 00000000157 13114114302 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLVBerDecoderMBean.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLVBerDecoder0100644 0000767 0000024 00000004744 13114114302 034263 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.asn1.ber.tlv; import org.apache.directory.api.asn1.DecoderException; /** * A MBean used to get stats on the decoding process. * * @author Apache Directory Project */ public interface TLVBerDecoderMBean { /** * Set the number of bytes that can be used to encode the Value length, * including the first byte. Max is 127 if the Length use a definite form, * default is 1 * * @param length the number of byte to use * @throws DecoderException Thrown if the indefinite length is * allowed or if the length's Length is above 126 bytes */ void setMaxLengthLength( int length ) throws DecoderException; /** * Set the maximum number of bytes that should be used to encode a Tag * label, including the first byte. Default is 1, no maximum * * @param length The length to use */ void setMaxTagLength( int length ); /** Allow indefinite length. */ void allowIndefiniteLength(); /** Disallow indefinite length. */ void disallowIndefiniteLength(); /** * 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(); } ././@LongLink0100644 0000000 0000000 00000000151 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLVStateEnum.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLVStateEnum.0100644 0000767 0000024 00000004361 13114114302 034243 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 } ././@LongLink0100644 0000000 0000000 00000000151 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/UniversalTag.javaapache-ldap-api-1.0.0-src/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/UniversalTag.0100644 0000767 0000024 00000014720 13114114302 034354 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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: *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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; } /** * @return The UniversalTag value */ public byte getValue() { return value; } } apache-ldap-api-1.0.0-src/asn1/ber/src/site/site.xml0100644 0000767 0000024 00000002011 13114114301 023515 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000147 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/LengthTest.javaapache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/LengthTest.ja0100644 0000767 0000024 00000007017 13114114302 034400 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.asn1.ber.tlv; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.Arrays; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * This class is used to test the Length class * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class LengthTest { /** * Test the getNbBytes method */ @Test public void testLengthGetNbBytes() { assertEquals( "1 expected", 1, TLV.getNbBytes( 0 ) ); assertEquals( "1 expected", 1, TLV.getNbBytes( 1 ) ); assertEquals( "1 expected", 1, TLV.getNbBytes( 127 ) ); assertEquals( "2 expected", 2, TLV.getNbBytes( 128 ) ); assertEquals( "2 expected", 2, TLV.getNbBytes( 255 ) ); assertEquals( "3 expected", 3, TLV.getNbBytes( 256 ) ); assertEquals( "3 expected", 3, TLV.getNbBytes( 65535 ) ); assertEquals( "4 expected", 4, TLV.getNbBytes( 65536 ) ); assertEquals( "4 expected", 4, TLV.getNbBytes( 16777215 ) ); assertEquals( "5 expected", 5, TLV.getNbBytes( 16777216 ) ); assertEquals( "5 expected", 5, TLV.getNbBytes( 0xFFFFFFFF ) ); } /** * 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 ) ) ); } } ././@LongLink0100644 0000000 0000000 00000000153 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/PrimitivesTest.javaapache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/PrimitivesTes0100644 0000767 0000024 00000015323 13114114302 034534 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.asn1.ber.tlv; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Test the Primitives * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class PrimitivesTest { /** * Test the Integer Primitive */ @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(); value.init( 5 ); // res = 2^31 = MinInt value.setData( new byte[] { 0x00, ( byte ) 0x80, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00 } ); assertEquals( Integer.MIN_VALUE, IntegerDecoder.parse( value ) ); value.reset(); value.init( 5 ); // res = 2^31 = MinInt value.setData( new byte[] { 0x00, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF } ); assertEquals( -1, IntegerDecoder.parse( value ) ); 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 ././@LongLink0100644 0000000 0000000 00000000146 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/ValueTest.javaapache-ldap-api-1.0.0-src/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/ValueTest.jav0100644 0000767 0000024 00000063553 13114114302 034430 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.asn1.ber.tlv; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * This class is used to test the Value class * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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 */ @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 */ @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-ldap-api-1.0.0-src/asn1/pom.xml0100644 0000767 0000024 00000002747 13114114302 021062 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-parent 1.0.0 api-asn1-parent Apache Directory API ASN.1 Parent 2003 pom api ber apache-ldap-api-1.0.0-src/asn1/src/site/site.xml0100644 0000767 0000024 00000002044 13114114301 022753 0ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/distribution/pom.xml0100644 0000767 0000024 00000016654 13114114303 022742 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-parent 1.0.0 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 antlr antlr commons-collections commons-collections org.slf4j slf4j-log4j12 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-log4j12 org.slf4j slf4j-api antlr antlr commons-collections commons-collections log4j log4j 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.geronimo.genesis.plugins tools-maven-plugin verify-legal-files verify verify-legal-files false org.apache.maven.plugins maven-gpg-plugin sign-artifacts verify sign apache-ldap-api-1.0.0-src/distribution/src/main/assembly/anon.xml0100644 0000767 0000024 00000005141 13114114303 026421 0ustar00elecharnystaff0000000 0000000 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} antlr:antlr:jar:${antlr.version} commons-collections:commons-collections:jar:${commons.collections.version} log4j:log4j:jar:${log4j.version} org.slf4j:slf4j-api:jar:${slf4j.api.version} org.slf4j:slf4j-log4j12:jar:${slf4j.log4j12.version} true apache-ldap-api-1.0.0-src/distribution/src/main/assembly/bin.xml0100644 0000767 0000024 00000003541 13114114303 026240 0ustar00elecharnystaff0000000 0000000 bin zip tar.gz ${project.build.finalName}-bin src/main/release / ** target/additional-jars /lib /lib false runtime apache-ldap-api-1.0.0-src/distribution/src/main/assembly/src.xml0100644 0000767 0000024 00000004006 13114114303 026254 0ustar00elecharnystaff0000000 0000000 src zip tar.gz ${project.build.finalName}-src ${project.basedir}/.. / true / LICENSE NOTICE **/.*/** **/*.log **/${project.build.directory}/** src/main/release / ** apache-ldap-api-1.0.0-src/distribution/src/main/release/LICENSE0100644 0000767 0000024 00000026137 13114114303 025562 0ustar00elecharnystaff0000000 0000000 Apache License Version 2.0, January 2004 http://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 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. apache-ldap-api-1.0.0-src/distribution/src/main/release/licenses/antlr-LICENSE.txt0100644 0000767 0000024 00000002030 13114114303 031305 0ustar00elecharnystaff0000000 0000000 ANTLR 2 (http://www.antlr2.org/license.html) : 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-ldap-api-1.0.0-src/distribution/src/main/release/licenses/dom4j-LICENSE.txt0100644 0000767 0000024 00000003627 13114114303 031217 0ustar00elecharnystaff0000000 0000000 dom4j 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-ldap-api-1.0.0-src/distribution/src/main/release/licenses/jbcrypt-LICENSE.txt0100644 0000767 0000024 00000001505 13114114303 031650 0ustar00elecharnystaff0000000 0000000 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. */ apache-ldap-api-1.0.0-src/distribution/src/main/release/licenses/slf4j-LICENSE.txt0100644 0000767 0000024 00000002254 13114114303 031217 0ustar00elecharnystaff0000000 0000000 SLF4J (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. ././@LongLink0100644 0000000 0000000 00000000150 13114114303 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/distribution/src/main/release/licenses/xml-apis-LICENSE.dom-documentation.txtapache-ldap-api-1.0.0-src/distribution/src/main/release/licenses/xml-apis-LICENSE.dom-documentation.0100644 0000767 0000024 00000007763 13114114303 034626 0ustar00elecharnystaff0000000 0000000 xml-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.)apache-ldap-api-1.0.0-src/distribution/src/main/release/licenses/xml-apis-LICENSE.dom-software.txt0100644 0000767 0000024 00000007013 13114114303 034333 0ustar00elecharnystaff0000000 0000000 xml-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-ldap-api-1.0.0-src/distribution/src/main/release/licenses/xml-apis-LICENSE.sax.txt0100644 0000767 0000024 00000001444 13114114303 032521 0ustar00elecharnystaff0000000 0000000 xml-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-ldap-api-1.0.0-src/distribution/src/main/release/licenses/xml-apis-README.dom.txt0100644 0000767 0000024 00000002372 13114114303 032361 0ustar00elecharnystaff0000000 0000000 xml-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-ldap-api-1.0.0-src/distribution/src/main/release/licenses/xml-apis-README.sax.txt0100644 0000767 0000024 00000001313 13114114303 032367 0ustar00elecharnystaff0000000 0000000 xml-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-ldap-api-1.0.0-src/distribution/src/main/release/licenses/xml-apis-README.txt0100644 0000767 0000024 00000001240 13114114303 031574 0ustar00elecharnystaff0000000 0000000 xml-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-ldap-api-1.0.0-src/distribution/src/main/release/licenses/xpp3-LICENSE.txt0100644 0000767 0000024 00000004344 13114114303 031071 0ustar00elecharnystaff0000000 0000000 XPP3 (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-ldap-api-1.0.0-src/distribution/src/main/release/NOTICE0100644 0000767 0000024 00000002521 13114114303 025450 0ustar00elecharnystaff0000000 0000000 Apache Directory LDAP API Distribution Copyright 2003-2014 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Additional copyright notices and license terms applicable are present in the 'licenses' directory. This product uses Apache Ant (http://ant.apache.org/). This product includes/uses Apache Commons (http://commons.apache.org/). This product includes/uses Apache Logging Services (http://logging.apache.org/). This product includes/uses Apache Felix (http://felix.apache.org/). This product uses Apache Maven (http://maven.apache.org/). This product includes/uses Apache Mina (http://mina.apache.org/). This product includes/uses software, AntLR Parser Generator (http://www.antlr.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, XMLPullParser 3 - xpp3:xpp3:jar:1.1.3.4.O (http://www.extreme.indiana.edu/xgws/xsoap/xpp/mxp1/) This product includes/uses software, jBCrypt 0.4.1 (http://www.mindrot.org/files/jBCrypt) apache-ldap-api-1.0.0-src/dsml/engine/META-INF/MANIFEST.MF0100644 0000767 0000024 00000004452 13114115356 023706 0ustar00elecharnystaff0000000 0000000 Manifest-Version: 1.0 Bnd-LastModified: 1496357614483 Build-Jdk: 1.8.0_102 Built-By: elecharny Bundle-Description: The Apache Directory Project provides directory solu tions entirely written in Java. These include a directory server, which has been certified as LDAP v3 compliant by the Open Group (Apache Directory Server), and Eclipse-based directory tools (Apache Directory Studio). Bundle-DocURL: https://www.apache.org/ Bundle-License: https://www.apache.org/licenses/LICENSE-2.0.txt Bundle-ManifestVersion: 2 Bundle-Name: Apache Directory LDAP API DSML Engine Bundle-SymbolicName: org.apache.directory.api.dsmlv2.engine Bundle-Vendor: The Apache Software Foundation Bundle-Version: 1.0.0 Created-By: Apache Maven Bundle Plugin Export-Package: org.apache.directory.api.dsmlv2.engine;version="1.0.0";u ses:="org.apache.directory.api.asn1,org.apache.directory.api.dsmlv2,org .apache.directory.api.dsmlv2.request,org.apache.directory.api.dsmlv2.re sponse,org.apache.directory.api.ldap.model.exception,org.apache.directo ry.api.ldap.model.message,org.apache.directory.ldap.client.api,org.xmlp ull.v1" Implementation-Title: Apache Directory LDAP API DSML Engine Implementation-URL: http://directory.apache.org/api-parent/api-dsml-pare nt/api-dsml-engine/ Implementation-Vendor: The Apache Software Foundation Implementation-Vendor-Id: org.apache.directory.api Implementation-Version: 1.0.0 Import-Package: org.apache.directory.api.asn1;version="1.0.0",org.apache .directory.api.dsmlv2;version="1.0.0",org.apache.directory.api.dsmlv2.r esponse;version="1.0.0",org.apache.directory.api.dsmlv2.request;version ="1.0.0",org.apache.directory.api.i18n;version="1.0.0",org.apache.direc tory.api.ldap.model.cursor;version="1.0.0",org.apache.directory.api.lda p.model.exception;version="1.0.0",org.apache.directory.api.ldap.model.m essage;version="1.0.0",org.apache.directory.api.util;version="1.0.0",or g.apache.directory.ldap.client.api;version="1.0.0",org.dom4j;version="1 .6.1",org.slf4j;version="[1.7,1.8)",org.xmlpull.v1;version="1.1.0.4c" Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))" Specification-Title: Apache Directory LDAP API DSML Engine Specification-Vendor: The Apache Software Foundation Specification-Version: 1.0.0 Tool: Bnd-3.3.0.201609221906 apache-ldap-api-1.0.0-src/dsml/engine/pom.xml0100644 0000767 0000024 00000010023 13114114275 022417 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-dsml-parent 1.0.0 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.asn1;version=${project.version}, org.apache.directory.api.dsmlv2;version=${project.version}, org.apache.directory.api.dsmlv2.response;version=${project.version}, org.apache.directory.api.dsmlv2.request;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} ././@LongLink0100644 0000000 0000000 00000000155 13114114275 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/engine/src/main/java/org/apache/directory/api/dsmlv2/engine/Dsmlv2Engine.javaapache-ldap-api-1.0.0-src/dsml/engine/src/main/java/org/apache/directory/api/dsmlv2/engine/Dsmlv2Eng0100644 0000767 0000024 00000071124 13114114275 034534 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.asn1.DecoderException; import org.apache.directory.api.asn1.EncoderException; 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.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(); 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 ); 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 FileNotFoundException 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(), "UTF-8" ); } catch ( IOException e ) { LOG.error( "Failed to process the 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 ) { LOG.warn( "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_03001, 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; } if ( respWriter != null ) { StringBuilder sb = new StringBuilder(); sb.append( "" ); respWriter.write( 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 ) { LOG.warn( "Failed while 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_03001, 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; } // (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_03002 ) ); if ( respWriter != null ) { writeResponse( respWriter, errorResponse ); } else { batchResponse.addResponse( errorResponse ); } break; } try { processRequest( request, respWriter ); } catch ( Exception e ) { LOG.warn( "Failed to process 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_03003, 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_03001, 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 ); } } /** * @return the generateSoapResp */ public boolean isGenerateSoapResp() { return generateSoapResp; } /** * @param generateSoapResp the generateSoapResp to set */ public void setGenerateSoapResp( boolean generateSoapResp ) { this.generateSoapResp = generateSoapResp; } /** * @return the batchResponse */ public BatchResponseDsml getBatchResponse() { return batchResponse; } /** * @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( "Unexpected request tpye " + 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 EncoderException If we had an issue while encoding the request * @throws DecoderException If we had an issue while decoding the request * @throws IOException If we had an issue while transmitting the request or re ceiving the response */ protected void bind( int messageId ) throws LdapException, EncoderException, DecoderException, IOException { if ( ( connection != null ) && connection.isAuthenticated() ) { return; } if ( connection == null ) { throw new IOException( I18n.err( I18n.ERR_03101_MISSING_CONNECTION_TO ) ); } 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 ) { LOG.warn( "Error : {}", bindResponse.getLdapResult().getDiagnosticMessage() ); } } } apache-ldap-api-1.0.0-src/dsml/engine/src/site/site.xml0100644 0000767 0000024 00000002011 13114114275 024321 0ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/META-INF/MANIFEST.MF0100644 0000767 0000024 00000006520 13114115145 023727 0ustar00elecharnystaff0000000 0000000 Manifest-Version: 1.0 Bnd-LastModified: 1496357476957 Build-Jdk: 1.8.0_102 Built-By: elecharny Bundle-Description: The Apache Directory Project provides directory solu tions entirely written in Java. These include a directory server, which has been certified as LDAP v3 compliant by the Open Group (Apache Directory Server), and Eclipse-based directory tools (Apache Directory Studio). Bundle-DocURL: https://www.apache.org/ Bundle-License: https://www.apache.org/licenses/LICENSE-2.0.txt Bundle-ManifestVersion: 2 Bundle-Name: Apache Directory LDAP API DSML Parser Bundle-SymbolicName: org.apache.directory.api.dsmlv2.parser Bundle-Vendor: The Apache Software Foundation Bundle-Version: 1.0.0 Created-By: Apache Maven Bundle Plugin Export-Package: org.apache.directory.api.dsmlv2;version="1.0.0";uses:="o rg.apache.directory.api.dsmlv2.request,org.apache.directory.api.dsmlv2. response,org.apache.directory.api.ldap.codec.api,org.apache.directory.a pi.ldap.model.message,org.dom4j,org.xmlpull.v1",org.apache.directory.ap i.dsmlv2.response;version="1.0.0";uses:="org.apache.directory.api.asn1. util,org.apache.directory.api.dsmlv2,org.apache.directory.api.ldap.code c.api,org.apache.directory.api.ldap.model.entry,org.apache.directory.ap i.ldap.model.exception,org.apache.directory.api.ldap.model.message,org. apache.directory.api.ldap.model.name,org.apache.directory.api.ldap.mode l.url,org.dom4j",org.apache.directory.api.dsmlv2.request;version="1.0.0 ";uses:="org.apache.directory.api.asn1,org.apache.directory.api.asn1.ut il,org.apache.directory.api.dsmlv2,org.apache.directory.api.ldap.codec. api,org.apache.directory.api.ldap.model.entry,org.apache.directory.api. ldap.model.exception,org.apache.directory.api.ldap.model.filter,org.apa che.directory.api.ldap.model.message,org.apache.directory.api.ldap.mode l.name,org.dom4j" Implementation-Title: Apache Directory LDAP API DSML Parser Implementation-URL: http://directory.apache.org/api-parent/api-dsml-pare nt/api-dsml-parser/ Implementation-Vendor: The Apache Software Foundation Implementation-Vendor-Id: org.apache.directory.api Implementation-Version: 1.0.0 Import-Package: org.apache.directory.api.asn1;version="1.0.0",org.apache .directory.api.asn1.util;version="1.0.0",org.apache.directory.api.i18n; version="1.0.0",org.apache.directory.api.ldap.codec.api;version="1.0.0" ,org.apache.directory.api.ldap.model.entry;version="1.0.0",org.apache.d irectory.api.ldap.model.exception;version="1.0.0",org.apache.directory. api.ldap.model.filter;version="1.0.0",org.apache.directory.api.ldap.mod el.ldif;version="1.0.0",org.apache.directory.api.ldap.model.message;ver sion="1.0.0",org.apache.directory.api.ldap.model.message.controls;versi on="1.0.0",org.apache.directory.api.ldap.model.name;version="1.0.0",org .apache.directory.api.ldap.model.url;version="1.0.0",org.apache.directo ry.api.util;version="1.0.0",org.dom4j;version="1.6.1",org.dom4j.io;vers ion="1.6.1",org.dom4j.tree;version="1.6.1",org.slf4j;version="[1.7,1.8) ",org.xmlpull.v1;version="1.1.0.4c",javax.xml.transform,javax.xml.trans form.stream Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))" Specification-Title: Apache Directory LDAP API DSML Parser Specification-Vendor: The Apache Software Foundation Specification-Version: 1.0.0 Tool: Bnd-3.3.0.201609221906 apache-ldap-api-1.0.0-src/dsml/parser/pom.xml0100644 0000767 0000024 00000013153 13114114302 022444 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-dsml-parent 1.0.0 api-dsml-parser Apache Directory LDAP API DSML Parser bundle org.apache.directory.junit junit-addons test ${project.groupId} api-ldap-codec-standalone test ${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 findbugs annotations provided maven-surefire-plugin org.apache.maven.plugins ${basedir}/target ${project.build.directory} false osgi-cache 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 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}, javax.xml.transform, javax.xml.transform.stream apache-ldap-api-1.0.0-src/dsml/parser/src/checkstyle/suppressions.xml0100644 0000767 0000024 00000002426 13114114302 027354 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000166 13114114301 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/AbstractDsmlMessageDecorator.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/AbstractDsmlMess0100644 0000767 0000024 00000011356 13114114301 034717 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; /** * 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; /** * 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; } /** * @return The codec to use to encode or decode this message */ public LdapApiService getCodecService() { return codec; } /** * {@inheritDoc} */ public MessageTypeEnum getType() { return message.getType(); } /** * {@inheritDoc} */ public Map getControls() { return controls; } /** * {@inheritDoc} */ public Control getControl( String oid ) { return controls.get( oid ); } /** * {@inheritDoc} */ public boolean hasControl( String oid ) { return controls.containsKey( oid ); } /** * {@inheritDoc} */ public Message addControl( Control control ) { Control decorated; DsmlControl decorator; if ( control instanceof DsmlControl ) { decorator = ( DsmlControl ) control; decorated = decorator.getDecorated(); } else { decorator = new DsmlControl( codec, codec.newControl( control ) ); decorated = control; } message.addControl( decorated ); controls.put( control.getOid(), decorator ); currentControl = decorator; return this; } /** * {@inheritDoc} */ public Message addAllControls( Control[] controlsToAdd ) { for ( Control control : controlsToAdd ) { addControl( control ); } return this; } /** * {@inheritDoc} */ public Message removeControl( Control control ) { controls.remove( control.getOid() ); message.removeControl( control ); return this; } /** * {@inheritDoc} */ public int getMessageId() { return message.getMessageId(); } /** * {@inheritDoc} */ public Object get( Object key ) { return message.get( key ); } /** * {@inheritDoc} */ public Object put( Object key, Object value ) { return message.put( key, value ); } /** * {@inheritDoc} */ public Message setMessageId( int messageId ) { message.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ public M getDecorated() { return message; } } ././@LongLink0100644 0000000 0000000 00000000151 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/AbstractGrammar.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/AbstractGrammar.0100644 0000767 0000024 00000011056 13114114302 034632 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; /** * Returns the grammar's name * * @return The grammar name */ public String getName() { return name; } /** * Sets the grammar's name * * @param name the name to set */ 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. */ public Enum[] getStatesEnum() { return Dsmlv2StatesEnum.values(); } /** * {@inheritDoc} */ 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, new Tag( tagName, tagType ) ), xpp, null ); } } } apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Action.java0100644 0000767 0000024 00000002627 13114114302 033643 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; }././@LongLink0100644 0000000 0000000 00000000160 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/actions/ReadSoapHeader.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/actions/ReadSoap0100644 0000767 0000024 00000005266 13114114302 034646 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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} */ 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 = -1; 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-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Container.java0100644 0000767 0000024 00000003471 13114114301 034345 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); /** * @return Returns the states. */ Enum[] getStates(); } ././@LongLink0100644 0000000 0000000 00000000145 13114114301 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/DsmlControl.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/DsmlControl.java0100644 0000767 0000024 00000006503 13114114301 034662 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; } /** * @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} */ public String getOid() { return decorated.getOid(); } /** * {@inheritDoc} */ public boolean isCritical() { return decorated.isCritical(); } /** * {@inheritDoc} */ public void setCritical( boolean isCritical ) { decorated.setCritical( isCritical ); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { return null; } /** * {@inheritDoc} */ public C getDecorated() { return decorated; } } ././@LongLink0100644 0000000 0000000 00000000147 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/DsmlDecorator.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/DsmlDecorator.ja0100644 0000767 0000024 00000003024 13114114301 034630 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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(); } ././@LongLink0100644 0000000 0000000 00000000151 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Dsmlv2Container.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Dsmlv2Container.0100644 0000767 0000024 00000012442 13114114302 034572 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 */ public Enum getState() { return state; } /** * Set the new current state * * @param state the new state */ public void setState( Enum state ) { this.state = state; } /** * Get the transition * * @return the transition from the previous state to the new state */ public Enum getTransition() { return transition; } /** * Update the transition from a state to another * * @param transition the transition to set */ public void setTransition( Enum transition ) { this.transition = transition; } /** * Get the states for this container's grammars * * @return the states. */ 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 ); } } ././@LongLink0100644 0000000 0000000 00000000146 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Dsmlv2Parser.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Dsmlv2Parser.jav0100644 0000767 0000024 00000025334 13114114301 034610 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 FileNotFoundException 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_03037, 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, 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_03037, 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_03037, 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; } } } ././@LongLink0100644 0000000 0000000 00000000156 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Dsmlv2ResponseParser.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Dsmlv2ResponsePa0100644 0000767 0000024 00000022500 13114114301 034644 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 FileNotFoundException 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_03037, 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, 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_03037, 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_03037, 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; } } } ././@LongLink0100644 0000000 0000000 00000000152 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Dsmlv2StatesEnum.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Dsmlv2StatesEnum0100644 0000767 0000024 00000034123 13114114301 034661 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 } apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Grammar.java0100644 0000767 0000024 00000003651 13114114301 034011 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); }././@LongLink0100644 0000000 0000000 00000000147 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/GrammarAction.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/GrammarAction.ja0100644 0000767 0000024 00000003056 13114114302 034620 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 */ public String toString() { return name; } }././@LongLink0100644 0000000 0000000 00000000153 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/GrammarTransition.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/GrammarTransitio0100644 0000767 0000024 00000006153 13114114302 034767 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ) { StringBuffer sb = new StringBuffer(); sb.append( "Transition from <" ).append( currentState ).append( "> to <" ).append( nextState ).append( ">, action : " ).append( ( ( action == null ) ? "no action" : action.toString() ) ).append( ">" ); return sb.toString(); } }././@LongLink0100644 0000000 0000000 00000000145 13114114302 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/ParserUtils.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/ParserUtils.java0100644 0000767 0000024 00000026667 13114114302 034715 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2; import java.util.Arrays; import java.util.Collection; 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.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.CodecControl; import org.apache.directory.api.ldap.codec.api.LdapApiService; import org.apache.directory.api.ldap.model.entry.BinaryValue; import org.apache.directory.api.ldap.model.entry.StringValue; import org.apache.directory.api.ldap.model.ldif.LdifUtils; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.util.Base64; 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"; /** 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 ); 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 ( xpp.getAttributeName( i ).equals( "type" ) && 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] ) ); } /** * 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 ) { if ( value instanceof StringValue ) { return false; } else if ( value instanceof BinaryValue ) { return false; } else if ( value instanceof byte[] ) { return true; } else if ( value instanceof String ) { return !LdifUtils.isLDIFSafe( ( String ) value ); } return true; } /** * 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.encode( ( byte[] ) value ) ); } else if ( value instanceof String ) { return new String( Base64.encode( Strings.getBytesUtf8( ( String ) value ) ) ); } return ""; } /** * 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_03038, requestID ), xpp, null ); } return requestID; } catch ( NumberFormatException nfe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03039 ), 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 */ public static void addControls( LdapApiService codec, Element element, Collection controls ) { if ( controls != null ) { for ( Control control : controls ) { Element controlElement = element.addElement( "control" ); if ( control.getOid() != null ) { controlElement.addAttribute( "type", control.getOid() ); } if ( control.isCritical() ) { controlElement.addAttribute( "criticality", "true" ); } byte[] value; if ( control instanceof CodecControl ) { value = ( ( org.apache.directory.api.ldap.codec.api.CodecControl ) control ).getValue(); } else { value = codec.newControl( control ).getValue(); } if ( value != null ) { if ( ParserUtils.needsBase64Encoding( value ) ) { element.getDocument().getRootElement().add( XSD_NAMESPACE ); element.getDocument().getRootElement().add( XSI_NAMESPACE ); Element valueElement = controlElement.addElement( "controlValue" ).addText( ParserUtils.base64Encode( value ) ); valueElement.addAttribute( new QName( "type", XSI_NAMESPACE ), ParserUtils.XSD + ":" + ParserUtils.BASE64BINARY ); } else { controlElement.addElement( "controlValue" ).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_03040 ), 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 { transformer = factory.newTransformer( new StreamSource( ParserUtils.class .getResourceAsStream( "/org/apache/directory/shared/dsmlv2/DSMLv2.xslt" ) ) ); } catch ( TransformerConfigurationException e1 ) { LOG.warn( "Failed to create the XSLT transformer", e1 ); // return original document return document; } // 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 Document transformedDoc = result.getDocument(); return transformedDoc; } /** * GrammarAction that reads the SOAP header data */ public static final GrammarAction READ_SOAP_HEADER = new ReadSoapHeader(); } ././@LongLink0100644 0000000 0000000 00000000164 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/AbandonRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/AbandonR0100644 0000767 0000024 00000007740 13114114302 034663 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; 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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); // AbandonID if ( getDecorated().getAbandoned() != 0 ) { element.addAttribute( "abandonID", 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} */ public int getAbandoned() { return getDecorated().getAbandoned(); } /** * {@inheritDoc} */ public AbandonRequest setAbandoned( int requestId ) { getDecorated().setAbandoned( requestId ); return this; } /** * {@inheritDoc} */ public AbandonRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ public AbandonRequest addControl( Control control ) { return ( AbandonRequest ) super.addControl( control ); } /** * {@inheritDoc} */ public AbandonRequest addAllControls( Control[] controls ) { return ( AbandonRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ public AbandonRequest removeControl( Control control ) { return ( AbandonRequest ) super.removeControl( control ); } } ././@LongLink0100644 0000000 0000000 00000000165 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/AbstractRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Abstract0100644 0000767 0000024 00000010036 13114114302 034732 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.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 */ public Element toDsml( Element root ) { Element element = root.addElement( getRequestName() ); // Request ID int requestID = getDecorated().getMessageId(); if ( requestID > 0 ) { element.addAttribute( "requestID", Integer.toString( requestID ) ); } // Controls ParserUtils.addControls( getCodecService(), element, getDecorated().getControls().values() ); 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. */ private String getRequestName() { switch ( getDecorated().getType() ) { case ABANDON_REQUEST: return "abandonRequest"; case ADD_REQUEST: return "addRequest"; case BIND_REQUEST: return "authRequest"; case COMPARE_REQUEST: return "compareRequest"; case DEL_REQUEST: return "delRequest"; case EXTENDED_REQUEST: return "extendedRequest"; case MODIFYDN_REQUEST: return "modDNRequest"; case MODIFY_REQUEST: return "modifyRequest"; case SEARCH_REQUEST: return "searchRequest"; default: return "error"; } } /** * @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} */ public boolean hasResponse() { return getDecorated().hasResponse(); } } ././@LongLink0100644 0000000 0000000 00000000203 13114114301 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/AbstractResultResponseRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Abstract0100644 0000767 0000024 00000011123 13114114301 034727 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; import java.nio.ByteBuffer; import org.apache.directory.api.asn1.EncoderException; 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 */ public Element toDsml( Element root ) { Element element = root.addElement( getRequestName() ); // Request ID int requestID = getDecorated().getMessageId(); if ( requestID > 0 ) { element.addAttribute( "requestID", Integer.toString( requestID ) ); } // Controls ParserUtils.addControls( getCodecService(), element, getDecorated().getControls().values() ); 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. */ private String getRequestName() { switch ( getDecorated().getType() ) { case ABANDON_REQUEST: return "abandonRequest"; case ADD_REQUEST: return "addRequest"; case BIND_REQUEST: return "authRequest"; case COMPARE_REQUEST: return "compareRequest"; case DEL_REQUEST: return "delRequest"; case EXTENDED_REQUEST: return "extendedRequest"; case MODIFYDN_REQUEST: return "modDNRequest"; case MODIFY_REQUEST: return "modifyRequest"; case SEARCH_REQUEST: return "searchRequest"; default: return "error"; } } public int computeLength() { return 0; } public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { return null; } /** * {@inheritDoc} */ public ResultResponse getResultResponse() { return getDecorated().getResultResponse(); } /** * {@inheritDoc} */ public void abandon() { ( ( AbandonableRequest ) getDecorated() ).abandon(); } /** * {@inheritDoc} */ public boolean isAbandoned() { return ( ( AbandonableRequest ) getDecorated() ).isAbandoned(); } /** * {@inheritDoc} */ public AbandonableRequest addAbandonListener( AbandonListener listener ) { ( ( AbandonableRequest ) getDecorated() ).addAbandonListener( listener ); return this; } } ././@LongLink0100644 0000000 0000000 00000000160 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/AddRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/AddReque0100644 0000767 0000024 00000020666 13114114302 034673 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; 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 ); } /** * @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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); // Dn if ( getDecorated().getEntry() != null ) { element.addAttribute( "dn", getDecorated().getEntry().getDn().getName() ); } // Attributes Entry entry = getDecorated().getEntry(); if ( entry != null ) { for ( Attribute attribute : entry ) { Element attributeElement = element.addElement( "attr" ); attributeElement.addAttribute( "name", attribute.getId() ); // Looping on Values for ( Value value : attribute ) { if ( ParserUtils.needsBase64Encoding( value.getValue() ) ) { Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI ); attributeElement.getDocument().getRootElement().add( xsdNamespace ); attributeElement.getDocument().getRootElement().add( xsiNamespace ); Element valueElement = attributeElement.addElement( "value" ).addText( ParserUtils.base64Encode( value.getValue() ) ); valueElement .addAttribute( new QName( "type", xsiNamespace ), "xsd:" + ParserUtils.BASE64BINARY ); } else { attributeElement.addElement( "value" ).addText( value.getString() ); } } } } return element; } /** * Initialize the Entry. */ public void initEntry() { } /** * Get the entry with its attributes. * * @return Returns the entry. */ 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. */ public Dn getEntryDn() { return getDecorated().getEntryDn(); } /** * {@inheritDoc} */ public AddRequest setEntryDn( Dn entryDn ) { getDecorated().setEntryDn( entryDn ); return this; } /** * {@inheritDoc} */ public AddRequest setEntry( Entry entry ) { getDecorated().setEntry( entry ); return this; } /** * {@inheritDoc} */ public AddRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ public AddRequest addControl( Control control ) { return ( AddRequest ) super.addControl( control ); } /** * {@inheritDoc} */ public AddRequest addAllControls( Control[] controls ) { return ( AddRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ public AddRequest removeControl( Control control ) { return ( AddRequest ) super.removeControl( control ); } /** * {@inheritDoc} */ public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } } ././@LongLink0100644 0000000 0000000 00000000153 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/AndFilter.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/AndFilte0100644 0000767 0000024 00000003045 13114114301 034656 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 { /** * 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 */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append( '&' ).append( super.toString() ); return sb.toString(); } } ././@LongLink0100644 0000000 0000000 00000000171 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/AttributeValueAssertion.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Attribut0100644 0000767 0000024 00000013213 13114114302 034765 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.ldap.codec.api.LdapCodecConstants; import org.apache.directory.api.ldap.model.entry.BinaryValue; import org.apache.directory.api.ldap.model.entry.StringValue; 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 { // ~ Instance fields // ---------------------------------------------------------------------------- /** The attribute description */ private String attributeDesc; /** The assertion value */ private Value assertionValue; /** * * 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 StringValue ) { return ( ( StringValue ) object ).getValue(); } else if ( object instanceof BinaryValue ) { return Strings.dumpBytes( ( ( BinaryValue ) object ).getValue() ); } else { return ""; } } else { return ""; } } // ~ 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 ) { StringBuffer sb = new StringBuffer(); 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 ) { StringBuffer sb = new StringBuffer(); 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( "Unexpected filter type " + filterType ); } sb.append( dumpObject( assertionValue ) ); return sb.toString(); } /** * Get a String representation of an AttributeValueAssertion * * @return An AttributeValueAssertion String */ public String toString() { return toString( "" ); } } ././@LongLink0100644 0000000 0000000 00000000177 13114114302 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/AttributeValueAssertionFilter.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Attribut0100644 0000767 0000024 00000004621 13114114302 034770 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 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 */ public String toString() { return assertion != null ? assertion.toStringRFC2254( filterType ) : ""; } } ././@LongLink0100644 0000000 0000000 00000000162 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/BatchRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/BatchReq0100644 0000767 0000024 00000020614 13114114302 034663 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.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( "batchRequest" ); // RequestID if ( requestID != 0 ) { element.addAttribute( "requestID", Integer.toString( requestID ) ); } // ResponseOrder if ( responseOrder == ResponseOrder.UNORDERED ) { element.addAttribute( "responseOrder", "unordered" ); } // Processing if ( processing == Processing.PARALLEL ) { element.addAttribute( "processing", "parallel" ); } // On Error if ( onError == OnError.RESUME ) { element.addAttribute( "onError", "resume" ); } // Requests for ( DsmlDecorator request : requests ) { request.toDsml( element ); } return ParserUtils.styleDocument( document ).asXML(); } /** * @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() { StringBuffer sb = new StringBuffer(); 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(); } } ././@LongLink0100644 0000000 0000000 00000000161 13114114302 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/BindRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/BindRequ0100644 0000767 0000024 00000013545 13114114302 034710 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; 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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ 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( "principal", dn.getName() ); } else { // No DN has been provided, let's use the name as a string instead String name = request.getName(); element.addAttribute( "principal", name ); } return element; } /** * {@inheritDoc} */ public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ public boolean isSimple() { return getDecorated().isSimple(); } /** * {@inheritDoc} */ public boolean getSimple() { return getDecorated().getSimple(); } /** * {@inheritDoc} */ public BindRequest setSimple( boolean isSimple ) { getDecorated().setSimple( isSimple ); return this; } /** * {@inheritDoc} */ public byte[] getCredentials() { return getDecorated().getCredentials(); } /** * {@inheritDoc} */ public BindRequest setCredentials( String credentials ) { getDecorated().setCredentials( credentials ); return this; } /** * {@inheritDoc} */ public BindRequest setCredentials( byte[] credentials ) { getDecorated().setCredentials( credentials ); return this; } /** * {@inheritDoc} */ public String getName() { return getDecorated().getName(); } /** * {@inheritDoc} */ public BindRequest setName( String name ) { getDecorated().setName( name ); return this; } /** * {@inheritDoc} */ public Dn getDn() { return getDecorated().getDn(); } /** * {@inheritDoc} */ public BindRequest setDn( Dn dn ) { getDecorated().setDn( dn ); return this; } /** * {@inheritDoc} */ public boolean isVersion3() { return getDecorated().isVersion3(); } /** * {@inheritDoc} */ public boolean getVersion3() { return getDecorated().getVersion3(); } /** * {@inheritDoc} */ public BindRequest setVersion3( boolean isVersion3 ) { getDecorated().setVersion3( isVersion3 ); return this; } /** * {@inheritDoc} */ public String getSaslMechanism() { return getDecorated().getSaslMechanism(); } /** * {@inheritDoc} */ public BindRequest setSaslMechanism( String saslMechanism ) { getDecorated().setSaslMechanism( saslMechanism ); return this; } /** * {@inheritDoc} */ public BindRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ public BindRequest addControl( Control control ) { return ( BindRequest ) super.addControl( control ); } /** * {@inheritDoc} */ public BindRequest addAllControls( Control[] controls ) { return ( BindRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ public BindRequest removeControl( Control control ) { return ( BindRequest ) super.removeControl( control ); } } ././@LongLink0100644 0000000 0000000 00000000164 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/CompareRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/CompareR0100644 0000767 0000024 00000013726 13114114302 034710 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; 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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); CompareRequest request = getDecorated(); // Dn if ( request.getName() != null ) { element.addAttribute( "dn", request.getName().getName() ); } // Assertion Element assertionElement = element.addElement( "assertion" ); if ( request.getAttributeId() != null ) { assertionElement.addAttribute( "name", request.getAttributeId() ); } if ( request.getAssertionValue() != null ) { assertionElement.addElement( "value" ).setText( request.getAssertionValue().getString() ); } return element; } /** * Get the entry to be compared * * @return Returns the entry. */ public Dn getName() { return getDecorated().getName(); } /** * Set the entry to be compared * * @param entry The entry to set. */ 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} */ public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ public CompareRequest setAssertionValue( String value ) { getDecorated().setAssertionValue( value ); return this; } /** * {@inheritDoc} */ public CompareRequest setAssertionValue( byte[] value ) { getDecorated().setAssertionValue( value ); return this; } /** * {@inheritDoc} */ public String getAttributeId() { return getDecorated().getAttributeId(); } /** * {@inheritDoc} */ public CompareRequest setAttributeId( String attrId ) { getDecorated().setAttributeId( attrId ); return this; } /** * {@inheritDoc} */ public Value getAssertionValue() { return getDecorated().getAssertionValue(); } /** * {@inheritDoc} */ public CompareRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ public CompareRequest addControl( Control control ) { return ( CompareRequest ) super.addControl( control ); } /** * {@inheritDoc} */ public CompareRequest addAllControls( Control[] controls ) { return ( CompareRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ public CompareRequest removeControl( Control control ) { return ( CompareRequest ) super.removeControl( control ); } } ././@LongLink0100644 0000000 0000000 00000000161 13114114302 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/ConnectorFilter.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Connecto0100644 0000767 0000024 00000004602 13114114302 034741 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; /** * 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 */ public String toString() { StringBuffer sb = new StringBuffer(); if ( ( filterSet != null ) && ( filterSet.size() != 0 ) ) { for ( Filter filter : filterSet ) { sb.append( '(' ).append( filter ).append( ')' ); } } return sb.toString(); } } ././@LongLink0100644 0000000 0000000 00000000160 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/DelRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/DelReque0100644 0000767 0000024 00000010003 13114114302 034667 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; 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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); // Dn if ( getDecorated().getName() != null ) { element.addAttribute( "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} */ public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ public Dn getName() { return getDecorated().getName(); } /** * {@inheritDoc} */ public DeleteRequest setName( Dn name ) { getDecorated().setName( name ); return this; } /** * {@inheritDoc} */ public DeleteRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ public DeleteRequest addControl( Control control ) { return ( DeleteRequest ) super.addControl( control ); } /** * {@inheritDoc} */ public DeleteRequest addAllControls( Control[] controls ) { return ( DeleteRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ public DeleteRequest removeControl( Control control ) { return ( DeleteRequest ) super.removeControl( control ); } } ././@LongLink0100644 0000000 0000000 00000000157 13114114302 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Dsmlv2Grammar.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Dsmlv2Gr0100644 0000767 0000024 00000431173 13114114302 034640 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.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.CodecControl; 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.BinaryValue; import org.apache.directory.api.ldap.model.entry.StringValue; 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.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.ExtendedRequest; import org.apache.directory.api.ldap.model.message.ExtendedRequestImpl; import org.apache.directory.api.ldap.model.message.ExtendedResponse; 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.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.name.Dn; import org.apache.directory.api.ldap.model.name.Rdn; import org.apache.directory.api.util.Base64; 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(); /** Some literal */ private static final String BATCH_REQUEST = "batchRequest"; private static final String ABANDON_REQUEST = "abandonRequest"; private static final String ADD_REQUEST = "addRequest"; private static final String COMPARE_REQUEST = "compareRequest"; private static final String DEL_REQUEST = "delRequest"; private static final String EXTENDED_REQUEST = "extendedRequest"; private static final String MOD_DN_REQUEST = "modDNRequest"; private static final String MODIFY_REQUEST = "modifyRequest"; private static final String SEARCH_REQUEST = "searchRequest"; private static final String CONTROL = "control"; private static final String CONTROL_VALUE = "controlValue"; private static final String ATTR = "attr"; private static final String VALUE = "value"; private static final String MODIFICATION = "modification"; private static final String SUBSTRINGS = "substrings"; private static final String REQUEST_ID = "requestID"; private static final String NAME = "name"; private static final String TRUE = "true"; private static final String FALSE = "false"; /** * 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( 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( 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( 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( 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( 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( 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( 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( "authRequest", 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( "authRequest", 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( 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( 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( 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( 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( 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( "authRequest", 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( 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( 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( 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( 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( 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( 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( "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( "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( 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( "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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( "requestName", 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( "requestName", 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( 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( "requestValue", 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( 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( "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( "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( "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( "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( "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( 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( "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( "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( "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( "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( "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( "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( "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( "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( "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( "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( "not", Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) ); //*** SUBSTRINGS *** // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( 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( 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( "equalityMatch", 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( "equalityMatch", 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( 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( "equalityMatch", 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( "greaterOrEqual", 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( "greaterOrEqual", 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( 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( "greaterOrEqual", 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( "lessOrEqual", 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( "lessOrEqual", 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( 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( "lessOrEqual", 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( "approxMatch", 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( "approxMatch", 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( 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( "approxMatch", 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( "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( "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( "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( "extensibleMatch", 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( "extensibleMatch", 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( 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( "extensibleMatch", 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( "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( "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( 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( 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( "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( "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( "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( 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( "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( "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( "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( 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( "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( 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( "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( "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( "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( "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( 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( "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( "body", Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.GRAMMAR_END, Dsmlv2StatesEnum.GRAMMAR_END, null ) ); super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()].put( new Tag( "envelope", Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.GRAMMAR_END, Dsmlv2StatesEnum.GRAMMAR_END, null ) ); //------------------------------------------ } // End of the constructor /** * @return The LDAP codec service. */ public LdapApiService getLdapCodecService() { return codec; } //************************* //* GRAMMAR ACTIONS * //************************* /** * GrammarAction that creates a Batch Request */ private final GrammarAction batchRequestCreation = new GrammarAction( "Create Batch Request" ) { 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( "", REQUEST_ID ); if ( attributeValue != null ) { batchRequest.setRequestID( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } // processing attributeValue = xpp.getAttributeValue( "", "processing" ); if ( attributeValue != null ) { if ( "sequential".equals( attributeValue ) ) { batchRequest.setProcessing( Processing.SEQUENTIAL ); } else if ( "parallel".equals( attributeValue ) ) { batchRequest.setProcessing( Processing.PARALLEL ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03013 ), xpp, null ); } } else { batchRequest.setProcessing( Processing.SEQUENTIAL ); } // onError attributeValue = xpp.getAttributeValue( "", "onError" ); if ( attributeValue != null ) { if ( "resume".equals( attributeValue ) ) { batchRequest.setOnError( OnError.RESUME ); } else if ( "exit".equals( attributeValue ) ) { batchRequest.setOnError( OnError.EXIT ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03014 ), xpp, null ); } } else { batchRequest.setOnError( OnError.EXIT ); } // responseOrder attributeValue = xpp.getAttributeValue( "", "responseOrder" ); if ( attributeValue != null ) { if ( "sequential".equals( attributeValue ) ) { batchRequest.setResponseOrder( ResponseOrder.SEQUENTIAL ); } else if ( "unordered".equals( attributeValue ) ) { batchRequest.setResponseOrder( ResponseOrder.UNORDERED ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03015 ), xpp, null ); } } else { batchRequest.setResponseOrder( ResponseOrder.SEQUENTIAL ); } } }; /** * GrammarAction that creates an Abandon Request */ private final GrammarAction abandonRequestCreation = new GrammarAction( "Create Abandon Request" ) { 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( "", REQUEST_ID ); if ( attributeValue != null ) { abandonRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null ); } } // abandonID attributeValue = xpp.getAttributeValue( "", "abandonID" ); if ( attributeValue != null ) { try { abandonRequest.setAbandoned( Integer.parseInt( attributeValue ) ); } catch ( NumberFormatException nfe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03017 ), xpp, nfe ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03018 ), xpp, null ); } } }; /** * GrammarAction that creates an Add Request */ private final GrammarAction addRequestCreation = new GrammarAction( "Create Add Request" ) { 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( "", REQUEST_ID ); if ( attributeValue != null ) { addRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( "", "dn" ); if ( attributeValue != null ) { try { addRequest.setEntryDn( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null ); } } }; /** * GrammarAction that adds an attribute to an Add Request */ private final GrammarAction addRequestAddAttribute = new GrammarAction( "Add Attribute to Add Request" ) { 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( "", NAME ); if ( attributeValue != null ) { try { addRequest.addAttributeType( attributeValue ); } catch ( LdapException le ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03020 ), xpp, le ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null ); } } }; /** * GrammarAction that adds a Value to an Attribute of an Add Request */ private final GrammarAction addRequestAddValue = new GrammarAction( "Add Value to Attribute" ) { 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 ( !nextText.equals( "" ) ) { try { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { addRequest.addAttributeValue( Base64.decode( nextText.trim().toCharArray() ) ); } 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, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates an Auth Request */ private final GrammarAction authRequestCreation = new GrammarAction( "Create Auth Request" ) { 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( "", REQUEST_ID ); if ( attributeValue != null ) { authRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null ); } } // principal attributeValue = xpp.getAttributeValue( "", "principal" ); if ( attributeValue != null ) { authRequest.setName( attributeValue ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03021 ), xpp, null ); } } }; /** * GrammarAction that creates an Compare Request */ private final GrammarAction compareRequestCreation = new GrammarAction( "Create Compare Request" ) { 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( "", REQUEST_ID ); if ( attributeValue != null ) { compareRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( "", "dn" ); if ( attributeValue != null ) { try { compareRequest.setName( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null ); } } }; /** * GrammarAction that adds an Assertion to a Compare Request */ private final GrammarAction compareRequestAddAssertion = new GrammarAction( "Add Assertion to Compare Request" ) { 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( "", NAME ); if ( attributeId != null ) { compareRequest.setAttributeId( attributeId ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null ); } } }; /** * GrammarAction that adds a Value to a Compare Request */ private final GrammarAction compareRequestAddValue = new GrammarAction( "Add Value to Compare Request" ) { 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 ( !nextText.equals( "" ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { compareRequest.setAssertionValue( Base64.decode( nextText.trim().toCharArray() ) ); } else { compareRequest.setAssertionValue( nextText.trim() ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates a Del Request */ private final GrammarAction delRequestCreation = new GrammarAction( "Create Del Request" ) { 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( "", REQUEST_ID ); if ( attributeValue != null ) { delRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( "", "dn" ); if ( attributeValue != null ) { try { delRequest.setName( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( "" + lide.getMessage(), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null ); } } }; /** * GrammarAction that creates an Extended Request */ private final GrammarAction extendedRequestCreation = new GrammarAction( "Create Extended Request" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtendedRequestDsml extendedRequest = new ExtendedRequestDsml( codec, new ExtendedRequestImpl() ); container.getBatchRequest().addRequest( extendedRequest ); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // requestID attributeValue = xpp.getAttributeValue( "", REQUEST_ID ); if ( attributeValue != null ) { extendedRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null ); } } } }; /** * GrammarAction that adds a Name to an Extended Request */ private final GrammarAction extendedRequestAddName = new GrammarAction( "Add Name to Extended Request" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) container.getBatchRequest().getCurrentRequest(); XmlPullParser xpp = container.getParser(); try { String nextText = xpp.nextText(); if ( nextText.equals( "" ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03022 ), xpp, null ); } else { String oid = nextText.trim(); if ( Oid.isOid( oid ) ) { extendedRequest.setRequestName( nextText.trim() ); } else { throw new XmlPullParserException( "Bad oid : " + oid, xpp, null ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that adds a Value to an Extended Request */ private final GrammarAction extendedRequestAddValue = new GrammarAction( "Add Value to Extended Request" ) { 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 ( !nextText.equals( "" ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { extendedRequest.setRequestValue( Base64.decode( nextText.trim().toCharArray() ) ); } else { extendedRequest.setRequestValue( Strings.getBytesUtf8( nextText.trim() ) ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates a Modify Dn Request */ private final GrammarAction modDNRequestCreation = new GrammarAction( "Create Modify Dn Request" ) { 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( "", REQUEST_ID ); if ( attributeValue != null ) { modifyDNRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( "", "dn" ); if ( attributeValue != null ) { try { modifyDNRequest.setName( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( "" + lide.getMessage(), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null ); } // newrdn attributeValue = xpp.getAttributeValue( "", "newrdn" ); if ( attributeValue != null ) { try { modifyDNRequest.setNewRdn( new Rdn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( "" + lide.getMessage(), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03023 ), xpp, null ); } // deleteoldrdn attributeValue = xpp.getAttributeValue( "", "deleteoldrdn" ); if ( attributeValue != null ) { if ( ( attributeValue.equalsIgnoreCase( TRUE ) ) || ( attributeValue.equals( "1" ) ) ) { modifyDNRequest.setDeleteOldRdn( true ); } else if ( ( attributeValue.equalsIgnoreCase( FALSE ) ) || ( attributeValue.equals( "0" ) ) ) { modifyDNRequest.setDeleteOldRdn( false ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03024 ), xpp, null ); } } else { modifyDNRequest.setDeleteOldRdn( true ); } // newsuperior attributeValue = xpp.getAttributeValue( "", "newSuperior" ); if ( attributeValue != null ) { try { modifyDNRequest.setNewSuperior( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( "" + lide.getMessage(), xpp, lide ); } } } }; /** * GrammarAction that creates a Modify Request */ private final GrammarAction modifyRequestCreation = new GrammarAction( "Create Modify Request" ) { 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( "", REQUEST_ID ); if ( attributeValue != null ) { modifyRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( "", "dn" ); if ( attributeValue != null ) { try { modifyRequest.setName( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( "" + lide.getLocalizedMessage(), xpp, lide ); } } else { throw new XmlPullParserException( "dn attribute is required", xpp, null ); } } }; /** * GrammarAction that adds a Modification to a Modify Request */ private final GrammarAction modifyRequestAddModification = new GrammarAction( "Adds Modification to Modify Request" ) { 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( "", "operation" ); if ( attributeValue != null ) { if ( "add".equals( attributeValue ) ) { modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_ADD ); } else if ( "delete".equals( attributeValue ) ) { modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_DELETE ); } else if ( "replace".equals( attributeValue ) ) { modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_REPLACE ); } else { throw new XmlPullParserException( "unknown operation. Operation can be 'add', 'delete' or 'replace'.", xpp, null ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03025 ), xpp, null ); } // name attributeValue = xpp.getAttributeValue( "", NAME ); if ( attributeValue != null ) { modifyRequest.addAttributeTypeAndValues( attributeValue ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), 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" ) { 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( Base64.decode( nextText.trim().toCharArray() ) ); } 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, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates a Search Request */ private final GrammarAction searchRequestCreation = new GrammarAction( "Create Search Request" ) { 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( "", REQUEST_ID ); if ( attributeValue != null ) { searchRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { if ( ParserUtils.isRequestIdNeeded( container ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null ); } } // dn attributeValue = xpp.getAttributeValue( "", "dn" ); if ( attributeValue != null ) { try { searchRequest.setBase( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null ); } // scope attributeValue = xpp.getAttributeValue( "", "scope" ); if ( attributeValue != null ) { if ( "baseObject".equals( attributeValue ) ) { searchRequest.setScope( SearchScope.OBJECT ); } else if ( "singleLevel".equals( attributeValue ) ) { searchRequest.setScope( SearchScope.ONELEVEL ); } else if ( "wholeSubtree".equals( attributeValue ) ) { searchRequest.setScope( SearchScope.SUBTREE ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03026 ), xpp, null ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03027 ), xpp, null ); } // derefAliases attributeValue = xpp.getAttributeValue( "", "derefAliases" ); if ( attributeValue != null ) { if ( "neverDerefAliases".equals( attributeValue ) ) { searchRequest.setDerefAliases( AliasDerefMode.NEVER_DEREF_ALIASES ); } else if ( "derefInSearching".equals( attributeValue ) ) { searchRequest.setDerefAliases( AliasDerefMode.DEREF_IN_SEARCHING ); } else if ( "derefFindingBaseObj".equals( attributeValue ) ) { searchRequest.setDerefAliases( AliasDerefMode.DEREF_FINDING_BASE_OBJ ); } else if ( "derefAlways".equals( attributeValue ) ) { searchRequest.setDerefAliases( AliasDerefMode.DEREF_ALWAYS ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03028 ), xpp, null ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03029 ), xpp, null ); } // sizeLimit attributeValue = xpp.getAttributeValue( "", "sizeLimit" ); if ( attributeValue != null ) { try { searchRequest.setSizeLimit( Long.parseLong( attributeValue ) ); } catch ( NumberFormatException nfe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03030 ), xpp, nfe ); } } else { searchRequest.setSizeLimit( 0L ); } // timeLimit attributeValue = xpp.getAttributeValue( "", "timeLimit" ); if ( attributeValue != null ) { try { searchRequest.setTimeLimit( Integer.parseInt( attributeValue ) ); } catch ( NumberFormatException nfe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03031 ), xpp, nfe ); } } else { searchRequest.setTimeLimit( 0 ); } // typesOnly attributeValue = xpp.getAttributeValue( "", "typesOnly" ); if ( attributeValue != null ) { if ( ( attributeValue.equals( TRUE ) ) || ( attributeValue.equals( "1" ) ) ) { searchRequest.setTypesOnly( true ); } else if ( ( attributeValue.equals( FALSE ) ) || ( attributeValue.equals( "0" ) ) ) { searchRequest.setTypesOnly( false ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03032 ), 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" ) { 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( "", NAME ); if ( attributeName != null ) { searchRequest.addAttributes( attributeName ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null ); } } }; /** * GrammarAction that create a Substring Filter */ private final GrammarAction substringsFilterCreation = new GrammarAction( "Create Substring Filter" ) { 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( "", NAME ); if ( attributeValue != null ) { filter.setType( attributeValue ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null ); } } }; /** * GrammarAction that sets the Initial value to a Substring Filter */ private final GrammarAction substringsFilterSetInitial = new GrammarAction( "Set Initial value to Substring Filter" ) { 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 ( !nextText.equals( "" ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { substringFilter .setInitialSubstrings( Strings.utf8ToString( Base64.decode( nextText.trim().toCharArray() ) ) ); } else { substringFilter.setInitialSubstrings( nextText.trim() ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, 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" ) { 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 ( !nextText.equals( "" ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { substringFilter.addAnySubstrings( Strings.utf8ToString( Base64.decode( nextText.trim().toCharArray() ) ) ); } else { substringFilter.addAnySubstrings( nextText.trim() ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, 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" ) { 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 ( !nextText.equals( "" ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { substringFilter .setFinalSubstrings( Strings.utf8ToString( Base64.decode( nextText.trim().toCharArray() ) ) ); } else { substringFilter.setFinalSubstrings( nextText.trim() ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that closes a Substring Filter */ private final GrammarAction substringsFilterClose = new GrammarAction( "Close Substring Filter" ) { 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" ) { 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" ) { 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" ) { 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" ) { 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" ) { 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( "", NAME ); if ( attributeName != null ) { assertion.setAttributeDesc( attributeName ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), 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" ) { 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( "", NAME ); if ( attributeName != null ) { assertion.setAttributeDesc( attributeName ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), 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" ) { 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( "", NAME ); if ( attributeValue != null ) { assertion.setAttributeDesc( attributeValue ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), 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" ) { 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( "", NAME ); if ( attributeName != null ) { assertion.setAttributeDesc( attributeName ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), 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" ) { 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 ( !nextText.equals( "" ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { Value value = new BinaryValue( Base64.decode( nextText.trim().toCharArray() ) ); assertion.setAssertionValue( value ); } else { Value value = new StringValue( nextText.trim() ); assertion.setAssertionValue( value ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates a Present Filter */ private final GrammarAction presentFilterCreation = new GrammarAction( "Create Present Filter" ) { 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( "", NAME ); if ( attributeValue != null ) { presentFilter.setAttributeDescription( attributeValue ); } else { throw new XmlPullParserException( "name attribute is required", xpp, null ); } } }; /** * GrammarAction that store the Filter into the searchRequest */ private final GrammarAction storeFilter = new GrammarAction( "Store Filter" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { // Adding the filter to the Search Filter SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) container.getBatchRequest().getCurrentRequest(); SearchRequest searchRequest = searchRequestDecorator.getDecorated(); if ( searchRequestDecorator.getFilterNode() == null ) { throw new IllegalStateException( "No filter element present in the DSML search request" ); } searchRequest.setFilter( searchRequestDecorator.getFilterNode() ); } }; /** * GrammarAction that creates an Extensible Match Filter */ private final GrammarAction extensibleMatchFilterCreation = new GrammarAction( "Create Extensible Match Filter" ) { 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_03012 ), xpp, de ); } searchRequestDecorator.setTerminalFilter( extensibleMatchFilter ); // Checking and adding the filter's attributes String attributeValue; // dnAttributes attributeValue = xpp.getAttributeValue( "", "dnAttributes" ); if ( attributeValue != null ) { if ( ( attributeValue.equals( TRUE ) ) || ( attributeValue.equals( "1" ) ) ) { extensibleMatchFilter.setDnAttributes( true ); } else if ( ( attributeValue.equals( FALSE ) ) || ( attributeValue.equals( "0" ) ) ) { extensibleMatchFilter.setDnAttributes( false ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03033 ), xpp, null ); } } else { extensibleMatchFilter.setDnAttributes( false ); } // matchingRule attributeValue = xpp.getAttributeValue( "", "matchingRule" ); if ( attributeValue != null ) { extensibleMatchFilter.setMatchingRule( attributeValue ); } // name attributeValue = xpp.getAttributeValue( "", 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" ) { 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 ( !nextText.equals( "" ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { filter.setMatchValue( new BinaryValue( Base64.decode( nextText.trim().toCharArray() ) ) ); } else { filter.setMatchValue( new StringValue( nextText.trim() ) ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates a Control */ private final GrammarAction controlCreation = new GrammarAction( "Create Control" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { XmlPullParser xpp = container.getParser(); CodecControl control; // Checking and adding the Control's attributes String attributeValue; // TYPE attributeValue = xpp.getAttributeValue( "", "type" ); if ( attributeValue != null ) { if ( !Oid.isOid( attributeValue ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03034 ), xpp, null ); } control = codec.newControl( codec.newControl( attributeValue ) ); ( ( Request ) container.getBatchRequest().getCurrentRequest() ).addControl( control ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03035 ), xpp, null ); } // CRITICALITY attributeValue = xpp.getAttributeValue( "", "criticality" ); if ( attributeValue != null ) { if ( attributeValue.equals( TRUE ) ) { control.setCritical( true ); } else if ( attributeValue.equals( FALSE ) ) { control.setCritical( false ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03007 ), xpp, null ); } } } }; /** * GrammarAction that adds a Value to a Control */ private final GrammarAction controlValueCreation = new GrammarAction( "Add ControlValue to Control" ) { 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 ( !nextText.equals( "" ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { control.setValue( Base64.decode( nextText.trim().toCharArray() ) ); } else { control.setValue( Strings.getBytesUtf8( nextText.trim() ) ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, ioe.getMessage() ), xpp, ioe ); } } }; } ././@LongLink0100644 0000000 0000000 00000000165 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/ExtendedRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Extended0100644 0000767 0000024 00000011764 13114114301 034737 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; import org.apache.directory.api.asn1.util.Oid; 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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); // Request Name if ( getDecorated().getRequestName() != null ) { element.addElement( "requestName" ).setText( getDecorated().getRequestName() ); } // Request Value Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI ); element.getDocument().getRootElement().add( xsdNamespace ); element.getDocument().getRootElement().add( xsiNamespace ); Element valueElement = element.addElement( "requestValue" ).addText( ParserUtils.base64Encode( getRequestValue() ) ); valueElement.addAttribute( new QName( "type", xsiNamespace ), "xsd:" + ParserUtils.BASE64BINARY ); return element; } /** * Get the extended request name * * @return Returns the request name. */ 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} */ public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ public ExtendedRequest setRequestName( String oid ) { getDecorated().setRequestName( oid ); return this; } /** * {@inheritDoc} */ public ExtendedRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ public ExtendedRequest addControl( Control control ) { return ( ExtendedRequest ) super.addControl( control ); } /** * {@inheritDoc} */ public ExtendedRequest addAllControls( Control[] controls ) { return ( ExtendedRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ public ExtendedRequest removeControl( Control control ) { return ( ExtendedRequest ) super.removeControl( control ); } } ././@LongLink0100644 0000000 0000000 00000000167 13114114302 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/ExtensibleMatchFilter.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Extensib0100644 0000767 0000024 00000007072 13114114302 034756 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; /** * 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; /** * 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 org.apache.directory.api.ldap.model.entry.Value getMatchValue() { return matchValue; } /** * Set the matchValue * * @param matchValue The matchValue to set. */ public void setMatchValue( org.apache.directory.api.ldap.model.entry.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 */ public String toString() { StringBuffer sb = new StringBuffer(); 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(); } } ././@LongLink0100644 0000000 0000000 00000000150 13114114302 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Filter.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Filter.j0100644 0000767 0000024 00000003020 13114114302 034637 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; /** * 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; } } ././@LongLink0100644 0000000 0000000 00000000165 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/ModifyDNRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/ModifyDN0100644 0000767 0000024 00000014636 13114114301 034651 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; 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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); ModifyDnRequest request = getDecorated(); // Dn if ( request.getName() != null ) { element.addAttribute( "dn", request.getName().getName() ); } // NewRDN if ( request.getNewRdn() != null ) { element.addAttribute( "newrdn", request.getNewRdn().getName() ); } // DeleteOldRDN element.addAttribute( "deleteoldrdn", ( request.getDeleteOldRdn() ? "true" : "false" ) ); // NewSuperior if ( request.getNewRdn() != null ) { element.addAttribute( "newSuperior", request.getNewSuperior().getName() ); } return element; } /** * Get the modification's Dn * * @return Returns the name. */ 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(); } /** * Set the flag to delete the old Rdn * * @param deleteOldRDN The deleteOldRDN to set. */ public void setDeleteOldRDN( boolean deleteOldRDN ) { getDecorated().setDeleteOldRdn( deleteOldRDN ); } /** * Get the new Rdn * * @return Returns the newRDN. */ public Rdn getNewRDN() { return getDecorated().getNewRdn(); } /** * Set the new Rdn * * @param newRdn The newRdn to set. */ public void setNewRDN( Rdn newRdn ) { getDecorated().setNewRdn( newRdn ); } /** * Get the newSuperior * * @return Returns the newSuperior. */ public Dn getNewSuperior() { return getDecorated().getNewSuperior(); } /** * Set the new superior * * @param newSuperior The newSuperior to set. */ public ModifyDnRequest setNewSuperior( Dn newSuperior ) { getDecorated().setNewSuperior( newSuperior ); return this; } /** * {@inheritDoc} */ public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ public ModifyDnRequest setName( Dn name ) { getDecorated().setName( name ); return this; } /** * {@inheritDoc} */ public Rdn getNewRdn() { return getDecorated().getNewRdn(); } /** * {@inheritDoc} */ public ModifyDnRequest setNewRdn( Rdn newRdn ) { getDecorated().setNewRdn( newRdn ); return this; } /** * {@inheritDoc} */ public boolean getDeleteOldRdn() { return getDecorated().getDeleteOldRdn(); } /** * {@inheritDoc} */ public ModifyDnRequest setDeleteOldRdn( boolean deleteOldRdn ) { getDecorated().setDeleteOldRdn( deleteOldRdn ); return this; } /** * {@inheritDoc} */ public boolean isMove() { return getDecorated().isMove(); } /** * {@inheritDoc} */ public ModifyDnRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ public ModifyDnRequest addControl( Control control ) { return ( ModifyDnRequest ) super.addControl( control ); } /** * {@inheritDoc} */ public ModifyDnRequest addAllControls( Control[] controls ) { return ( ModifyDnRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ public ModifyDnRequest removeControl( Control control ) { return ( ModifyDnRequest ) super.removeControl( control ); } } ././@LongLink0100644 0000000 0000000 00000000163 13114114301 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/ModifyRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/ModifyRe0100644 0000767 0000024 00000025621 13114114301 034712 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; import java.util.Collection; 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 ); } /** * @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} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); ModifyRequest request = getDecorated(); // Dn if ( request.getName() != null ) { element.addAttribute( "dn", request.getName().getName() ); } // Modifications Collection modifications = request.getModifications(); for ( Modification modification : modifications ) { Element modElement = element.addElement( "modification" ); if ( modification.getAttribute() != null ) { modElement.addAttribute( "name", modification.getAttribute().getId() ); for ( Value value : modification.getAttribute() ) { if ( value.getValue() != null ) { if ( ParserUtils.needsBase64Encoding( value.getValue() ) ) { Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI ); element.getDocument().getRootElement().add( xsdNamespace ); element.getDocument().getRootElement().add( xsiNamespace ); Element valueElement = modElement.addElement( "value" ).addText( ParserUtils.base64Encode( value.getValue() ) ); valueElement.addAttribute( new QName( "type", xsiNamespace ), "xsd:" + ParserUtils.BASE64BINARY ); } else { modElement.addElement( "value" ).setText( value.getString() ); } } } } ModificationOperation operation = modification.getOperation(); if ( operation == ModificationOperation.ADD_ATTRIBUTE ) { modElement.addAttribute( "operation", "add" ); } else if ( operation == ModificationOperation.REPLACE_ATTRIBUTE ) { modElement.addAttribute( "operation", "replace" ); } else if ( operation == ModificationOperation.REMOVE_ATTRIBUTE ) { modElement.addAttribute( "operation", "delete" ); } } return element; } //------------------------------------------------------------------------- // The ModifyRequest methods //------------------------------------------------------------------------- /** * {@inheritDoc} */ public MessageTypeEnum getResponseType() { return getDecorated().getResponseType(); } /** * {@inheritDoc} */ public Dn getName() { return getDecorated().getName(); } /** * {@inheritDoc} */ public ModifyRequest setName( Dn name ) { getDecorated().setName( name ); return this; } /** * {@inheritDoc} */ public Collection getModifications() { return getDecorated().getModifications(); } /** * {@inheritDoc} */ public ModifyRequest addModification( Modification mod ) { getDecorated().addModification( mod ); return this; } /** * {@inheritDoc} */ public ModifyRequest removeModification( Modification mod ) { getDecorated().removeModification( mod ); return this; } /** * {@inheritDoc} */ 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} */ public ModifyRequest remove( Attribute attr ) { getDecorated().remove( attr ); return this; } /** * {@inheritDoc} */ public ModifyRequest remove( String attributeName ) { getDecorated().remove( attributeName ); return this; } /** * {@inheritDoc} */ public ModifyRequest addModification( Attribute attr, ModificationOperation modOp ) { getDecorated().addModification( attr, modOp ); return this; } /** * {@inheritDoc} */ 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} */ public ModifyRequest add( Attribute attr ) { getDecorated().add( attr ); return this; } /** * {@inheritDoc} */ public ModifyRequest replace( String attributeName ) { getDecorated().replace( attributeName ); return this; } /** * {@inheritDoc} */ 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} */ public ModifyRequest replace( Attribute attr ) { getDecorated().replace( attr ); return this; } /** * {@inheritDoc} */ public ModifyRequest setMessageId( int messageId ) { super.setMessageId( messageId ); return this; } /** * {@inheritDoc} */ public ModifyRequest addControl( Control control ) { return ( ModifyRequest ) super.addControl( control ); } /** * {@inheritDoc} */ public ModifyRequest addAllControls( Control[] controls ) { return ( ModifyRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ public ModifyRequest removeControl( Control control ) { return ( ModifyRequest ) super.removeControl( control ); } } ././@LongLink0100644 0000000 0000000 00000000153 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/NotFilter.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/NotFilte0100644 0000767 0000024 00000004652 13114114302 034722 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 { /** * Subclass the addFilterMethod, as this is specific for a NotFilter (we * cannot have more than one elements). * * @param filter The Filter to add */ public void addFilter( Filter filter ) throws DecoderException { if ( filterSet != null ) { throw new DecoderException( I18n.err( I18n.ERR_04057 ) ); } 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_04057 ) ); } super.addFilter( notFilter ); } /** * Return a string compliant with RFC 2254 representing a NOT filter * * @return The NOT filter string */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append( '!' ).append( super.toString() ); return sb.toString(); } } ././@LongLink0100644 0000000 0000000 00000000152 13114114302 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/OrFilter.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/OrFilter0100644 0000767 0000024 00000003035 13114114302 034716 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 { /** * 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 */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append( '|' ).append( super.toString() ); return sb.toString(); } } ././@LongLink0100644 0000000 0000000 00000000157 13114114302 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/PresentFilter.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/PresentF0100644 0000767 0000024 00000003647 13114114302 034727 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; /** * 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 */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append( attributeDescription ).append( "=*" ); return sb.toString(); } } ././@LongLink0100644 0000000 0000000 00000000163 13114114302 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/SearchRequestDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/SearchRe0100644 0000767 0000024 00000060600 13114114302 034665 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.request; import java.util.ArrayList; import java.util.List; import org.apache.directory.api.asn1.DecoderException; import org.apache.directory.api.dsmlv2.ParserUtils; 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.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.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 { /** Some string constants */ private static final String DEREF_ALIASES = "derefAliases"; private static final String NAME = "name"; private static final String VALUE = "value"; /** 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; /** * 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. */ public ExprNode getFilterNode() { 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 ) { // 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; } } /** * Transform the Filter part of a SearchRequest to an ExprNode * * @param filter The filter to be transformed * @return An ExprNode */ @SuppressWarnings( { "unchecked", "rawtypes" }) private ExprNode transform( Filter filter ) { if ( filter != null ) { // Transform OR, AND or NOT leaves if ( filter instanceof ConnectorFilter ) { BranchNode branch = null; if ( filter instanceof AndFilter ) { branch = new AndNode(); } else if ( filter instanceof OrFilter ) { branch = new OrNode(); } else if ( filter instanceof NotFilter ) { 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(); switch ( filterType ) { case LdapCodecConstants.EQUALITY_MATCH_FILTER: branch = new EqualityNode( ava.getAttributeDesc(), ava.getAssertionValue() ); break; case LdapCodecConstants.GREATER_OR_EQUAL_FILTER: branch = new GreaterEqNode( ava.getAttributeDesc(), ava.getAssertionValue() ); break; case LdapCodecConstants.LESS_OR_EQUAL_FILTER: branch = new LessEqNode( ava.getAttributeDesc(), ava.getAssertionValue() ); break; case LdapCodecConstants.APPROX_MATCH_FILTER: branch = new ApproximateNode( ava.getAttributeDesc(), ava.getAssertionValue() ); break; default: throw new IllegalStateException( "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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); SearchRequest request = getDecorated(); // Dn if ( request.getBase() != null ) { element.addAttribute( "dn", request.getBase().getName() ); } // Scope SearchScope scope = request.getScope(); if ( scope != null ) { if ( scope == SearchScope.OBJECT ) { element.addAttribute( "scope", "baseObject" ); } else if ( scope == SearchScope.ONELEVEL ) { element.addAttribute( "scope", "singleLevel" ); } else if ( scope == SearchScope.SUBTREE ) { element.addAttribute( "scope", "wholeSubtree" ); } } // DerefAliases AliasDerefMode derefAliases = request.getDerefAliases(); switch ( derefAliases ) { case NEVER_DEREF_ALIASES: element.addAttribute( DEREF_ALIASES, "neverDerefAliases" ); break; case DEREF_ALWAYS: element.addAttribute( DEREF_ALIASES, "derefAlways" ); break; case DEREF_FINDING_BASE_OBJ: element.addAttribute( DEREF_ALIASES, "derefFindingBaseObj" ); break; case DEREF_IN_SEARCHING: element.addAttribute( DEREF_ALIASES, "derefInSearching" ); break; default: throw new IllegalStateException( "Unexpected deref alias mode " + derefAliases ); } // SizeLimit if ( request.getSizeLimit() != 0L ) { element.addAttribute( "sizeLimit", "" + request.getSizeLimit() ); } // TimeLimit if ( request.getTimeLimit() != 0 ) { element.addAttribute( "timeLimit", "" + request.getTimeLimit() ); } // TypesOnly if ( request.getTypesOnly() ) { element.addAttribute( "typesOnly", "true" ); } // Filter Element filterElement = element.addElement( "filter" ); toDsml( filterElement, request.getFilter() ); // Attributes List attributes = request.getAttributes(); if ( attributes.size() > 0 ) { Element attributesElement = element.addElement( "attributes" ); for ( String entryAttribute : attributes ) { attributesElement.addElement( "attribute" ).addAttribute( 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( "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( "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( "not" ); toDsml( newElement, ( ( NotNode ) filter ).getFirstChild() ); } // SUBSTRING FILTER else if ( filter instanceof SubstringNode ) { Element newElement = element.addElement( "substrings" ); SubstringNode substringFilter = ( SubstringNode ) filter; newElement.addAttribute( NAME, substringFilter.getAttribute() ); String initial = substringFilter.getInitial(); if ( ( initial != null ) && ( !"".equals( initial ) ) ) { newElement.addElement( "initial" ).setText( initial ); } List anyList = substringFilter.getAny(); for ( int i = 0; i < anyList.size(); i++ ) { newElement.addElement( "any" ).setText( anyList.get( i ) ); } String finalString = substringFilter.getFinal(); if ( ( finalString != null ) && ( !"".equals( finalString ) ) ) { newElement.addElement( "final" ).setText( finalString ); } } // APPROXMATCH, EQUALITYMATCH, GREATEROREQUALS & LESSOREQUAL FILTERS else if ( filter instanceof SimpleNode ) { Element newElement = null; if ( filter instanceof ApproximateNode ) { newElement = element.addElement( "approxMatch" ); } else if ( filter instanceof EqualityNode ) { newElement = element.addElement( "equalityMatch" ); } else if ( filter instanceof GreaterEqNode ) { newElement = element.addElement( "greaterOrEqual" ); } else // it is a LessEqNode ) { newElement = element.addElement( "lessOrEqual" ); } String attributeName = ( ( SimpleNode ) filter ).getAttribute(); newElement.addAttribute( NAME, attributeName ); Value value = ( ( SimpleNode ) filter ).getValue(); if ( value != null ) { if ( ParserUtils.needsBase64Encoding( value ) ) { Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI ); element.getDocument().getRootElement().add( xsdNamespace ); element.getDocument().getRootElement().add( xsiNamespace ); Element valueElement = newElement.addElement( VALUE ).addText( ParserUtils.base64Encode( value ) ); valueElement .addAttribute( new QName( "type", xsiNamespace ), "xsd:" + ParserUtils.BASE64BINARY ); } else { newElement.addElement( VALUE ).setText( value.getString() ); } } } // PRESENT FILTER else if ( filter instanceof PresenceNode ) { Element newElement = element.addElement( "present" ); newElement.addAttribute( NAME, ( ( PresenceNode ) filter ).getAttribute() ); } // EXTENSIBLEMATCH else if ( filter instanceof ExtensibleNode ) { Element newElement = element.addElement( "extensibleMatch" ); Value value = ( ( ExtensibleNode ) filter ).getValue(); if ( value != null ) { if ( ParserUtils.needsBase64Encoding( value ) ) { Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI ); Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI ); element.getDocument().getRootElement().add( xsdNamespace ); element.getDocument().getRootElement().add( xsiNamespace ); Element valueElement = newElement.addElement( VALUE ).addText( ParserUtils.base64Encode( value.getValue() ) ); valueElement.addAttribute( new QName( "type", xsiNamespace ), "xsd:" + ParserUtils.BASE64BINARY ); } else { newElement.addElement( VALUE ).setText( value.getString() ); } } if ( ( ( ExtensibleNode ) filter ).hasDnAttributes() ) { newElement.addAttribute( "dnAttributes", "true" ); } String matchingRule = ( ( ExtensibleNode ) filter ).getMatchingRuleId(); if ( ( matchingRule != null ) && ( "".equals( matchingRule ) ) ) { newElement.addAttribute( "matchingRule", matchingRule ); } } } /** * {@inheritDoc} */ public MessageTypeEnum[] getResponseTypes() { return getDecorated().getResponseTypes(); } /** * {@inheritDoc} */ public Dn getBase() { return getDecorated().getBase(); } /** * {@inheritDoc} */ public SearchRequest setBase( Dn baseDn ) { getDecorated().setBase( baseDn ); return this; } /** * {@inheritDoc} */ public SearchScope getScope() { return getDecorated().getScope(); } /** * {@inheritDoc} */ public SearchRequest setScope( SearchScope scope ) { getDecorated().setScope( scope ); return this; } /** * {@inheritDoc} */ public AliasDerefMode getDerefAliases() { return getDecorated().getDerefAliases(); } /** * {@inheritDoc} */ public SearchRequest setDerefAliases( AliasDerefMode aliasDerefAliases ) { getDecorated().setDerefAliases( aliasDerefAliases ); return this; } /** * {@inheritDoc} */ public long getSizeLimit() { return getDecorated().getSizeLimit(); } /** * {@inheritDoc} */ public SearchRequest setSizeLimit( long entriesMax ) { getDecorated().setSizeLimit( entriesMax ); return this; } /** * {@inheritDoc} */ public int getTimeLimit() { return getDecorated().getTimeLimit(); } /** * {@inheritDoc} */ public SearchRequest setTimeLimit( int secondsMax ) { getDecorated().setTimeLimit( secondsMax ); return this; } /** * {@inheritDoc} */ public boolean getTypesOnly() { return getDecorated().getTypesOnly(); } /** * {@inheritDoc} */ public SearchRequest setTypesOnly( boolean typesOnly ) { getDecorated().setTypesOnly( typesOnly ); return this; } /** * {@inheritDoc} */ public ExprNode getFilter() { return getDecorated().getFilter(); } /** * {@inheritDoc} */ public SearchRequest setFilter( ExprNode filter ) { getDecorated().setFilter( filter ); return this; } /** * {@inheritDoc} */ public SearchRequest setFilter( String filter ) throws LdapException { getDecorated().setFilter( filter ); return this; } /** * {@inheritDoc} */ public List getAttributes() { return getDecorated().getAttributes(); } /** * {@inheritDoc} */ public SearchRequest addAttributes( String... attributes ) { getDecorated().addAttributes( attributes ); return this; } /** * {@inheritDoc} */ public SearchRequest removeAttribute( String attribute ) { getDecorated().removeAttribute( attribute ); return this; } /** * {@inheritDoc} */ public SearchRequest setMessageId( int messageId ) { return ( SearchRequest ) super.setMessageId( messageId ); } /** * {@inheritDoc} */ public SearchRequest addControl( Control control ) { return ( SearchRequest ) super.addControl( control ); } /** * {@inheritDoc} */ public SearchRequest addAllControls( Control[] controls ) { return ( SearchRequest ) super.addAllControls( controls ); } /** * {@inheritDoc} */ public SearchRequest removeControl( Control control ) { return ( SearchRequest ) super.removeControl( control ); } /** * {@inheritDoc} */ public boolean isFollowReferrals() { return getDecorated().isFollowReferrals(); } /** * {@inheritDoc} */ public SearchRequest followReferrals() { return getDecorated().followReferrals(); } /** * {@inheritDoc} */ public boolean isIgnoreReferrals() { return getDecorated().isIgnoreReferrals(); } /** * {@inheritDoc} */ public SearchRequest ignoreReferrals() { return getDecorated().ignoreReferrals(); } } ././@LongLink0100644 0000000 0000000 00000000161 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/SubstringFilter.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/request/Substrin0100644 0000767 0000024 00000007667 13114114301 035017 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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; /** * 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 */ public String toString() { StringBuffer sb = new StringBuffer(); 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(); } } ././@LongLink0100644 0000000 0000000 00000000167 13114114301 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/AbstractResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/Abstrac0100644 0000767 0000024 00000003207 13114114301 034715 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); } } ././@LongLink0100644 0000000 0000000 00000000175 13114114301 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/AbstractResultResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/Abstrac0100644 0000767 0000024 00000003456 13114114301 034723 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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} */ public LdapResult getLdapResult() { return getDecorated().getLdapResult(); } } ././@LongLink0100644 0000000 0000000 00000000162 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/AddResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/AddResp0100644 0000767 0000024 00000005251 13114114301 034661 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; 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 { private static final String ADD_RESPONSE_TAG = "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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( ADD_RESPONSE_TAG ); } else { element = new DefaultElement( ADD_RESPONSE_TAG ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } } ././@LongLink0100644 0000000 0000000 00000000164 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/BatchResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/BatchRe0100644 0000767 0000024 00000010736 13114114301 034653 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.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( "batchResponse" ); element.add( ParserUtils.DSML_NAMESPACE ); element.add( ParserUtils.XSD_NAMESPACE ); element.add( ParserUtils.XSI_NAMESPACE ); // RequestID if ( requestID != 0 ) { element.addAttribute( "requestID", Integer.toString( requestID ) ); } for ( DsmlDecorator response : responses ) { response.toDsml( element ); } if ( prettyPrint ) { document = ParserUtils.styleDocument( document ); } return document.asXML(); } } ././@LongLink0100644 0000000 0000000 00000000163 13114114301 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/BindResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/BindRes0100644 0000767 0000024 00000005020 13114114301 034657 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; 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; /** * 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} */ public Element toDsml( Element root ) { Element element = root.addElement( "authResponse" ); LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } /** * {@inheritDoc} */ public byte[] getServerSaslCreds() { return getDecorated().getServerSaslCreds(); } /** * {@inheritDoc} */ public void setServerSaslCreds( byte[] serverSaslCreds ) { getDecorated().setServerSaslCreds( serverSaslCreds ); } } ././@LongLink0100644 0000000 0000000 00000000166 13114114301 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/CompareResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/Compare0100644 0000767 0000024 00000005535 13114114301 034732 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; 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 { private static final String COMPARE_RESPONSE_TAG = "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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( COMPARE_RESPONSE_TAG ); } else { element = new DefaultElement( COMPARE_RESPONSE_TAG ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } /** * {@inheritDoc} */ public boolean isTrue() { return getDecorated().isTrue(); } } ././@LongLink0100644 0000000 0000000 00000000162 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/DelResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/DelResp0100644 0000767 0000024 00000005274 13114114301 034702 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; 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 { private static final String DEL_RESPONSE_TAG = "delResponse"; /** * 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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( DEL_RESPONSE_TAG ); } else { element = new DefaultElement( DEL_RESPONSE_TAG ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } } ././@LongLink0100644 0000000 0000000 00000000170 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/Dsmlv2ResponseGrammar.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/Dsmlv2R0100644 0000767 0000024 00000277140 13114114301 034640 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.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.CodecControl; 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.ExtendedResponseImpl; 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.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.Base64; 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" ); } @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( "batchResponse", 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( "addResponse", 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( "authResponse", 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( "compareResponse", 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( "delResponse", 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( "modifyResponse", 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( "modDNResponse", 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( "extendedResponse", 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( "errorResponse", 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( "searchResponse", 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( "batchResponse", 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( "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( "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( "errorResponse", 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( "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( "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( "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( "errorResponse", 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( "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( "controlValue", 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( "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( "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( "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( "resultCode", 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( "resultCode", 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( "resultCode", 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( "errorMessage", 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( "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( "responseName", 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( "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( "extendedResponse", 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( "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( "responseName", 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( "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( "extendedResponse", 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( "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( "responseName", 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( "reponse", 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( "extendedResponse", 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( "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( "extendedResponse", 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( "extendedResponse", 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( "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( "resultCode", 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( "controlValue", 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( "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( "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( "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( "resultCode", 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( "resultCode", 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( "errorMessage", 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( "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( "addResponse", 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( "authResponse", 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( "compareResponse", 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( "delResponse", 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( "modifyResponse", 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( "modDNResponse", 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( "searchResultDone", 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( "searchResponse", 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( "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( "addResponse", 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( "authResponse", 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( "compareResponse", 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( "delResponse", 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( "modifyResponse", 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( "modDNResponse", 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( "searchResultDone", 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( "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( "addResponse", 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( "authResponse", 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( "compareResponse", 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( "delResponse", 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( "modifyResponse", 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( "modDNResponse", 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( "searchResultDone", 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( "searchResultEntry", 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( "searchResultReference", 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( "searchResultDone", 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( "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( "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( "searchResultEntry", 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( "controlValue", 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( "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( "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( "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( "searchResultEntry", 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( "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( "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( "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( "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( "searchResultEntry", 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( "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( "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( "searchResultEntry", 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( "searchResultReference", 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( "searchResultDone", 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( "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( "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( "controlValue", 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( "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( "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( "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( "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( "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( "searchResultReference", 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( "searchResultReference", 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( "searchResultDone", 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( "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( "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( "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( "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( "batchResponse", 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( "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( "body", Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.GRAMMAR_END, Dsmlv2StatesEnum.GRAMMAR_END, null ) ); super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()].put( new Tag( "envelope", Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.GRAMMAR_END, Dsmlv2StatesEnum.GRAMMAR_END, null ) ); //------------------------------------------ } /** * GrammarAction that creates the Batch Response */ private final GrammarAction batchResponseCreation = new GrammarAction( "Create Batch Response" ) { 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( "", "requestID" ); if ( attributeValue != null ) { batchResponse.setRequestID( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } } }; /** * GrammarAction that creates the Add Response */ private final GrammarAction addResponseCreation = new GrammarAction( "Create Add Response" ) { 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( "", "requestID" ); if ( attributeValue != null ) { addResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } // MatchedDN attributeValue = xpp.getAttributeValue( "", "matchedDN" ); 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" ) { 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( "", "requestID" ); if ( attributeValue != null ) { bindResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } // MatchedDN attributeValue = xpp.getAttributeValue( "", "matchedDN" ); 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" ) { 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( "", "requestID" ); if ( attributeValue != null ) { compareResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } // MatchedDN attributeValue = xpp.getAttributeValue( "", "matchedDN" ); 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" ) { 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( "", "requestID" ); if ( attributeValue != null ) { delResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } // MatchedDN attributeValue = xpp.getAttributeValue( "", "matchedDN" ); 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" ) { 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( "", "requestID" ); if ( attributeValue != null ) { modifyResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } // MatchedDN attributeValue = xpp.getAttributeValue( "", "matchedDN" ); 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" ) { 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( "", "requestID" ); if ( attributeValue != null ) { modDNResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } // MatchedDN attributeValue = xpp.getAttributeValue( "", "matchedDN" ); 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" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtendedResponseDsml extendedResponse = null; // Checking and adding the batchRequest's attributes String attributeValue; XmlPullParser xpp = container.getParser(); // requestID attributeValue = xpp.getAttributeValue( "", "requestID" ); if ( attributeValue != null ) { extendedResponse = new ExtendedResponseDsml( container.getLdapCodecService(), new ExtendedResponseImpl( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ) ); } else { extendedResponse = new ExtendedResponseDsml( container.getLdapCodecService(), new ExtendedResponseImpl( -1 ) ); } container.getBatchResponse().addResponse( extendedResponse ); LdapResult ldapResult = extendedResponse.getLdapResult(); // MatchedDN attributeValue = xpp.getAttributeValue( "", "matchedDN" ); 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" ) { 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( "", "requestID" ); if ( attributeValue != null ) { errorResponse = new ErrorResponse( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ), null ); container.getBatchResponse().addResponse( errorResponse ); } // type attributeValue = xpp.getAttributeValue( "", "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 ), xpp, null ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03005 ), xpp, null ); } } }; /** * GrammarAction that adds Message to an Error Response */ private final GrammarAction errorResponseAddMessage = new GrammarAction( "Add Message to Error Response" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { ErrorResponse errorResponse = ( ErrorResponse ) container.getBatchResponse().getCurrentResponse(); XmlPullParser xpp = container.getParser(); try { String nextText = xpp.nextText(); if ( !nextText.equals( "" ) ) { 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; /** * Creates a Control parsing the current node and adds it to the given parent * @param container the DSMLv2Container * @param parent the parent * @throws XmlPullParserException */ private void createAndAddControl( Dsmlv2Container container, AbstractDsmlMessageDecorator parent ) throws XmlPullParserException { CodecControl control = null; XmlPullParser xpp = container.getParser(); // Checking and adding the Control's attributes String attributeValue; // TYPE attributeValue = xpp.getAttributeValue( "", "type" ); if ( attributeValue != null ) { if ( !Oid.isOid( attributeValue ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03006 ), xpp, null ); } control = container.getLdapCodecService().newControl( new OpaqueControl( attributeValue ) ); parent.addControl( control ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03005 ), xpp, null ); } // CRITICALITY attributeValue = xpp.getAttributeValue( "", "criticality" ); if ( attributeValue != null ) { if ( attributeValue.equals( "true" ) ) { control.setCritical( true ); } else if ( attributeValue.equals( "false" ) ) { control.setCritical( false ); } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03007 ), xpp, null ); } } } /** * GrammarAction that creates a Control for LDAP Result */ private final GrammarAction ldapResultControlCreation = new GrammarAction( "Create Control for LDAP Result" ) { 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" ) { 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" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResponse response = ( SearchResponse ) ( ( SearchResponseDsml ) container.getBatchResponse() .getCurrentResponse() ).getDecorated(); createAndAddControl( container, response.getCurrentSearchResultReference() ); } }; /** * 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 */ private void createAndAddControlValue( Dsmlv2Container container, AbstractDsmlMessageDecorator parent ) throws XmlPullParserException { DsmlControl control = ( ( AbstractDsmlMessageDecorator ) 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 ( !nextText.equals( "" ) ) { if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) ) { control.setValue( Base64.decode( nextText.trim().toCharArray() ) ); } else { control.setValue( Strings.getBytesUtf8( nextText.trim() ) ); } } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, ioe.getMessage() ), xpp, ioe ); } } /** * GrammarAction that creates a Control Value for LDAP Result */ private final GrammarAction ldapResultControlValueCreation = new GrammarAction( "Add ControlValue to Control for LDAP Result" ) { 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" ) { 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" ) { 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" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { DsmlDecorator ldapResponse = container.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = null; // 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( "", "code" ); if ( attributeValue != null ) { try { ldapResult.setResultCode( ResultCodeEnum.getResultCode( Integer.parseInt( attributeValue ) ) ); } catch ( NumberFormatException nfe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03009 ), xpp, nfe ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03010 ), xpp, null ); } // descr attributeValue = xpp.getAttributeValue( "", "descr" ); if ( ( attributeValue != null ) && !DSMLV2_DESCR_TAGS.contains( attributeValue ) ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03011, 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" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { DsmlDecorator ldapResponse = container.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = null; // 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 ( !nextText.equals( "" ) ) { ldapResult.setDiagnosticMessage( nextText.trim() ); } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that adds a Referral to a LDAP Result */ private final GrammarAction ldapResultAddReferral = new GrammarAction( "Add Referral to LDAP Result" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { DsmlDecorator ldapResponse = container.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = null; // 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 ( !nextText.equals( "" ) ) { 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, ioe.getMessage() ), xpp, ioe ); } } }; /** * GrammarAction that creates the Search Response */ private final GrammarAction searchResponseCreation = new GrammarAction( "Create Search Response" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { XmlPullParser xpp = container.getParser(); SearchResponse searchResponse = null; // Checking and adding the batchRequest's attributes String attributeValue = xpp.getAttributeValue( "", "requestID" ); if ( attributeValue != null ) { searchResponse = new SearchResponse( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } else { searchResponse = new SearchResponse(); } 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" ) { 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( "", "requestID" ); if ( attributeValue != null ) { searchResultEntry.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } // dn attributeValue = xpp.getAttributeValue( "", "dn" ); if ( attributeValue != null ) { try { searchResultEntry.setObjectName( new Dn( attributeValue ) ); } catch ( LdapInvalidDnException lide ) { throw new XmlPullParserException( lide.getMessage(), xpp, lide ); } } else { throw new XmlPullParserException( "dn attribute is required", xpp, null ); } } }; /** * GrammarAction that creates a Search Result Reference */ private final GrammarAction searchResultReferenceCreation = new GrammarAction( "Add Search Result Reference to Search Response" ) { 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( "", "requestID" ); if ( attributeValue != null ) { searchResultReference.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } } }; /** * GrammarAction that creates a Search Result Done */ private final GrammarAction searchResultDoneCreation = new GrammarAction( "Add Search Result Done to Search Response" ) { 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( "", "requestID" ); if ( attributeValue != null ) { searchResultDone.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ); } // MatchedDN attributeValue = xpp.getAttributeValue( "", "matchedDN" ); 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" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse().getDecorated(); SearchResultEntryDsml searchResultEntry = ( SearchResultEntryDsml ) searchResponse.getCurrentSearchResultEntry(); XmlPullParser xpp = container.getParser(); // Checking and adding the request's attributes String attributeValue; // name attributeValue = xpp.getAttributeValue( "", "name" ); if ( attributeValue != null ) { try { searchResultEntry.addAttribute( attributeValue ); } catch ( LdapException le ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, le ); } } else { throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), 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" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse().getDecorated(); SearchResultEntryDsml searchResultEntry = ( SearchResultEntryDsml ) 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( Base64.decode( nextText.toCharArray() ) ); } 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, 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" ) { 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 ( !nextText.equals( "" ) ) { LdapUrl ldapUrl = new LdapUrl( nextText ); searchResultReference.getReferral().addLdapUrl( ldapUrl.toString() ); } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, 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" ) { public void action( Dsmlv2Container container ) throws XmlPullParserException { ExtendedResponse extendedResponse = ( ExtendedResponse ) container.getBatchResponse().getCurrentResponse(); XmlPullParser xpp = container.getParser(); try { String nextText = xpp.nextText(); if ( !nextText.equals( "" ) ) { extendedResponse.setResponseName( Oid.fromString( nextText.trim() ).toString() ); } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, 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" ) { 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( Base64.decode( nextText.trim().toCharArray() ) ); } else { extendedResponse.setResponseValue( Strings.getBytesUtf8( nextText.trim() ) ); } } catch ( IOException ioe ) { throw new XmlPullParserException( I18n.err( I18n.ERR_03008, ioe.getMessage() ), xpp, ioe ); } } }; /** * Get the instance of this grammar * * @return * an instance on this grammar */ public static Dsmlv2ResponseGrammar getInstance() { return instance; } } ././@LongLink0100644 0000000 0000000 00000000160 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/ErrorResponse.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/ErrorRe0100644 0000767 0000024 00000016606 13114114301 034725 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.dsmlv2.DsmlDecorator; 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.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 { private static final String ERROR_RESPONSE_TAG = "errorResponse"; /** * 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} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( ERROR_RESPONSE_TAG ); } else { element = new DefaultElement( ERROR_RESPONSE_TAG ); } // RequestID if ( requestID != 0 ) { element.addAttribute( "requestID", Integer.toString( requestID ) ); } // Type element.addAttribute( "type", getTypeDescr( errorType ) ); // TODO Add Detail if ( ( message != null ) && ( !"".equals( message ) ) ) { Element messageElement = element.addElement( "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; } /** * @return The LdapApiService instance */ public LdapApiService getCodecService() { throw new IllegalArgumentException( "This should not be a decorator " + "but seems it was made into one. We need to do something about" + "this if this exception is being raise." ); } public Response getDecorated() { return this; } } ././@LongLink0100644 0000000 0000000 00000000167 13114114301 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/ExtendedResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/Extende0100644 0000767 0000024 00000012364 13114114301 034736 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; import org.apache.directory.api.asn1.util.Oid; 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.ExtendedResponseImpl; import org.apache.directory.api.ldap.model.message.MessageTypeEnum; 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 static final String EXTENDED_RESPONSE_TAG = "extendedResponse"; private byte[] response; /** * Creates a new getDecoratedMessage() of ExtendedResponseDsml. * * @param codec The LDAP Service to use */ public ExtendedResponseDsml( LdapApiService codec ) { super( codec, new ExtendedResponseImpl( "" ) ); } /** * 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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( EXTENDED_RESPONSE_TAG ); } else { element = new DefaultElement( EXTENDED_RESPONSE_TAG ); } 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( "responseName" ).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( "response" ) .addText( ParserUtils.base64Encode( responseValue ) ); responseElement.addAttribute( new QName( "type", xsiNamespace ), ParserUtils.XSD + ":" + ParserUtils.BASE64BINARY ); } else { element.addElement( "response" ).addText( Strings.utf8ToString( ( byte[] ) responseValue ) ); } } return element; } /** * {@inheritDoc} */ public void setResponseName( String oid ) { getDecorated().setResponseName( oid ); } /** * Get the extended response name * * @return Returns the name. */ 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; } }././@LongLink0100644 0000000 0000000 00000000161 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/LdapResultDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/LdapRes0100644 0000767 0000024 00000014006 13114114301 034667 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.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} */ public Element toDsml( Element root ) { // RequestID int requestID = message.getMessageId(); if ( requestID > 0 ) { root.addAttribute( "requestID", Integer.toString( requestID ) ); } // Matched Dn Dn matchedDn = result.getMatchedDn(); if ( !Dn.isNullOrEmpty( matchedDn ) ) { root.addAttribute( "matchedDn", matchedDn.getName() ); } // Controls ParserUtils.addControls( codec, root, message.getControls().values() ); // ResultCode Element resultCodeElement = root.addElement( "resultCode" ); resultCodeElement.addAttribute( "code", Integer.toString( result.getResultCode().getResultCode() ) ); resultCodeElement.addAttribute( "descr", result.getResultCode().getMessage() ); // ErrorMessage String errorMessage = ( result.getDiagnosticMessage() ); if ( ( errorMessage != null ) && ( errorMessage.length() != 0 ) ) { Element errorMessageElement = root.addElement( "errorMessage" ); 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( "referal" ); referalElement.addText( ldapUrl ); } } } return root; } /** * {@inheritDoc} */ public String getDiagnosticMessage() { return result.getDiagnosticMessage(); } /** * {@inheritDoc} */ public void setDiagnosticMessage( String diagnosticMessage ) { result.setDiagnosticMessage( diagnosticMessage ); } /** * Get the matched Dn * * @return Returns the matchedDN. */ public Dn getMatchedDn() { return result.getMatchedDn(); } /** * Set the Matched Dn * * @param matchedDn The matchedDn to set. */ 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. */ public ResultCodeEnum getResultCode() { return result.getResultCode(); } /** * Set the result code * * @param resultCode The resultCode to set. */ public void setResultCode( ResultCodeEnum resultCode ) { result.setResultCode( resultCode ); } /** * {@inheritDoc} */ public LdapResult getDecorated() { return result; } /** * {@inheritDoc} */ public boolean isReferral() { return getDecorated().isReferral(); } /** * {@inheritDoc} */ public Referral getReferral() { return getDecorated().getReferral(); } /** * {@inheritDoc} */ public void setReferral( Referral referral ) { getDecorated().setReferral( referral ); } /** * {@inheritDoc} */ public boolean isDefaultSuccess() { return false; } } ././@LongLink0100644 0000000 0000000 00000000164 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/ModDNResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/ModDNRe0100644 0000767 0000024 00000005337 13114114301 034574 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; 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 { private static final String MOD_DN_RESPONSE_TAG = "modDNResponse"; /** * 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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( MOD_DN_RESPONSE_TAG ); } else { element = new DefaultElement( MOD_DN_RESPONSE_TAG ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } } ././@LongLink0100644 0000000 0000000 00000000165 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/ModifyResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/ModifyR0100644 0000767 0000024 00000005331 13114114301 034707 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; 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 { private static final String MODIFY_RESPONSE_TAG = "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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( MODIFY_RESPONSE_TAG ); } else { element = new DefaultElement( MODIFY_RESPONSE_TAG ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } } ././@LongLink0100644 0000000 0000000 00000000161 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/SearchResponse.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/SearchR0100644 0000767 0000024 00000012745 13114114301 034674 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.size() > 0 ) { 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.size() > 0 ) { 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; } @Override public MessageTypeEnum getType() { return null; } } ././@LongLink0100644 0000000 0000000 00000000165 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/SearchResponseDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/SearchR0100644 0000767 0000024 00000012711 13114114301 034665 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.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 { private static final String SEARCH_RESPONSE_TAG = "searchResponse"; /** 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( "Unidentified search resp 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( "Unidentified search resp type" ); } return responses.remove( response ); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( SEARCH_RESPONSE_TAG ); } else { element = new DefaultElement( SEARCH_RESPONSE_TAG ); } // RequestID if ( getDecorated() != null ) { int requestID = getDecorated().getMessageId(); if ( requestID > 0 ) { element.addAttribute( "requestID", Integer.toString( requestID ) ); } } for ( DsmlDecorator response : responses ) { response.toDsml( element ); } return element; } } ././@LongLink0100644 0000000 0000000 00000000167 13114114301 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/SearchResultDoneDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/SearchR0100644 0000767 0000024 00000005473 13114114301 034674 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; 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 { private static final String SEARCH_RESULT_DONE_TAG = "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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( SEARCH_RESULT_DONE_TAG ); } else { element = new DefaultElement( SEARCH_RESULT_DONE_TAG ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); if ( ldapResultDsml != null ) { ldapResultDsml.toDsml( element ); } return element; } } ././@LongLink0100644 0000000 0000000 00000000170 13114114302 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/SearchResultEntryDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/SearchR0100644 0000767 0000024 00000014621 13114114302 034670 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; 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 { private static final String SEARCH_RESULT_ENTRY_TAG = "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 ); } /** * @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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( SEARCH_RESULT_ENTRY_TAG ); } else { element = new DefaultElement( SEARCH_RESULT_ENTRY_TAG ); } SearchResultEntry searchResultEntry = ( SearchResultEntry ) getDecorated(); element.addAttribute( "dn", searchResultEntry.getObjectName().getName() ); Entry entry = searchResultEntry.getEntry(); for ( Attribute attribute : entry ) { Element attributeElement = element.addElement( "attr" ); attributeElement.addAttribute( "name", attribute.getUpId() ); for ( Value value : attribute ) { if ( ParserUtils.needsBase64Encoding( value.getValue() ) ) { 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( "value" ).addText( ParserUtils.base64Encode( value.getValue() ) ); valueElement.addAttribute( new QName( "type", xsiNamespace ), ParserUtils.XSD + ":" + ParserUtils.BASE64BINARY ); } else { attributeElement.addElement( "value" ).addText( value.getString() ); } } } return element; } /** * Get the entry Dn * * @return Returns the objectName. */ public Dn getObjectName() { return getDecorated().getObjectName(); } /** * Set the entry Dn * * @param objectName The objectName to set. */ public void setObjectName( Dn objectName ) { getDecorated().setObjectName( objectName ); } /** * Get the entry. * * @return Returns the entry. */ public Entry getEntry() { return getDecorated().getEntry(); } /** * Initialize the entry. * * @param entry the entry */ public void setEntry( Entry entry ) { getDecorated().setEntry( entry ); } } ././@LongLink0100644 0000000 0000000 00000000174 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/SearchResultReferenceDsml.javaapache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/SearchR0100644 0000767 0000024 00000007416 13114114301 034673 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.response; import java.util.Collection; 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 { private static final String SEARCH_RESULT_REFERENCE_TAG = "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} */ public MessageTypeEnum getType() { return getDecorated().getType(); } /** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = null; if ( root != null ) { element = root.addElement( SEARCH_RESULT_REFERENCE_TAG ); } else { element = new DefaultElement( SEARCH_RESULT_REFERENCE_TAG ); } // Adding References for ( String url : getDecorated().getReferral().getLdapUrls() ) { element.addElement( "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} */ public Referral getReferral() { return getDecorated().getReferral(); } /** * {@inheritDoc} */ public void setReferral( Referral referral ) { getDecorated().setReferral( referral ); } } apache-ldap-api-1.0.0-src/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/Tag.java0100644 0000767 0000024 00000006056 13114114302 033141 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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} */ 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} */ public int hashCode() { return name.hashCode() + type << 24; } /** * {@inheritDoc} */ public String toString() { if ( name != null ) { return "<" + ( ( type == Tag.END ) ? "/" : "" ) + name + ">"; } else { return "Unknown tag"; } } } ././@LongLink0100644 0000000 0000000 00000000150 13114114301 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/main/resources/org/apache/directory/shared/dsmlv2/DSMLv2.xsltapache-ldap-api-1.0.0-src/dsml/parser/src/main/resources/org/apache/directory/shared/dsmlv2/DSMLv2.x0100644 0000767 0000024 00000003212 13114114301 034537 0ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/site/site.xml0100644 0000767 0000024 00000002011 13114114301 024336 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000173 13114114275 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/abandonRequest/AbandonRequestTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/abandonRequest/A0100644 0000767 0000024 00000023723 13114114275 034705 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.abandonRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Abandon Request parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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 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() ); } } ././@LongLink0100644 0000000 0000000 00000000156 13114114275 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/AbstractResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/AbstractResponse0100644 0000767 0000024 00000003745 13114114275 035036 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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( e.getMessage(), true ); return; } catch ( Exception e ) { fail( e.getMessage() ); } fail(); } } ././@LongLink0100644 0000000 0000000 00000000146 13114114275 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/AbstractTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/AbstractTest.jav0100644 0000767 0000024 00000005142 13114114275 034727 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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( e.getMessage(), true ); return; } catch ( IllegalStateException e ) { assertTrue( e.getMessage(), true ); return; } catch ( Exception e ) { fail( e.getMessage() ); } fail(); } } ././@LongLink0100644 0000000 0000000 00000000163 13114114275 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/addRequest/AddRequestTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/addRequest/AddRe0100644 0000767 0000024 00000040710 13114114275 034625 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.addRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Add Request parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", addRequest.getEntryDn().getNormName() ); } /** * 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 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" ); } } ././@LongLink0100644 0000000 0000000 00000000165 13114114275 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/addResponse/AddResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/addResponse/AddR0100644 0000767 0000024 00000036157 13114114275 034640 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.addResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Add Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() ); } /** * 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" ); } } apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/AllTests.java0100644 0000767 0000024 00000007255 13114114275 034227 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2; import org.apache.directory.api.dsmlv2.abandonRequest.AbandonRequestTest; import org.apache.directory.api.dsmlv2.addRequest.AddRequestTest; import org.apache.directory.api.dsmlv2.addResponse.AddResponseTest; import org.apache.directory.api.dsmlv2.authRequest.AuthRequestTest; import org.apache.directory.api.dsmlv2.authResponse.AuthResponseTest; import org.apache.directory.api.dsmlv2.batchRequest.BatchRequestTest; import org.apache.directory.api.dsmlv2.batchResponse.BatchResponseTest; import org.apache.directory.api.dsmlv2.compareRequest.CompareRequestTest; import org.apache.directory.api.dsmlv2.compareResponse.CompareResponseTest; import org.apache.directory.api.dsmlv2.delRequest.DelRequestTest; import org.apache.directory.api.dsmlv2.delResponse.DelResponseTest; import org.apache.directory.api.dsmlv2.errorResponse.ErrorResponseTest; import org.apache.directory.api.dsmlv2.extendedRequest.ExtendedRequestTest; import org.apache.directory.api.dsmlv2.extendedResponse.ExtendedResponseTest; import org.apache.directory.api.dsmlv2.modDNRequest.ModifyDNRequestTest; import org.apache.directory.api.dsmlv2.modDNResponse.ModifyDNResponseTest; import org.apache.directory.api.dsmlv2.modifyRequest.ModifyRequestTest; import org.apache.directory.api.dsmlv2.modifyResponse.ModifyResponseTest; import org.apache.directory.api.dsmlv2.searchRequest.SearchRequestTest; import org.apache.directory.api.dsmlv2.searchResponse.SearchResponseTest; import org.apache.directory.api.dsmlv2.searchResponse.searchResultDone.SearchResultDoneTest; import org.apache.directory.api.dsmlv2.searchResponse.searchResultEntry.SearchResultEntryTest; import org.apache.directory.api.dsmlv2.searchResponse.searchResultReference.SearchResultReferenceTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; import com.mycila.junit.concurrent.ConcurrentSuite; /** * This is the complete Test Suite for DSMLv2 Parser (Request and Response) * * @author Apache Directory Project */ @RunWith(ConcurrentSuite.class) @Suite.SuiteClasses( { AbandonRequestTest.class, AddRequestTest.class, AddResponseTest.class, AuthRequestTest.class, AuthResponseTest.class, BatchRequestTest.class, BatchResponseTest.class, CompareRequestTest.class, CompareResponseTest.class, DelRequestTest.class, DelResponseTest.class, ErrorResponseTest.class, ExtendedRequestTest.class, ExtendedResponseTest.class, ModifyDNRequestTest.class, ModifyDNResponseTest.class, ModifyRequestTest.class, ModifyResponseTest.class, SearchRequestTest.class, SearchResponseTest.class, SearchResultDoneTest.class, SearchResultEntryTest.class, SearchResultReferenceTest.class }) public class AllTests { } ././@LongLink0100644 0000000 0000000 00000000165 13114114275 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/authRequest/AuthRequestTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/authRequest/Auth0100644 0000767 0000024 00000022154 13114114275 034762 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.authRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Auth Request parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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 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" ); } } ././@LongLink0100644 0000000 0000000 00000000167 13114114275 011636 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/authResponse/AuthResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/authResponse/Aut0100644 0000767 0000024 00000037245 13114114275 034767 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.authResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Auth Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() ); } /** * 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" ); } } ././@LongLink0100644 0000000 0000000 00000000167 13114114275 011636 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/batchRequest/BatchRequestTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/batchRequest/Bat0100644 0000767 0000024 00000045115 13114114275 034711 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.batchRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Compare Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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" ); } } ././@LongLink0100644 0000000 0000000 00000000171 13114114275 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/batchResponse/BatchResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/batchResponse/Ba0100644 0000767 0000024 00000050303 13114114275 034666 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.batchResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Compare Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); } } } ././@LongLink0100644 0000000 0000000 00000000173 13114114275 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/compareRequest/CompareRequestTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/compareRequest/C0100644 0000767 0000024 00000032236 13114114275 034732 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.compareRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Compare Request parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getName().getNormName() ); } /** * 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getName().getNormName() ); assertEquals( "sn", compareRequest.getAttributeId() ); assertEquals( "Johnson", compareRequest.getAssertionValue().getValue() ); } /** * 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getName().getNormName() ); assertEquals( "sn", compareRequest.getAttributeId() ); assertEquals( "DSMLv2.0 rocks!!", compareRequest.getAssertionValue().getString() ); } /** * 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getName().getNormName() ); 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" ); } } ././@LongLink0100644 0000000 0000000 00000000175 13114114275 011635 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/compareResponse/CompareResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/compareResponse/0100644 0000767 0000024 00000037622 13114114275 035001 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.compareResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Compare Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() ); } /** * 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" ); } } ././@LongLink0100644 0000000 0000000 00000000163 13114114275 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/delRequest/DelRequestTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/delRequest/DelRe0100644 0000767 0000024 00000022031 13114114275 034651 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.delRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Del Request parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", delRequest.getName().getNormName() ); } /** * 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 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" ); } } ././@LongLink0100644 0000000 0000000 00000000165 13114114275 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/delResponse/DelResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/delResponse/DelR0100644 0000767 0000024 00000037172 13114114275 034666 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.delResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Del Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() ); } /** * 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" ); } } ././@LongLink0100644 0000000 0000000 00000000171 13114114275 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/errorResponse/ErrorResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/errorResponse/Er0100644 0000767 0000024 00000024466 13114114275 034775 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.errorResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; 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.Test; import org.junit.runner.RunWith; /** * Tests for the Error Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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() ); } } ././@LongLink0100644 0000000 0000000 00000000175 13114114275 011635 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/extendedRequest/ExtendedRequestTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/extendedRequest/0100644 0000767 0000024 00000026716 13114114275 035007 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.extendedRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Extended Request parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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 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" ); } } ././@LongLink0100644 0000000 0000000 00000000177 13114114275 011637 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/extendedResponse/ExtendedResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/extendedResponse0100644 0000767 0000024 00000052342 13114114275 035070 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.extendedResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Extended Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() ); } /** * 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 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" ); } } ././@LongLink0100644 0000000 0000000 00000000172 13114114275 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modDNRequest/ModifyDNRequestTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modDNRequest/Mod0100644 0000767 0000024 00000032356 13114114275 034645 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.modDNRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Modify Dn Request parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", modifyDNRequest.getName().getNormName() ); 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(); assertEquals( "cn=Steve Jobs,ou=Dev,dc=apple,dc=com", modifyDNRequest.getNewSuperior().getNormName() ); } /** * Test parsing of a request with a needed requestID attribute * * DIRSTUDIO-1 */ @Test public void testRequestWithNeededRequestId() { testParsingFail( ModifyDNRequestTest.class, "request_with_needed_requestID.xml" ); } } ././@LongLink0100644 0000000 0000000 00000000174 13114114275 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modDNResponse/ModifyDNResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modDNResponse/Mo0100644 0000767 0000024 00000037737 13114114275 034657 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.modDNResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Modify Dn Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() ); } /** * 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" ); } } ././@LongLink0100644 0000000 0000000 00000000171 13114114275 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modifyRequest/ModifyRequestTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modifyRequest/Mo0100644 0000767 0000024 00000050430 13114114275 034760 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.modifyRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Modify Request parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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 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 NamingException */ @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 with Base64 Value * @throws NamingException */ @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 2 Modification elements * @throws NamingException */ @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 NamingException */ @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 NamingException */ @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 NamingException */ @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 NamingException */ @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 NamingException */ @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 NamingException */ @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" ); } } ././@LongLink0100644 0000000 0000000 00000000173 13114114275 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modifyResponse/ModifyResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/modifyResponse/M0100644 0000767 0000024 00000037504 13114114275 034756 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.modifyResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Modify Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() ); } /** * 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" ); } } ././@LongLink0100644 0000000 0000000 00000000151 13114114275 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/ParserUtilsTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/ParserUtilsTest.0100644 0000767 0000024 00000007330 13114114275 034741 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2; import static org.junit.Assert.assertEquals; import static org.junit.Assert.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.Test; /** * Tests for ParserUtils. * * @author Apache Directory Project */ 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(). */ @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( "Pretty printed DSML should contain newlines", 20, countNewlines( dsml ) ); assertEquals( "Pretty printed DSML should contain indention", 38, countIndention( dsml ) ); } /** * Test for DIRAPI-238: DSML pretty print does not work, prints error. * * Indirect test of ParserUtils.styleDocument() via BatchResponseDsml.toDsml() */ @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( "Pretty printed DSML should contain newlines", 12, countNewlines( dsml ) ); assertEquals( "Pretty printed DSML should contain indention", 18, countIndention( dsml ) ); } 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; } } ././@LongLink0100644 0000000 0000000 00000000171 13114114275 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchRequest/SearchRequestTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchRequest/Se0100644 0000767 0000024 00000204317 13114114275 034737 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.searchRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.List; import java.util.Map; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; 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.SearchRequestDsml; 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.junit.Test; import org.junit.runner.RunWith; /** * Tests for the Del Request parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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 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 * @throws NamingException */ @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 * @throws NamingException */ @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 * @throws NamingException */ @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 * @throws NamingException */ @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 * @throws NamingException */ @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 * @throws NamingException */ @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 * @throws NamingException */ @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 * @throws NamingException */ @Test public void testRequestWithDerefAliasesError() { testParsingFail( SearchRequestTest.class, "request_with_derefAliases_error.xml" ); } /** * Test parsing of a request with the sizeLimit (optional) attribute * @throws NamingException */ @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 * @throws NamingException */ @Test public void testRequestWithSizeLimitError() { testParsingFail( SearchRequestTest.class, "request_with_sizeLimit_error.xml" ); } /** * Test parsing of a request with the timeLimit (optional) attribute * @throws NamingException */ @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 * @throws NamingException */ @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 NamingException */ @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 NamingException */ @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 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() ); assertNull( approxMatchFilter.getValue() ); } /** * 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 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() ); assertNull( greaterEqFilter.getValue() ); } /** * 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 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() ); assertNull( lessOrEqFilter.getValue() ); } /** * 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 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() ); } /** * 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() ); assertNull( equalityFilter.getValue() ); } /** * 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 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 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 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 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() ); } } ././@LongLink0100644 0000000 0000000 00000000173 13114114275 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/SearchResponseTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/S0100644 0000767 0000024 00000024003 13114114275 034730 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.searchResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Search Result Done Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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" ); } } ././@LongLink0100644 0000000 0000000 00000000216 13114114275 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/s0100644 0000767 0000024 00000041622 13114114275 034776 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.searchResponse.searchResultDone; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Search Result Done Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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(); assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() ); } /** * 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" ); } } ././@LongLink0100644 0000000 0000000 00000000220 13114114275 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/s0100644 0000767 0000024 00000044342 13114114275 035000 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.searchResponse.searchResultEntry; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.nio.charset.StandardCharsets; import java.util.Iterator; import java.util.Map; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; 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.Test; import org.junit.runner.RunWith; /** * Tests for the Search Result Entry Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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 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" ); } } ././@LongLink0100644 0000000 0000000 00000000230 13114114275 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/searchResponse/s0100644 0000767 0000024 00000026672 13114114275 035006 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.searchResponse.searchResultReference; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the Search Result Reference Response parsing * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() 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" ); } } ././@LongLink0100644 0000000 0000000 00000000162 13114114275 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/soap/SoapDsmlParsingTest.javaapache-ldap-api-1.0.0-src/dsml/parser/src/test/java/org/apache/directory/api/dsmlv2/soap/SoapDsmlPar0100644 0000767 0000024 00000007635 13114114275 034705 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.dsmlv2.soap; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.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.Test; /** * Class which tests the parsing of DSML documents embedded in a SOAP envelope. * * @author Apache Directory Project */ 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-ldap-api-1.0.0-src/dsml/parser/src/test/resources/log4j.properties0100644 0000767 0000024 00000002255 13114114301 030044 0ustar00elecharnystaff0000000 0000000 ############################################################################# # 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. ############################################################################# 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 ././@LongLink0100644 0000000 0000000 00000000217 13114114277 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_with_0_abandonID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000001712 13114114277 035076 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000203 13114114277 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000002120 13114114277 035070 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000220 13114114277 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_with_1_control_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000002332 13114114277 035075 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000217 13114114277 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000002047 13114114277 035100 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000204 13114114277 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000002353 13114114277 035100 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000222 13114114277 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000002236 13114114277 035100 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000215 13114114277 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_with_abandonID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000001675 13114114277 035106 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114277 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_with_needed_requestID.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000001754 13114114277 035104 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000215 13114114277 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000001715 13114114277 035101 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114277 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000001714 13114114277 035100 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000220 13114114277 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequest/request_without_abandonID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/abandonRequ0100644 0000767 0000024 00000001655 13114114277 035104 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_1_attr_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000002000 13114114276 035005 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_1_attr_with_2_values.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000002030 13114114276 035010 0ustar00elecharnystaff0000000 0000000 topperson ././@LongLink0100644 0000000 0000000 00000000216 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_1_attr_with_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000002272 13114114276 035020 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_1_attr_with_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000002003 13114114276 035010 0ustar00elecharnystaff0000000 0000000 top ././@LongLink0100644 0000000 0000000 00000000223 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_1_attr_without_name_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000001760 13114114276 035021 0ustar00elecharnystaff0000000 0000000 top ././@LongLink0100644 0000000 0000000 00000000212 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_1_attr_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000001761 13114114276 035022 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000177 13114114276 011640 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000002142 13114114276 035014 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000214 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_1_control_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000002354 13114114276 035021 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000002071 13114114276 035015 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_2_attr_with_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000002073 13114114276 035017 0ustar00elecharnystaff0000000 0000000 top person ././@LongLink0100644 0000000 0000000 00000000200 13114114276 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000002375 13114114276 035024 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000216 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000002255 13114114276 035021 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000001716 13114114276 035022 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_needed_requestID.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000001776 13114114276 035030 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000001736 13114114276 035024 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000001735 13114114276 035023 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000205 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/request_without_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addRequest/0100644 0000767 0000024 00000001644 13114114276 035022 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000201 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002214 13114114276 035103 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000215 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002143 13114114276 035104 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_1_empty_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002031 13114114276 035100 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_1_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002056 13114114276 035107 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000224 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_1_referral_and_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002232 13114114276 035103 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000202 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002430 13114114276 035103 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000203 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_2_referrals.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002135 13114114276 035105 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ldap://www.apple.com ././@LongLink0100644 0000000 0000000 00000000220 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002327 13114114276 035110 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_empty_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002041 13114114276 035101 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000205 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002155 13114114276 035107 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002054 13114114276 035105 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000001772 13114114276 035113 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000001771 13114114276 035112 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000203 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000001776 13114114276 035117 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000217 13114114276 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_result_code_not_integer.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002002 13114114276 035076 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000203 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_wrong_descr.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000001767 13114114276 035117 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000221 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_with_wrong_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000002036 13114114276 035105 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse/response_without_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/addResponse0100644 0000767 0000024 00000001717 13114114276 035112 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000200 13114114277 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/request_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0100644 0000767 0000024 00000002153 13114114277 035151 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000215 13114114277 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/request_with_1_control_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0100644 0000767 0000024 00000002365 13114114277 035156 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000214 13114114277 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/request_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0100644 0000767 0000024 00000002102 13114114277 035143 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000201 13114114277 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/request_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0100644 0000767 0000024 00000002406 13114114277 035152 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000217 13114114277 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/request_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0100644 0000767 0000024 00000002266 13114114277 035156 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114277 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/request_with_needed_requestID.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0100644 0000767 0000024 00000002007 13114114277 035147 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114277 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/request_with_principal_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0100644 0000767 0000024 00000001727 13114114277 035157 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114277 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/request_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0100644 0000767 0000024 00000001747 13114114277 035161 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114277 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/request_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0100644 0000767 0000024 00000001746 13114114277 035160 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000215 13114114277 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest/request_without_principal_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRequest0100644 0000767 0000024 00000001647 13114114277 035160 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002216 13114114300 035135 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000216 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002145 13114114300 035136 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_1_empty_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002033 13114114300 035132 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000203 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_1_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002060 13114114300 035132 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000225 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_1_referral_and_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002234 13114114300 035135 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000203 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002432 13114114300 035135 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000204 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_2_referrals.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002137 13114114300 035137 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ldap://www.apple.com ././@LongLink0100644 0000000 0000000 00000000221 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002331 13114114300 035133 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000214 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_empty_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002043 13114114300 035133 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002157 13114114300 035141 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ././@LongLink0100644 0000000 0000000 00000000214 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002056 13114114300 035137 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000214 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000001774 13114114300 035145 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000001773 13114114300 035144 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000204 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002000 13114114300 035124 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000220 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_result_code_not_integer.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002004 13114114300 035130 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000204 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_wrong_descr.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000001771 13114114300 035142 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000222 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_with_wrong_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000002040 13114114300 035130 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authResponse/response_without_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/authRespons0100644 0000767 0000024 00000001721 13114114300 035135 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000201 13114114301 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_0_request.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000001607 13114114301 035074 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114301 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_1_AbandonRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000001723 13114114301 035073 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000204 13114114301 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_1_AddRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002211 13114114301 035064 0ustar00elecharnystaff0000000 0000000 top person snvalue ././@LongLink0100644 0000000 0000000 00000000205 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_1_AuthRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000001756 13114114301 035101 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000222 13114114301 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_1_AuthRequest_1_AddRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002331 13114114301 035067 0ustar00elecharnystaff0000000 0000000 top person snvalue ././@LongLink0100644 0000000 0000000 00000000210 13114114301 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_1_CompareRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002122 13114114301 035065 0ustar00elecharnystaff0000000 0000000 CN=Michael Scofield, DC=prisonbreak, Dc=com ././@LongLink0100644 0000000 0000000 00000000204 13114114301 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_1_DelRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000001754 13114114301 035077 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114301 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_1_ExtendedRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002017 13114114301 035070 0ustar00elecharnystaff0000000 0000000 1.2.6.1.4.1.18060.1.1.1.100.2 ././@LongLink0100644 0000000 0000000 00000000206 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_1_ModDNRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002020 13114114301 035062 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_1_ModifyRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002244 13114114301 035072 0ustar00elecharnystaff0000000 0000000 CN=John Smith, DC=microsoft, DC=com CN=Michael Scofield, DC=prisonbreak, DC=com ././@LongLink0100644 0000000 0000000 00000000207 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_1_SearchRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002221 13114114301 035065 0ustar00elecharnystaff0000000 0000000 o ././@LongLink0100644 0000000 0000000 00000000210 13114114301 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_2_AbandonRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002010 13114114301 035061 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000204 13114114301 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_2_AddRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002564 13114114301 035077 0ustar00elecharnystaff0000000 0000000 top person snvalue top person snvalue ././@LongLink0100644 0000000 0000000 00000000210 13114114301 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_2_CompareRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002406 13114114301 035072 0ustar00elecharnystaff0000000 0000000 CN=Michael Scofield, DC=prisonbreak, Dc=com CN=Michael Scofield, DC=prisonbreak, Dc=com ././@LongLink0100644 0000000 0000000 00000000204 13114114301 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_2_DelRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002072 13114114301 035071 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114301 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_2_ExtendedRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002200 13114114301 035062 0ustar00elecharnystaff0000000 0000000 1.2.6.1.4.1.18060.1.1.1.100.2 1.2.6.1.4.1.18060.1.1.1.100.2 ././@LongLink0100644 0000000 0000000 00000000206 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_2_ModDNRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002202 13114114301 035064 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_2_ModifyRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002652 13114114301 035075 0ustar00elecharnystaff0000000 0000000 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 ././@LongLink0100644 0000000 0000000 00000000207 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_2_SearchRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002604 13114114301 035072 0ustar00elecharnystaff0000000 0000000 o o ././@LongLink0100644 0000000 0000000 00000000213 13114114301 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000001636 13114114301 035076 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114301 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000001626 13114114301 035075 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000220 13114114301 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRequest/request_with_wrong_placed_AuthRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchReques0100644 0000767 0000024 00000002331 13114114301 035067 0ustar00elecharnystaff0000000 0000000 top person snvalue ././@LongLink0100644 0000000 0000000 00000000204 13114114275 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_0_response.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000001611 13114114275 035103 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_1_AddResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000001740 13114114276 035107 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114275 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_1_AuthResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000001742 13114114275 035110 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_1_CompareResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000001750 13114114276 035110 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_1_DelResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000001740 13114114276 035107 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_1_ErrorResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000001772 13114114276 035114 0ustar00elecharnystaff0000000 0000000 Connection refused ././@LongLink0100644 0000000 0000000 00000000214 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_1_ExtendedResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002267 13114114276 035114 0ustar00elecharnystaff0000000 0000000 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 ././@LongLink0100644 0000000 0000000 00000000211 13114114275 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_1_ModDNResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000001744 13114114275 035112 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_1_ModifyResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000001746 13114114276 035115 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114275 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_1_SearchResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002022 13114114275 035100 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_2_AddResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002067 13114114276 035112 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114275 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_2_AuthResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002073 13114114275 035106 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114275 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_2_CompareResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002107 13114114275 035104 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114275 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_2_DelResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002067 13114114275 035111 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_2_ErrorResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002153 13114114276 035106 0ustar00elecharnystaff0000000 0000000 Connection refused Connection refused ././@LongLink0100644 0000000 0000000 00000000214 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_2_ExtendedResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002745 13114114276 035115 0ustar00elecharnystaff0000000 0000000 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 ././@LongLink0100644 0000000 0000000 00000000211 13114114275 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_2_ModDNResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002077 13114114275 035112 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_2_ModifyResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002103 13114114276 035101 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_2_SearchResponse.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000002233 13114114276 035105 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000215 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000001640 13114114276 035106 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchResponse/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/batchRespon0100644 0000767 0000024 00000001630 13114114276 035105 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000221 13114114275 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_1_assertion_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002011 13114114275 035111 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000223 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_1_assertion_with_2_values.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002112 13114114276 035114 0ustar00elecharnystaff0000000 0000000 Johnson Johnson ././@LongLink0100644 0000000 0000000 00000000234 13114114275 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_1_assertion_without_name_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002006 13114114275 035115 0ustar00elecharnystaff0000000 0000000 Johnson ././@LongLink0100644 0000000 0000000 00000000223 13114114275 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_1_assertion_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000001757 13114114275 035131 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000216 13114114275 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_1_complete_assertion.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002020 13114114275 035111 0ustar00elecharnystaff0000000 0000000 Johnson ././@LongLink0100644 0000000 0000000 00000000233 13114114275 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_1_complete_assertion_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002274 13114114275 035124 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000203 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002244 13114114276 035122 0ustar00elecharnystaff0000000 0000000 Some text Johnson ././@LongLink0100644 0000000 0000000 00000000220 13114114275 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_1_control_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002456 13114114275 035126 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== Johnson ././@LongLink0100644 0000000 0000000 00000000217 13114114275 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002173 13114114275 035122 0ustar00elecharnystaff0000000 0000000 Johnson ././@LongLink0100644 0000000 0000000 00000000217 13114114275 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_2_complete_assertions.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002112 13114114275 035113 0ustar00elecharnystaff0000000 0000000 Johnson Thomson ././@LongLink0100644 0000000 0000000 00000000204 13114114275 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002477 13114114275 035131 0ustar00elecharnystaff0000000 0000000 Some text Some other text Johnson ././@LongLink0100644 0000000 0000000 00000000222 13114114275 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002362 13114114275 035122 0ustar00elecharnystaff0000000 0000000 Johnson ././@LongLink0100644 0000000 0000000 00000000206 13114114275 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002020 13114114275 035111 0ustar00elecharnystaff0000000 0000000 Johnson ././@LongLink0100644 0000000 0000000 00000000212 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_needed_requestID.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002100 13114114276 035111 0ustar00elecharnystaff0000000 0000000 Johnson ././@LongLink0100644 0000000 0000000 00000000215 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002041 13114114276 035115 0ustar00elecharnystaff0000000 0000000 Johnson ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000002040 13114114276 035114 0ustar00elecharnystaff0000000 0000000 Johnson ././@LongLink0100644 0000000 0000000 00000000206 13114114275 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_without_assertion.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000001726 13114114275 035125 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114275 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequest/request_without_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareRequ0100644 0000767 0000024 00000001746 13114114275 035127 0ustar00elecharnystaff0000000 0000000 Johnson ././@LongLink0100644 0000000 0000000 00000000205 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002224 13114114276 035115 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000221 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002153 13114114276 035116 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000214 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_1_empty_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002041 13114114276 035112 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_1_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002066 13114114276 035121 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000230 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_1_referral_and_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002242 13114114276 035115 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000206 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002440 13114114276 035115 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_2_referrals.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002145 13114114276 035117 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ldap://www.apple.com ././@LongLink0100644 0000000 0000000 00000000224 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002337 13114114276 035122 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000217 13114114276 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_empty_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002051 13114114276 035113 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002165 13114114276 035121 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ././@LongLink0100644 0000000 0000000 00000000217 13114114276 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002064 13114114276 035117 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000217 13114114276 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002002 13114114276 035107 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000215 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002001 13114114276 035106 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002006 13114114276 035113 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000223 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_result_code_not_integer.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002012 13114114276 035110 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_wrong_descr.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000001777 13114114276 035131 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000225 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_with_wrong_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000002046 13114114276 035117 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResponse/response_without_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/compareResp0100644 0000767 0000024 00000001727 13114114276 035124 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000177 13114114277 011641 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/request_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0100644 0000767 0000024 00000002142 13114114277 035031 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000214 13114114277 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/request_with_1_control_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0100644 0000767 0000024 00000002354 13114114277 035036 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000213 13114114277 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/request_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0100644 0000767 0000024 00000002071 13114114277 035032 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000200 13114114277 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/request_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0100644 0000767 0000024 00000002375 13114114277 035041 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000216 13114114277 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/request_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0100644 0000767 0000024 00000002255 13114114277 035036 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114277 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/request_with_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0100644 0000767 0000024 00000001716 13114114277 035037 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114277 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/request_with_needed_requestID.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0100644 0000767 0000024 00000001776 13114114277 035045 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114277 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/request_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0100644 0000767 0000024 00000001736 13114114277 035041 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114277 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/request_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0100644 0000767 0000024 00000001735 13114114277 035040 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000205 13114114277 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/request_without_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delRequest/0100644 0000767 0000024 00000001644 13114114277 035037 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000201 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002214 13114114300 035103 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000215 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002143 13114114301 035105 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_1_empty_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002031 13114114300 035100 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_1_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002056 13114114300 035107 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000224 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_1_referral_and_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002232 13114114300 035103 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000202 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002430 13114114300 035103 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000203 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_2_referrals.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002135 13114114300 035105 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ldap://www.apple.com ././@LongLink0100644 0000000 0000000 00000000220 13114114301 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002327 13114114301 035111 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_empty_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002041 13114114300 035101 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000205 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002155 13114114301 035110 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ././@LongLink0100644 0000000 0000000 00000000213 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002054 13114114300 035105 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000001772 13114114300 035113 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114301 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000001771 13114114301 035113 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000203 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000001776 13114114300 035117 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000217 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_result_code_not_integer.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002002 13114114300 035076 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000203 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_wrong_descr.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000001767 13114114300 035117 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000221 13114114301 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_with_wrong_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000002036 13114114301 035106 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse/response_without_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/delResponse0100644 0000767 0000024 00000001717 13114114300 035112 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_empty_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000002002 13114114276 035147 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000201 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000002024 13114114276 035153 0ustar00elecharnystaff0000000 0000000 Connection refused ././@LongLink0100644 0000000 0000000 00000000215 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001754 13114114276 035164 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001743 13114114276 035162 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000223 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_type_authenticationFailed.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001761 13114114276 035162 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000217 13114114276 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_type_connectionClosed.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001755 13114114276 035165 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000216 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_type_couldNotConnect.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001754 13114114276 035164 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000223 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_type_gatewayInternalError.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001761 13114114276 035162 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_type_inError.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001742 13114114276 035161 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000217 13114114276 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_type_malformedRequest.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001755 13114114276 035165 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_type_notAttempted.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001751 13114114276 035161 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000204 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_type_other.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001742 13114114276 035161 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000216 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_with_type_unresolvableURI.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001754 13114114276 035164 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000201 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorResponse/response_without_type.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/errorRespon0100644 0000767 0000024 00000001725 13114114276 035162 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000204 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002156 13114114276 035111 0ustar00elecharnystaff0000000 0000000 Some text 1.3.563.52.425 ././@LongLink0100644 0000000 0000000 00000000221 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_1_control_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002370 13114114276 035107 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== 1.3.563.52.425 ././@LongLink0100644 0000000 0000000 00000000220 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002105 13114114276 035103 0ustar00elecharnystaff0000000 0000000 1.3.563.52.425 ././@LongLink0100644 0000000 0000000 00000000205 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002411 13114114276 035103 0ustar00elecharnystaff0000000 0000000 Some text Some other text 1.3.563.52.425 ././@LongLink0100644 0000000 0000000 00000000210 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_2_requestName.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002006 13114114276 035103 0ustar00elecharnystaff0000000 0000000 1.3.563.52.425 1.3.563.52.425 ././@LongLink0100644 0000000 0000000 00000000211 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_2_requestValue.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002401 13114114276 035102 0ustar00elecharnystaff0000000 0000000 1.3.563.52.425 RFNNTHYyLjAgcm9ja3MhIQ== RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000223 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002271 13114114276 035107 0ustar00elecharnystaff0000000 0000000 1.3.563.52.425 ././@LongLink0100644 0000000 0000000 00000000216 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_base64_requestValue.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002255 13114114276 035111 0ustar00elecharnystaff0000000 0000000 1.3.563.52.425 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000214 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_empty_requestName.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002241 13114114276 035104 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000215 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_empty_requestValue.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000001772 13114114276 035114 0ustar00elecharnystaff0000000 0000000 1.3.563.52.425 ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_needed_requestID.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002012 13114114276 035100 0ustar00elecharnystaff0000000 0000000 1.3.563.52.425 ././@LongLink0100644 0000000 0000000 00000000216 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000001752 13114114276 035112 0ustar00elecharnystaff0000000 0000000 1.3.563.52.425 ././@LongLink0100644 0000000 0000000 00000000214 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000001751 13114114276 035111 0ustar00elecharnystaff0000000 0000000 1.3.563.52.425 ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_with_requestValue.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000002000 13114114276 035075 0ustar00elecharnystaff0000000 0000000 1.3.563.52.425 foobar ././@LongLink0100644 0000000 0000000 00000000211 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRequest/request_without_requestName.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedReq0100644 0000767 0000024 00000001656 13114114276 035115 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002226 13114114300 035075 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000222 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002155 13114114300 035076 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000215 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_1_empty_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002043 13114114300 035072 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_1_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002070 13114114300 035072 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000231 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_1_referral_and_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002244 13114114300 035075 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000207 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002442 13114114300 035075 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_2_referrals.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002147 13114114300 035077 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ldap://www.apple.com ././@LongLink0100644 0000000 0000000 00000000225 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002341 13114114300 035073 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000214 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_base64_response.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002267 13114114300 035102 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000220 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_empty_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002053 13114114300 035073 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_empty_response.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002032 13114114300 035070 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000217 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_empty_responseName.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002042 13114114300 035071 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002167 13114114300 035101 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ././@LongLink0100644 0000000 0000000 00000000220 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002066 13114114300 035077 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000220 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002004 13114114300 035067 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000216 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002003 13114114300 035066 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000205 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_response.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002054 13114114300 035074 0ustar00elecharnystaff0000000 0000000 This is a response ././@LongLink0100644 0000000 0000000 00000000211 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_responseName.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002065 13114114300 035076 0ustar00elecharnystaff0000000 0000000 1.2.3.4.5.6.7.8.9.0 ././@LongLink0100644 0000000 0000000 00000000226 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_responseName_and_response.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002137 13114114300 035076 0ustar00elecharnystaff0000000 0000000 1.2.3.4.5.6.7.8.9.0 This is a response ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002010 13114114300 035064 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000224 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_result_code_not_integer.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002014 13114114300 035070 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_wrong_descr.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002001 13114114300 035064 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000226 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_wrong_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002050 13114114300 035070 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000217 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_with_wrong_responseName.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000002064 13114114300 035075 0ustar00elecharnystaff0000000 0000000 Wrong ResponseName ././@LongLink0100644 0000000 0000000 00000000213 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedResponse/response_without_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/extendedRes0100644 0000767 0000024 00000001731 13114114300 035075 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000201 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002204 13114114276 035021 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000216 13114114277 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_1_control_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002416 13114114277 035027 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000215 13114114277 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002133 13114114277 035023 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002437 13114114276 035031 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000220 13114114277 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002317 13114114277 035027 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114277 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_deleteoldrdn_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002001 13114114277 035015 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_deleteoldrdn_1.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002001 13114114276 035014 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_deleteoldrdn_error.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002005 13114114276 035020 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114277 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_deleteoldrdn_false.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002005 13114114277 035021 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114277 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_deleteoldrdn_true.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002004 13114114277 035020 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000220 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_dn_and_newrdn_attributes.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000001755 13114114276 035033 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_needed_requestID.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002040 13114114276 035017 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000215 13114114277 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_newSuperior_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002043 13114114277 035023 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114277 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002002 13114114277 035016 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000002001 13114114276 035014 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114277 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_without_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000001676 13114114277 035036 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRequest/request_without_newrdn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNReques0100644 0000767 0000024 00000001722 13114114276 035025 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000203 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002220 13114114300 035005 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000217 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002147 13114114300 035015 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_1_empty_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002035 13114114300 035011 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000204 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_1_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002062 13114114300 035011 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000226 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_1_referral_and_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002236 13114114300 035014 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000204 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002434 13114114300 035014 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000205 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_2_referrals.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002141 13114114300 035007 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ldap://www.apple.com ././@LongLink0100644 0000000 0000000 00000000222 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002333 13114114300 035012 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000215 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_empty_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002045 13114114300 035012 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002161 13114114300 035011 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ././@LongLink0100644 0000000 0000000 00000000215 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002060 13114114300 035007 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000215 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000001776 13114114300 035024 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000001775 13114114300 035023 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000205 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002002 13114114300 035003 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000221 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_result_code_not_integer.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002006 13114114300 035007 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000205 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_wrong_descr.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000001773 13114114300 035021 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000223 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_with_wrong_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000002042 13114114300 035007 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNResponse/response_without_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modDNRespon0100644 0000767 0000024 00000001723 13114114300 035014 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114275 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002147 13114114275 035131 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000217 13114114276 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_1_control_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002361 13114114276 035130 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000216 13114114275 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002076 13114114275 035132 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000207 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_1_modification.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002121 13114114276 035122 0ustar00elecharnystaff0000000 0000000 CN=John Smith, DC=microsoft, DC=com ././@LongLink0100644 0000000 0000000 00000000224 13114114275 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_1_modification_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002421 13114114275 035124 0ustar00elecharnystaff0000000 0000000 Y249RW1tYW51ZWwgTMOpY2hhcm55LCBvdT1wZW9wbGUsIGRjPWV4YW1wbGUsIGRjPWNvbQ== ././@LongLink0100644 0000000 0000000 00000000203 13114114275 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002403 13114114275 035124 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000210 13114114275 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_2_modifications.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002304 13114114275 035124 0ustar00elecharnystaff0000000 0000000 CN=John Smith, DC=microsoft, DC=com CN=Steve Jobs, DC=apple, DC=com ././@LongLink0100644 0000000 0000000 00000000221 13114114275 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002263 13114114275 035130 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000223 13114114275 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_modification_with_2_values.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002203 13114114275 035122 0ustar00elecharnystaff0000000 0000000 CN=John Smith, DC=microsoft, DC=com CN=Steve Jobs, DC=apple, DC=com ././@LongLink0100644 0000000 0000000 00000000226 13114114275 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_modification_with_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002056 13114114275 035130 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000223 13114114275 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_modification_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002033 13114114275 035123 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114275 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_needed_requestID.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002003 13114114275 035120 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_operation_add.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002121 13114114276 035122 0ustar00elecharnystaff0000000 0000000 CN=John Smith, DC=microsoft, DC=com ././@LongLink0100644 0000000 0000000 00000000211 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_operation_delete.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002124 13114114276 035125 0ustar00elecharnystaff0000000 0000000 CN=John Smith, DC=microsoft, DC=com ././@LongLink0100644 0000000 0000000 00000000210 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_operation_error.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002123 13114114276 035124 0ustar00elecharnystaff0000000 0000000 CN=John Smith, DC=microsoft, DC=com ././@LongLink0100644 0000000 0000000 00000000212 13114114275 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_operation_replace.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002125 13114114275 035125 0ustar00elecharnystaff0000000 0000000 CN=John Smith, DC=microsoft, DC=com ././@LongLink0100644 0000000 0000000 00000000214 13114114275 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000001744 13114114275 035133 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114275 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000001743 13114114275 035132 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114275 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_without_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000001652 13114114275 035131 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000212 13114114276 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_without_name_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002075 13114114276 035132 0ustar00elecharnystaff0000000 0000000 CN=John Smith, DC=microsoft, DC=com ././@LongLink0100644 0000000 0000000 00000000217 13114114276 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRequest/request_without_operation_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyReque0100644 0000767 0000024 00000002101 13114114276 035120 0ustar00elecharnystaff0000000 0000000 CN=John Smith, DC=microsoft, DC=com ././@LongLink0100644 0000000 0000000 00000000204 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002222 13114114276 035133 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000220 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002151 13114114276 035134 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_1_empty_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002037 13114114276 035137 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000205 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_1_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002064 13114114276 035137 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000227 13114114276 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_1_referral_and_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002240 13114114276 035133 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000205 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002436 13114114276 035142 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000206 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_2_referrals.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002143 13114114276 035135 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ldap://www.apple.com ././@LongLink0100644 0000000 0000000 00000000223 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002335 13114114276 035140 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000216 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_empty_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002047 13114114276 035140 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000210 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002163 13114114276 035137 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ././@LongLink0100644 0000000 0000000 00000000216 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002062 13114114276 035135 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000216 13114114276 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002000 13114114276 035125 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000214 13114114276 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000001777 13114114276 035151 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002004 13114114276 035131 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000222 13114114276 011627 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_result_code_not_integer.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002010 13114114276 035126 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_wrong_descr.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000001775 13114114276 035147 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000224 13114114276 011631 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_with_wrong_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000002044 13114114276 035135 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000211 13114114276 011625 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyResponse/response_without_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/modifyRespo0100644 0000767 0000024 00000001725 13114114276 035142 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000204 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_and.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002311 13114114300 035065 0ustar00elecharnystaff0000000 0000000 foobar foobar ././@LongLink0100644 0000000 0000000 00000000214 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_approxMatch.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002151 13114114300 035067 0ustar00elecharnystaff0000000 0000000 foobar ././@LongLink0100644 0000000 0000000 00000000231 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_approxMatch_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002426 13114114300 035074 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000232 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_approxMatch_with_2_values.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002203 13114114300 035065 0ustar00elecharnystaff0000000 0000000 foobar foobar ././@LongLink0100644 0000000 0000000 00000000235 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_approxMatch_with_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002143 13114114300 035070 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000231 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_approxMatch_without_name.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002137 13114114300 035073 0ustar00elecharnystaff0000000 0000000 foobar ././@LongLink0100644 0000000 0000000 00000000232 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_approxMatch_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002105 13114114300 035066 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000216 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_equalityMatch.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002155 13114114300 035073 0ustar00elecharnystaff0000000 0000000 foobar ././@LongLink0100644 0000000 0000000 00000000233 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_equalityMatch_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002432 13114114300 035071 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000234 13114114277 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_equalityMatch_with_2_values.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002207 13114114277 035106 0ustar00elecharnystaff0000000 0000000 foobar foobar ././@LongLink0100644 0000000 0000000 00000000237 13114114300 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_equalityMatch_with_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002147 13114114300 035074 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000233 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_equalityMatch_without_name.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002143 13114114300 035070 0ustar00elecharnystaff0000000 0000000 foobar ././@LongLink0100644 0000000 0000000 00000000234 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_equalityMatch_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002111 13114114300 035063 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000220 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002150 13114114300 035066 0ustar00elecharnystaff0000000 0000000 A Value ././@LongLink0100644 0000000 0000000 00000000235 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002424 13114114300 035072 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000236 13114114300 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_with_2_values.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002203 13114114300 035065 0ustar00elecharnystaff0000000 0000000 A Value A Value ././@LongLink0100644 0000000 0000000 00000000244 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_with_dnAttributes_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002171 13114114300 035071 0ustar00elecharnystaff0000000 0000000 A Value ././@LongLink0100644 0000000 0000000 00000000244 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_with_dnAttributes_1.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002171 13114114300 035071 0ustar00elecharnystaff0000000 0000000 A Value ././@LongLink0100644 0000000 0000000 00000000250 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_with_dnAttributes_error.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002175 13114114300 035075 0ustar00elecharnystaff0000000 0000000 A Value ././@LongLink0100644 0000000 0000000 00000000250 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_with_dnAttributes_false.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002175 13114114300 035075 0ustar00elecharnystaff0000000 0000000 A Value ././@LongLink0100644 0000000 0000000 00000000247 13114114300 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_with_dnAttributes_true.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002174 13114114300 035074 0ustar00elecharnystaff0000000 0000000 A Value ././@LongLink0100644 0000000 0000000 00000000241 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_with_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002162 13114114300 035071 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000242 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_with_matchingRule.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002211 13114114300 035064 0ustar00elecharnystaff0000000 0000000 A Value ././@LongLink0100644 0000000 0000000 00000000232 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_with_name.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002171 13114114300 035071 0ustar00elecharnystaff0000000 0000000 A Value ././@LongLink0100644 0000000 0000000 00000000236 13114114300 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_extensibleMatch_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002115 13114114300 035067 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000217 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_greaterOrEqual.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002157 13114114300 035075 0ustar00elecharnystaff0000000 0000000 foobar ././@LongLink0100644 0000000 0000000 00000000234 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_greaterOrEqual_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002434 13114114300 035073 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000235 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_greaterOrEqual_with_2_values.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002211 13114114300 035064 0ustar00elecharnystaff0000000 0000000 foobar foobar ././@LongLink0100644 0000000 0000000 00000000240 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_greaterOrEqual_with_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002151 13114114300 035067 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000234 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_greaterOrEqual_without_name.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002145 13114114300 035072 0ustar00elecharnystaff0000000 0000000 foobar ././@LongLink0100644 0000000 0000000 00000000235 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_greaterOrEqual_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002113 13114114300 035065 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000214 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_lessOrEqual.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002151 13114114300 035067 0ustar00elecharnystaff0000000 0000000 foobar ././@LongLink0100644 0000000 0000000 00000000231 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_lessOrEqual_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002426 13114114300 035074 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000232 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_lessOrEqual_with_2_values.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002203 13114114300 035065 0ustar00elecharnystaff0000000 0000000 foobar foobar ././@LongLink0100644 0000000 0000000 00000000235 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_lessOrEqual_with_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002143 13114114300 035070 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000231 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_lessOrEqual_without_name.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002137 13114114300 035073 0ustar00elecharnystaff0000000 0000000 foobar ././@LongLink0100644 0000000 0000000 00000000232 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_lessOrEqual_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002105 13114114300 035066 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000227 13114114300 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_nested_connector_nodes.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002510 13114114300 035066 0ustar00elecharnystaff0000000 0000000 foo foo josopuram k ././@LongLink0100644 0000000 0000000 00000000204 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_not.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002177 13114114300 035077 0ustar00elecharnystaff0000000 0000000 foobar ././@LongLink0100644 0000000 0000000 00000000224 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_not_with_2_children.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002311 13114114300 035065 0ustar00elecharnystaff0000000 0000000 foobar foobar ././@LongLink0100644 0000000 0000000 00000000203 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_or.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002175 13114114300 035075 0ustar00elecharnystaff0000000 0000000 foobar ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_present.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002116 13114114300 035070 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000225 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_present_without_name.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002075 13114114300 035074 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000213 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002115 13114114300 035067 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000221 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_any.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002141 13114114300 035066 0ustar00elecharnystaff0000000 0000000 kate ././@LongLink0100644 0000000 0000000 00000000231 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_any_1_final.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002171 13114114300 035071 0ustar00elecharnystaff0000000 0000000 kate john ././@LongLink0100644 0000000 0000000 00000000230 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_base64_any.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002421 13114114300 035067 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000232 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_base64_final.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002424 13114114300 035072 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000234 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_base64_initial.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002431 13114114300 035070 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== ././@LongLink0100644 0000000 0000000 00000000227 13114114300 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_empty_any.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002135 13114114300 035071 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000231 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_empty_final.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002141 13114114300 035066 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000233 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_empty_initial.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002145 13114114300 035072 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000223 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_final.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002145 13114114300 035072 0ustar00elecharnystaff0000000 0000000 john ././@LongLink0100644 0000000 0000000 00000000225 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_initial.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002151 13114114300 035067 0ustar00elecharnystaff0000000 0000000 jack ././@LongLink0100644 0000000 0000000 00000000233 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_initial_1_any.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002175 13114114300 035075 0ustar00elecharnystaff0000000 0000000 jack kate ././@LongLink0100644 0000000 0000000 00000000235 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_1_initial_1_final.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002201 13114114300 035063 0ustar00elecharnystaff0000000 0000000 jack john ././@LongLink0100644 0000000 0000000 00000000221 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_2_any.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002167 13114114300 035076 0ustar00elecharnystaff0000000 0000000 kate sawyer ././@LongLink0100644 0000000 0000000 00000000230 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/filters/request_with_substrings_without_name.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002103 13114114300 035064 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000202 13114114277 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002373 13114114277 035112 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000217 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_1_control_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002605 13114114300 035073 0ustar00elecharnystaff0000000 0000000 RFNNTHYyLjAgcm9ja3MhIQ== toto ././@LongLink0100644 0000000 0000000 00000000216 13114114277 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002322 13114114277 035104 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000216 13114114277 011633 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_2_attributes_elements.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002471 13114114277 035111 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000203 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002627 13114114300 035077 0ustar00elecharnystaff0000000 0000000 Some text Some other text toto ././@LongLink0100644 0000000 0000000 00000000202 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_2_filters.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002303 13114114300 035066 0ustar00elecharnystaff0000000 0000000 toto toto ././@LongLink0100644 0000000 0000000 00000000221 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002507 13114114300 035074 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000231 13114114277 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_attribute_without_name_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002453 13114114277 035111 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000217 13114114277 011634 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_attributes_1_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002464 13114114277 035113 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000217 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_attributes_2_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002525 13114114300 035074 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000224 13114114277 011632 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_attributes_but_no_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002432 13114114277 035106 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000221 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_derefAliases_derefAlways.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002365 13114114300 035076 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000231 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_derefAliases_derefFindingBaseObj.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002375 13114114300 035077 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000226 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_derefAliases_derefInSearching.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002372 13114114300 035074 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000213 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_derefAliases_error.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002357 13114114300 035077 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000227 13114114277 011635 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_derefAliases_neverDerefAliases.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002373 13114114277 035112 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000205 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002150 13114114300 035066 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000205 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_empty_filter.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002266 13114114300 035076 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000211 13114114277 011626 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_needed_requestID.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002227 13114114277 035110 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000214 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002174 13114114300 035074 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000212 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002173 13114114300 035073 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000211 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_scope_baseObject.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002373 13114114300 035075 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000204 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_scope_error.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002366 13114114300 035077 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000212 13114114300 011612 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_scope_singleLevel.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002374 13114114300 035076 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000213 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_scope_wholeSubtree.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002375 13114114300 035077 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000214 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_sizeLimit_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002175 13114114300 035075 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_sizeLimit_error.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002176 13114114300 035076 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000214 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_timeLimit_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002173 13114114300 035073 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_timeLimit_error.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002176 13114114300 035076 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000204 13114114277 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_typesOnly_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002171 13114114277 035106 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000204 13114114277 011630 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_typesOnly_1.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002171 13114114277 035106 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_typesOnly_error.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002175 13114114300 035075 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_typesOnly_false.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002175 13114114300 035075 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000207 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_with_typesOnly_true.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002174 13114114300 035074 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000222 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_without_derefAliases_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002326 13114114300 035073 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000210 13114114300 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_without_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002076 13114114300 035075 0ustar00elecharnystaff0000000 0000000 toto ././@LongLink0100644 0000000 0000000 00000000202 13114114300 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_without_filter.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002240 13114114300 035066 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000213 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRequest/request_without_scope_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchReque0100644 0000767 0000024 00000002344 13114114300 035073 0ustar00elecharnystaff0000000 0000000 Some text toto ././@LongLink0100644 0000000 0000000 00000000200 13114114301 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_0_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000001706 13114114301 035104 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_0_SRE_1_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002044 13114114300 035077 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000200 13114114301 011610 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_1_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002033 13114114301 035076 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000206 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_1_SRE_0_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002317 13114114301 035103 0ustar00elecharnystaff0000000 0000000 example top domain extensibleObject ././@LongLink0100644 0000000 0000000 00000000206 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_1_SRE_1_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002444 13114114300 035103 0ustar00elecharnystaff0000000 0000000 example top domain extensibleObject ././@LongLink0100644 0000000 0000000 00000000214 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_1_SRE_1_SRR_1_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002570 13114114301 035104 0ustar00elecharnystaff0000000 0000000 example top domain extensibleObject ldap://localhost ././@LongLink0100644 0000000 0000000 00000000206 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_1_SRR_0_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002032 13114114301 035075 0ustar00elecharnystaff0000000 0000000 ldap://localhost ././@LongLink0100644 0000000 0000000 00000000206 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_1_SRR_1_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002157 13114114301 035105 0ustar00elecharnystaff0000000 0000000 ldap://localhost ././@LongLink0100644 0000000 0000000 00000000206 13114114300 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_2_SRE_1_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000003102 13114114300 035073 0ustar00elecharnystaff0000000 0000000 example top domain extensibleObject person top snvalue Bob Rush ././@LongLink0100644 0000000 0000000 00000000214 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_2_SRE_2_SRR_1_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000003365 13114114301 035107 0ustar00elecharnystaff0000000 0000000 example top domain extensibleObject person top snvalue Bob Rush ldap://localhost ldap://ldap.apache.org ././@LongLink0100644 0000000 0000000 00000000206 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_2_SRR_1_SRD.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002311 13114114301 035075 0ustar00elecharnystaff0000000 0000000 ldap://localhost ldap://ldap.apache.org ././@LongLink0100644 0000000 0000000 00000000216 13114114300 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002053 13114114300 035077 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000214 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002052 13114114301 035077 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000225 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002262 13114114301 035102 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000241 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002211 13114114301 035074 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000234 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_1_empty_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002075 13114114301 035104 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000226 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_1_referral.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002122 13114114300 035074 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000250 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_1_referral_and_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002277 13114114301 035110 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000226 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002520 13114114300 035076 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000227 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_2_referrals.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002202 13114114301 035074 0ustar00elecharnystaff0000000 0000000 ldap://www.apache.org ldap://www.apple.com ././@LongLink0100644 0000000 0000000 00000000244 13114114301 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002400 13114114301 035074 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000237 13114114300 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_empty_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002106 13114114300 035076 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000231 13114114300 011613 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_error_message.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002222 13114114300 035075 0ustar00elecharnystaff0000000 0000000 Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2 ././@LongLink0100644 0000000 0000000 00000000237 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002117 13114114301 035101 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000237 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002302 13114114301 035075 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000235 13114114300 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002301 13114114300 035073 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000227 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002042 13114114301 035076 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000243 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_result_code_not_integer.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002046 13114114301 035102 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000227 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_wrong_descr.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002032 13114114301 035075 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000245 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_with_wrong_matchedDN_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002101 13114114301 035072 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000232 13114114300 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultDone/response_without_result_code.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000001761 13114114300 035104 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000223 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_0_attr.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002137 13114114301 035103 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000233 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_1_attr_0_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002177 13114114301 035107 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000242 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_1_attr_1_base64_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002473 13114114301 035106 0ustar00elecharnystaff0000000 0000000 RW1tYW51ZWwgTMOpY2hhcm55 ././@LongLink0100644 0000000 0000000 00000000241 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_1_attr_1_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002222 13114114301 035076 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000233 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_1_attr_1_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002231 13114114301 035076 0ustar00elecharnystaff0000000 0000000 example ././@LongLink0100644 0000000 0000000 00000000233 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_1_attr_2_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002301 13114114301 035074 0ustar00elecharnystaff0000000 0000000 top domain ././@LongLink0100644 0000000 0000000 00000000252 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_1_attr_without_name_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002164 13114114301 035103 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000226 13114114301 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002366 13114114301 035107 0ustar00elecharnystaff0000000 0000000 Some text ././@LongLink0100644 0000000 0000000 00000000242 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002315 13114114301 035101 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000233 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_2_attr_1_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002341 13114114301 035100 0ustar00elecharnystaff0000000 0000000 example top ././@LongLink0100644 0000000 0000000 00000000227 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002624 13114114301 035104 0ustar00elecharnystaff0000000 0000000 Some text Some other text ././@LongLink0100644 0000000 0000000 00000000245 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002506 13114114301 035103 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000231 13114114301 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002137 13114114301 035103 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000240 13114114301 011614 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002157 13114114301 035105 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000236 13114114301 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002156 13114114301 035104 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000237 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_with_wrong_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002140 13114114301 035075 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000234 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultEntry/response_without_dn_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002110 13114114301 035072 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000226 13114114301 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_0_ref.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002120 13114114301 035073 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000232 13114114301 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_1_control.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002406 13114114301 035102 0ustar00elecharnystaff0000000 0000000 Some text ldap://localhost ././@LongLink0100644 0000000 0000000 00000000246 13114114301 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_1_control_empty_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002335 13114114301 035103 0ustar00elecharnystaff0000000 0000000 ldap://localhost ././@LongLink0100644 0000000 0000000 00000000234 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_1_empty_ref.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002142 13114114301 035077 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000226 13114114301 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_1_ref.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002162 13114114301 035101 0ustar00elecharnystaff0000000 0000000 ldap://localhost ././@LongLink0100644 0000000 0000000 00000000234 13114114301 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_1_wrong_ref.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002174 13114114301 035104 0ustar00elecharnystaff0000000 0000000 http://thisIsAWrongRef.com ././@LongLink0100644 0000000 0000000 00000000233 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_2_controls.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002644 13114114301 035106 0ustar00elecharnystaff0000000 0000000 Some text Some other text ldap://localhost ././@LongLink0100644 0000000 0000000 00000000226 13114114301 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_2_ref.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002226 13114114301 035102 0ustar00elecharnystaff0000000 0000000 ldap://localhost ldap://www.apache.org ././@LongLink0100644 0000000 0000000 00000000251 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_3_controls_without_value.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002526 13114114301 035105 0ustar00elecharnystaff0000000 0000000 ldap://localhost ././@LongLink0100644 0000000 0000000 00000000244 13114114301 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_requestID_attribute.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002177 13114114301 035107 0ustar00elecharnystaff0000000 0000000 ldap://localhost ././@LongLink0100644 0000000 0000000 00000000242 13114114301 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchResponse/searchResultReference/response_with_requestID_below_0.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/searchRespo0100644 0000767 0000024 00000002176 13114114301 035106 0ustar00elecharnystaff0000000 0000000 ldap://localhost ././@LongLink0100644 0000000 0000000 00000000210 13114114276 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/soap/soap-dsml-multiple-operation-requests.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/soap/soap-d0100644 0000767 0000024 00000003151 13114114276 034762 0ustar00elecharnystaff0000000 0000000 admin inetOrgPerson ././@LongLink0100644 0000000 0000000 00000000174 13114114276 011635 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/soap/soap-dsml-req-with-header.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/soap/soap-d0100644 0000767 0000024 00000003141 13114114276 034761 0ustar00elecharnystaff0000000 0000000 5 admin ././@LongLink0100644 0000000 0000000 00000000177 13114114276 011640 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/soap/soap-dsml-req-without-header.xmlapache-ldap-api-1.0.0-src/dsml/parser/src/test/resources/org/apache/directory/api/dsmlv2/soap/soap-d0100644 0000767 0000024 00000002571 13114114276 034767 0ustar00elecharnystaff0000000 0000000 admin apache-ldap-api-1.0.0-src/dsml/pom.xml0100644 0000767 0000024 00000002762 13114114275 021165 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-parent 1.0.0 api-dsml-parent Apache Directory LDAP API DSML Parent 2003 pom engine parser apache-ldap-api-1.0.0-src/dsml/src/site/site.xml0100644 0000767 0000024 00000002044 13114114275 023062 0ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/META-INF/MANIFEST.MF0100644 0000767 0000024 00000002061 13114114350 022244 0ustar00elecharnystaff0000000 0000000 Manifest-Version: 1.0 Bnd-LastModified: 1496357096181 Build-Jdk: 1.8.0_102 Built-By: elecharny Bundle-Description: Internationalization of errors and other messages Bundle-DocURL: https://www.apache.org/ Bundle-License: https://www.apache.org/licenses/LICENSE-2.0.txt Bundle-ManifestVersion: 2 Bundle-Name: Apache Directory LDAP API I18n Bundle-SymbolicName: org.apache.directory.api.i18n Bundle-Vendor: The Apache Software Foundation Bundle-Version: 1.0.0 Created-By: Apache Maven Bundle Plugin Export-Package: org.apache.directory.api.i18n;version="1.0.0" Implementation-Title: Apache Directory LDAP API I18n Implementation-URL: http://directory.apache.org/api-parent/api-i18n/ Implementation-Vendor: The Apache Software Foundation Implementation-Vendor-Id: org.apache.directory.api Implementation-Version: 1.0.0 Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))" Specification-Title: Apache Directory LDAP API I18n Specification-Vendor: The Apache Software Foundation Specification-Version: 1.0.0 Tool: Bnd-3.3.0.201609221906 apache-ldap-api-1.0.0-src/i18n/pom.xml0100644 0000767 0000024 00000005102 13114114303 020764 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-parent 1.0.0 api-i18n Apache Directory LDAP API I18n bundle Internationalization of errors and other messages 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-ldap-api-1.0.0-src/i18n/src/checkstyle/suppressions.xml0100644 0000767 0000024 00000002043 13114114303 025674 0ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/i18n/src/main/java/org/apache/directory/api/i18n/I18n.java0100644 0000767 0000024 00000074351 13114114303 031045 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 { // asn1 ERR_00001_BAD_TRANSITION_FROM_STATE("ERR_00001_BAD_TRANSITION_FROM_STATE"), ERR_00002_BAD_TRANSITION("ERR_00002_BAD_TRANSITION"), ERR_00003_CANNOT_PUT_PDU_IN_NULL_BUFFER("ERR_00003_CANNOT_PUT_PDU_IN_NULL_BUFFER"), ERR_00004_PDU_BUFFER_SIZE_TOO_SMALL("ERR_00004_PDU_BUFFER_SIZE_TOO_SMALL"), ERR_00005_LENGTH_OVERFLOW("ERR_00005_LENGTH_OVERFLOW"), ERR_00006_LENGTH_EXTENSION_RESERVED("ERR_00006_LENGTH_EXTENSION_RESERVED"), ERR_00007_TLV_NULL("ERR_00007_TLV_NULL"), ERR_00008_VALUE_LENGTH_ABOVE_EXPECTED_LENGTH("ERR_00008_VALUE_LENGTH_ABOVE_EXPECTED_LENGTH"), ERR_00009_MORE_TLV_EXPECTED("ERR_00009_MORE_TLV_EXPECTED"), ERR_00010_TRUNCATED_PDU("ERR_00010_TRUNCATED_PDU"), ERR_00011_LENGTH_TOO_LONG_FOR_DEFINITE_FORM("ERR_00011_LENGTH_TOO_LONG_FOR_DEFINITE_FORM"), ERR_00013_ODD_NUM_OF_CHARS("ERR_00013_ODD_NUM_OF_CHARS"), ERR_00014_ILLEGAL_HEX_CHAR("ERR_00014_ILLEGAL_HEX_CHAR"), ERR_00016_END_OF_STREAM("ERR_00016_END_OF_STREAM"), ERR_00017_EOF_FOUND_LENGTH_EXPECTED("ERR_00017_EOF_FOUND_LENGTH_EXPECTED"), ERR_00018_DER_LENGTH_ABOVE_4_BYTES("ERR_00018_DER_LENGTH_ABOVE_4_BYTES"), ERR_00019_EOF_FOUND_IN_LENGTH("ERR_00019_EOF_FOUND_IN_LENGTH"), ERR_00020_CORRUPTED_STREAM("ERR_00020_CORRUPTED_STREAM"), ERR_00021_EOF_FOUND_IN_OBJECT("ERR_00021_EOF_FOUND_IN_OBJECT"), ERR_00022_READ_PAST_END_OF_FILE("ERR_00022_READ_PAST_END_OF_FILE"), ERR_00023_UNKNOWN_BER_OBJECT("ERR_00023_UNKNOWN_BER_OBJECT"), ERR_00024_OBJECT_NOT_DER_ENCODABLE("ERR_00024_OBJECT_NOT_DER_ENCODABLE"), ERR_00025_DER_OCTET_STRING_EXPECTED("ERR_DER_OCTET_STRING_EXPECTED_00025"), ERR_00026_CANNOT_CONVERT_OCTETS("ERR_00026_CANNOT_CONVERT_OCTETS"), ERR_00027_NOT_IMPLEMENTED("ERR_00027_NOT_IMPLEMENTED"), ERR_00028_INTERNAL_ERROR_ENCODING_BITSTRING("ERR_00028_INTERNAL_ERROR_ENCODING_BITSTRING"), ERR_00029_NULL_OR_NEG_LENGTH_NOT_ALLOWED("ERR_00029_NULL_OR_NEG_LENGTH_NOT_ALLOWED"), ERR_00030_BIT_NUMBER_OUT_OF_BOUND("ERR_00030_BIT_NUMBER_OUT_OF_BOUND"), ERR_00031_CANNOT_FIND_BIT("ERR_00031_CANNOT_FIND_BIT"), ERR_00032_NULL_OID("ERR_00032_NULL_OID"), ERR_00033_INVALID_OID("ERR_00033_INVALID_OID"), ERR_00034_0_BYTES_LONG_BOOLEAN("ERR_00034_0_BYTES_LONG_BOOLEAN"), ERR_00035_N_BYTES_LONG_BOOLEAN("ERR_00035_N_BYTES_LONG_BOOLEAN"), ERR_00036_0_BYTES_LONG_INTEGER("ERR_00036_0_BYTES_LONG_INTEGER"), ERR_00037_ABOVE_4_BYTES_INTEGER("ERR_00037_ABOVE_4_BYTES_INTEGER"), ERR_00038_VALUE_NOT_IN_RANGE("ERR_00038_VALUE_NOT_IN_RANGE"), ERR_00039_0_BYTES_LONG_LONG("ERR_00039_0_BYTES_LONG_LONG"), ERR_00041_CURRENT_LENGTH_EXCEED_EXPECTED_LENGTH("ERR_00041_CURRENT_LENGTH_EXCEED_EXPECTED_LENGTH"), ERR_00042_PDU_SIZE_TOO_LONG("ERR_00042_PDU_SIZE_TOO_LONG"), ERR_00043_REMAINING_BYTES_FOR_DECODED_PDU("ERR_00043_REMAINING_BYTES_FOR_DECODED_PDU"), // cursor ERR_02001_MONITOR("ERR_02001_MONITOR"), ERR_02002_FAILURE_ON_UNDERLYING_CURSOR("ERR_02002_FAILURE_ON_UNDERLYING_CURSOR"), ERR_02003_REMOVAL_NOT_SUPPORTED("ERR_02003_REMOVAL_NOT_SUPPORTED"), ERR_02004_EMPTY_CURSOR("ERR_02004_EMPTY_CURSOR"), ERR_02005_START_INDEX_OUT_OF_RANGE("ERR_02005_START_INDEX_OUT_OF_RANGE"), ERR_02006_END_INDEX_OUT_OF_RANGE("ERR_02006_END_INDEX_OUT_OF_RANGE"), ERR_02007_START_INDEX_ABOVE_END_INDEX("ERR_02007_START_INDEX_ABOVE_END_INDEX"), ERR_02008_LIST_MAY_BE_SORTED("ERR_02008_LIST_MAY_BE_SORTED"), ERR_02009_CURSOR_NOT_POSITIONED("ERR_02009_CURSOR_NOT_POSITIONED"), ERR_02010_NO_COMPARATOR_CANT_MOVE_BEFORE("ERR_02010_NO_COMPARATOR_CANT_MOVE_BEFORE"), ERR_02011_NO_COMPARATOR_CANT_MOVE_AFTER("ERR_02011_NO_COMPARATOR_CANT_MOVE_AFTER"), ERR_02012_CANNOT_ACCESS_IF_BEFORE_FIRST("ERR_02012_CANNOT_ACCESS_IF_BEFORE_FIRST"), ERR_02013_CANNOT_ACCESS_IF_AFTER_LAST("ERR_02013_CANNOT_ACCESS_IF_AFTER_LAST"), ERR_02014_UNSUPPORTED_OPERATION("ERR_02014_UNSUPPORTED_OPERATION"), // dsml-parser ERR_03001("ERR_03001"), ERR_03002("ERR_03002"), ERR_03003("ERR_03003"), ERR_03004("ERR_03004"), ERR_03005("ERR_03005"), ERR_03006("ERR_03006"), ERR_03007("ERR_03007"), ERR_03008("ERR_03008"), ERR_03009("ERR_03009"), ERR_03010("ERR_03010"), ERR_03011("ERR_03011"), ERR_03012("ERR_03012"), ERR_03013("ERR_03013"), ERR_03014("ERR_03014"), ERR_03015("ERR_03015"), ERR_03016("ERR_03016"), ERR_03017("ERR_03017"), ERR_03018("ERR_03018"), ERR_03019("ERR_03019"), ERR_03020("ERR_03020"), ERR_03021("ERR_03021"), ERR_03022("ERR_03022"), ERR_03023("ERR_03023"), ERR_03024("ERR_03024"), ERR_03025("ERR_00025"), ERR_03026("ERR_03026"), ERR_03027("ERR_03027"), ERR_03028("ERR_03028"), ERR_03029("ERR_03029"), ERR_03030("ERR_03030"), ERR_03031("ERR_03031"), ERR_03032("ERR_03032"), ERR_03033("ERR_03033"), ERR_03034("ERR_03034"), ERR_03035("ERR_03035"), ERR_03036("ERR_03036"), ERR_03037("ERR_03037"), ERR_03038("ERR_03038"), ERR_03039("ERR_03039"), ERR_03040("ERR_03040"), // dsml-engine ERR_03101_MISSING_CONNECTION_TO("ERR_03101_MISSING_CONNECTION_TO"), // ldap ERR_04001_NULL_IDENTIFICATION_TAG("ERR_04001_NULL_IDENTIFICATION_TAG"), ERR_04002_BAD_PRECENDENCE("ERR_04002_BAD_PRECENDENCE"), ERR_04003_NULL_AUTHENTICATION_LEVEL("ERR_04003_NULL_AUTHENTICATION_LEVEL"), ERR_04004_PARSER_FAILURE_ACI_ITEM("ERR_04004_PARSER_FAILURE_ACI_ITEM"), ERR_04005("ERR_04005"), ERR_04006("ERR_04006"), ERR_04007("ERR_04007"), ERR_04008("ERR_04008"), ERR_04009("ERR_04009"), ERR_04010("ERR_04010"), ERR_04011("ERR_04011"), ERR_04012("ERR_04012"), ERR_04013("ERR_04013"), ERR_04014("ERR_04014"), ERR_04015("ERR_04015"), ERR_04016("ERR_04016"), ERR_04017("ERR_04017"), ERR_04018("ERR_04018"), ERR_04019("ERR_04019"), ERR_04020("ERR_04020"), ERR_04021("ERR_04021"), ERR_04022("ERR_04022"), ERR_04023("ERR_04023"), ERR_04024("ERR_04024"), ERR_04025("ERR_04025"), ERR_04026("ERR_04026"), ERR_04027("ERR_04027"), ERR_04028("ERR_04028"), ERR_04029("ERR_04029"), ERR_04030("ERR_04030"), ERR_04031("ERR_04031"), ERR_04032("ERR_04032"), ERR_04033("ERR_04033"), ERR_04034("ERR_04034"), ERR_04035("ERR_04035"), ERR_04036("ERR_04036"), ERR_04037("ERR_04037"), ERR_04038("ERR_04038"), ERR_04039("ERR_04039"), ERR_04040("ERR_04040"), ERR_04041("ERR_04041"), ERR_04042("ERR_04042"), ERR_04043("ERR_04043"), ERR_04044("ERR_04044"), ERR_04045("ERR_04045"), ERR_04046("ERR_04046"), ERR_04047("ERR_04047"), ERR_04048("ERR_04048"), ERR_04049("ERR_04049"), ERR_04050("ERR_04050"), ERR_04051("ERR_04051"), ERR_04052("ERR_04052"), ERR_04053("ERR_04053"), ERR_04054("ERR_04054"), ERR_04055("ERR_04055"), ERR_04056("ERR_04056"), ERR_04057("ERR_04057"), ERR_04058("ERR_04058"), ERR_04059("ERR_04059"), ERR_04060("ERR_04060"), ERR_04061("ERR_04061"), ERR_04062("ERR_04062"), ERR_04063("ERR_04063"), ERR_04064("ERR_04064"), ERR_04065("ERR_04065"), ERR_04066("ERR_04066"), ERR_04067("ERR_04067"), ERR_04068("ERR_04068"), ERR_04069("ERR_04069"), ERR_04070("ERR_04070"), ERR_04071("ERR_04071"), ERR_04072("ERR_04072"), ERR_04073("ERR_04073"), ERR_04074("ERR_04074"), ERR_04075("ERR_04075"), ERR_04076("ERR_04076"), ERR_04077("ERR_04077"), ERR_04078("ERR_04078"), ERR_04079("ERR_04079"), ERR_04080("ERR_04080"), ERR_04081("ERR_04081"), ERR_04082("ERR_04082"), ERR_04083("ERR_04083"), ERR_04084("ERR_04084"), ERR_04085("ERR_04085"), ERR_04086("ERR_04086"), ERR_04087("ERR_04087"), ERR_04088("ERR_04088"), ERR_04089("ERR_04089"), ERR_04090("ERR_04090"), ERR_04091("ERR_04091"), ERR_04092("ERR_04092"), ERR_04093("ERR_04093"), ERR_04094("ERR_04094"), ERR_04095("ERR_04095"), ERR_04096("ERR_04096"), ERR_04097("ERR_04097"), ERR_04098("ERR_04098"), ERR_04099("ERR_04099"), ERR_04100("ERR_04100"), ERR_04101("ERR_04101"), ERR_04102("ERR_04102"), ERR_04103("ERR_04103"), ERR_04104("ERR_04104"), ERR_04105("ERR_04105"), ERR_04106("ERR_04106"), ERR_04107("ERR_04107"), ERR_04108("ERR_04108"), ERR_04109("ERR_04109"), ERR_04110("ERR_04110"), ERR_04111("ERR_04111"), ERR_04112("ERR_04112"), ERR_04113("ERR_04113"), ERR_04114("ERR_04114"), ERR_04115("ERR_04115"), ERR_04116("ERR_04116"), ERR_04117("ERR_04117"), ERR_04118("ERR_04118"), ERR_04119("ERR_04119"), ERR_04120("ERR_04120"), ERR_04121("ERR_04121"), ERR_04122("ERR_04122"), ERR_04123("ERR_04123"), ERR_04124("ERR_04124"), ERR_04125("ERR_04125"), ERR_04126("ERR_04126"), ERR_04127("ERR_04127"), ERR_04128("ERR_04128"), ERR_04129("ERR_04129"), ERR_04130("ERR_04130"), ERR_04131("ERR_04131"), ERR_04132("ERR_04132"), ERR_04133("ERR_04133"), ERR_04134("ERR_04134"), ERR_04135("ERR_04135"), ERR_04136("ERR_04136"), ERR_04137("ERR_04137"), ERR_04138("ERR_04138"), ERR_04139("ERR_04139"), ERR_04140_UNACCEPTABLE_RESULT_CODE("ERR_04140_UNACCEPTABLE_RESULT_CODE"), ERR_04141("ERR_04141"), ERR_04142("ERR_04142"), ERR_04143("ERR_04143"), ERR_04144("ERR_04144"), ERR_04145("ERR_04145"), ERR_04146("ERR_04146"), ERR_04147("ERR_04147"), ERR_04148("ERR_04148"), ERR_04149("ERR_04149"), ERR_04150("ERR_04150"), ERR_04151("ERR_04151"), ERR_04152("ERR_04152"), ERR_04153("ERR_04153"), ERR_04154("ERR_04154"), ERR_04155("ERR_04155"), ERR_04156("ERR_04156"), ERR_04157("ERR_04157"), ERR_04158("ERR_04158"), ERR_04159("ERR_04159"), ERR_04160("ERR_04160"), ERR_04161("ERR_04161"), ERR_04162("ERR_04162"), ERR_04163("ERR_04163"), ERR_04164("ERR_04164"), ERR_04165("ERR_04165"), ERR_04166("ERR_04166"), ERR_04167("ERR_04167"), ERR_04168("ERR_04168"), ERR_04169("ERR_04169"), ERR_04170("ERR_04170"), ERR_04171("ERR_04171"), ERR_04172("ERR_04172"), ERR_04173("ERR_04173"), ERR_04174("ERR_04174"), ERR_04175("ERR_04175"), ERR_04176("ERR_04176"), ERR_04177("ERR_04177"), ERR_04178("ERR_04178"), ERR_04179("ERR_04179"), ERR_04180("ERR_04180"), ERR_04181("ERR_04181"), ERR_04182("ERR_04182"), ERR_04183("ERR_04183"), ERR_04184("ERR_04184"), ERR_04185("ERR_04185"), ERR_04186("ERR_04186"), ERR_04187("ERR_04187"), ERR_04188("ERR_04188"), ERR_04189("ERR_04189"), ERR_04190("ERR_04190"), ERR_04191("ERR_04191"), ERR_04192("ERR_04192"), ERR_04193("ERR_04193"), ERR_04194("ERR_04194"), ERR_04195("ERR_04195"), ERR_04196("ERR_04196"), ERR_04197("ERR_04197"), ERR_04198("ERR_04198"), ERR_04199("ERR_04199"), ERR_04200("ERR_04200"), ERR_04201("ERR_04201"), ERR_04202("ERR_04202"), ERR_04203("ERR_04203"), ERR_04204("ERR_04204"), ERR_04205("ERR_04205"), ERR_04206("ERR_04206"), ERR_04207("ERR_04207"), ERR_04208("ERR_04208"), ERR_04209_EMPTY_TYPE_NOT_ALLOWED("ERR_04209_EMPTY_TYPE_NOT_ALLOWED"), ERR_04210("ERR_04210"), ERR_04211("ERR_04211"), ERR_04212("ERR_04212"), ERR_04213("ERR_04213"), ERR_04214("ERR_04214"), ERR_04215("ERR_04215"), ERR_04216("ERR_04216"), ERR_04217("ERR_04217"), ERR_04218("ERR_04218"), ERR_04219_ARGUMENT1_NULL("ERR_04219_ARGUMENT1_NULL"), ERR_04220_ARGUMENT2_NULL("ERR_04220_ARGUMENT2_NULL"), ERR_04221("ERR_04221"), ERR_04222("ERR_04222"), ERR_04223("ERR_04223"), ERR_04224("ERR_04224"), ERR_04225("ERR_04225"), ERR_04226("ERR_04226"), ERR_04227("ERR_04227"), ERR_04228("ERR_04228"), ERR_04229("ERR_04229"), ERR_04230("ERR_04230"), ERR_04231("ERR_04231"), ERR_04232("ERR_04232"), ERR_04233("ERR_04233"), ERR_04234("ERR_04234"), ERR_04235("ERR_04235"), ERR_04236("ERR_04236"), ERR_04237("ERR_04237"), ERR_04238("ERR_04238"), ERR_04239("ERR_04239"), ERR_04240("ERR_04240"), ERR_04241("ERR_04241"), ERR_04242("ERR_04242"), ERR_04243("ERR_04243"), ERR_04244("ERR_04244"), ERR_04245("ERR_04245"), ERR_04246("ERR_04246"), ERR_04247("ERR_04247"), ERR_04248("ERR_04248"), ERR_04249("ERR_04249"), ERR_04250("ERR_04250"), ERR_04251("ERR_04251"), ERR_04252("ERR_04252"), ERR_04253("ERR_04253"), ERR_04254("ERR_04254"), ERR_04255("ERR_04255"), ERR_04256("ERR_04256"), ERR_04257("ERR_04257"), ERR_04258("ERR_04258"), ERR_04259("ERR_04259"), ERR_04260("ERR_04260"), ERR_04261("ERR_04261"), ERR_04262("ERR_04262"), ERR_04263("ERR_04263"), ERR_04264("ERR_04264"), ERR_04265("ERR_04265"), ERR_04266("ERR_04266"), ERR_04267("ERR_04267"), ERR_04268_OID_NOT_FOUND("ERR_04268_OID_NOT_FOUND"), ERR_04269("ERR_04269"), ERR_04270("ERR_04270"), ERR_04271("ERR_04271"), ERR_04272("ERR_04272"), ERR_04273("ERR_04273"), ERR_04274("ERR_04274"), ERR_04275("ERR_04275"), ERR_04276("ERR_04276"), ERR_04277("ERR_04277"), ERR_04278("ERR_04278"), ERR_04279("ERR_04279"), ERR_04280("ERR_04280"), ERR_04281("ERR_04281"), ERR_04282("ERR_04282"), ERR_04283("ERR_04283"), ERR_04284("ERR_04284"), ERR_04285("ERR_04285"), ERR_04286("ERR_04286"), ERR_04287("ERR_04287"), ERR_04288("ERR_04288"), ERR_04289("ERR_04289"), ERR_04290("ERR_04290"), ERR_04291("ERR_04291"), ERR_04292("ERR_04292"), ERR_04293("ERR_04293"), ERR_04294("ERR_04294"), ERR_04295("ERR_04295"), ERR_04296("ERR_04296"), ERR_04297("ERR_04297"), ERR_04298("ERR_04298"), ERR_04299("ERR_04299"), ERR_04300("ERR_04300"), ERR_04301("ERR_04301"), ERR_04302("ERR_04302"), ERR_04303("ERR_04303"), ERR_04304("ERR_04304"), ERR_04305("ERR_04305"), ERR_04306("ERR_04306"), ERR_04307("ERR_04307"), ERR_04308("ERR_04308"), ERR_04309("ERR_04309"), ERR_04310("ERR_04310"), ERR_04311("ERR_04311"), ERR_04312("ERR_04312"), ERR_04313("ERR_04313"), ERR_04314("ERR_04314"), ERR_04315("ERR_04315"), ERR_04316("ERR_04316"), ERR_04317("ERR_04317"), ERR_04318("ERR_04318"), ERR_04319("ERR_04319"), ERR_04320("ERR_04320"), ERR_04321("ERR_04321"), ERR_04322("ERR_04322"), ERR_04323("ERR_04323"), ERR_04324("ERR_04324"), ERR_04325("ERR_04325"), ERR_04326("ERR_04326"), ERR_04327("ERR_04327"), ERR_04328("ERR_04328"), ERR_04329("ERR_04329"), ERR_04330("ERR_04330"), ERR_04331("ERR_04331"), ERR_04332("ERR_04332"), ERR_04333("ERR_04333"), ERR_04334("ERR_04334"), ERR_04335("ERR_04335"), ERR_04336("ERR_04336"), ERR_04337("ERR_04337"), ERR_04338("ERR_04338"), ERR_04339("ERR_04339"), ERR_04340("ERR_04340"), ERR_04341("ERR_04341"), ERR_04342("ERR_04342"), ERR_04343("ERR_04343"), ERR_04344("ERR_04344"), ERR_04345("ERR_04345"), ERR_04346("ERR_04346"), ERR_04347("ERR_04347"), ERR_04348("ERR_04348"), ERR_04349("ERR_04349"), ERR_04350("ERR_04350"), ERR_04351("ERR_04351"), ERR_04352("ERR_04352"), ERR_04353("ERR_04353"), ERR_04354("ERR_04354"), ERR_04355("ERR_04355"), ERR_04356("ERR_04356"), ERR_04357("ERR_04357"), ERR_04358("ERR_04358"), ERR_04359("ERR_04359"), ERR_04360("ERR_04360"), ERR_04361("ERR_04361"), ERR_04362("ERR_04362"), ERR_04363("ERR_04363"), ERR_04364("ERR_04364"), ERR_04365("ERR_04365"), ERR_04366("ERR_04366"), ERR_04367("ERR_04367"), ERR_04368("ERR_04368"), ERR_04369("ERR_04369"), ERR_04370("ERR_04370"), ERR_04371("ERR_04371"), ERR_04372("ERR_04372"), ERR_04373("ERR_04373"), ERR_04374("ERR_04374"), ERR_04375("ERR_04375"), ERR_04376("ERR_04376"), ERR_04377("ERR_04377"), ERR_04378("ERR_04378"), ERR_04379("ERR_04379"), ERR_04380("ERR_04380"), ERR_04381("ERR_04381"), ERR_04382("ERR_04382"), ERR_04383("ERR_04383"), ERR_04384("ERR_04384"), ERR_04385("ERR_04385"), ERR_04386("ERR_04386"), ERR_04387("ERR_04387"), ERR_04388("ERR_04388"), ERR_04389("ERR_04389"), ERR_04390("ERR_04390"), ERR_04391("ERR_04391"), ERR_04392("ERR_04392"), ERR_04393("ERR_04393"), ERR_04394("ERR_04394"), ERR_04395("ERR_04395"), ERR_04396("ERR_04396"), ERR_04397("ERR_04397"), ERR_04398("ERR_04398"), ERR_04399("ERR_04399"), ERR_04400("ERR_04400"), ERR_04401("ERR_04401"), ERR_04402("ERR_04402"), ERR_04403("ERR_04403"), ERR_04404("ERR_04404"), ERR_04405("ERR_04405"), ERR_04406("ERR_04406"), ERR_04407("ERR_04407"), ERR_04408("ERR_04408"), ERR_04409("ERR_04409"), ERR_04410("ERR_04410"), ERR_04411("ERR_04411"), ERR_04412("ERR_04412"), ERR_04413("ERR_04413"), ERR_04414("ERR_04414"), ERR_04415("ERR_04415"), ERR_04416("ERR_04416"), ERR_04417("ERR_04417"), ERR_04418("ERR_04418"), ERR_04419("ERR_04419"), ERR_04420("ERR_04420"), ERR_04421("ERR_04421"), ERR_04422("ERR_04422"), ERR_04423("ERR_04423"), ERR_04424("ERR_04424"), ERR_04425("ERR_04425"), ERR_04426("ERR_04426"), ERR_04427("ERR_04427"), ERR_04428("ERR_04428"), ERR_04429("ERR_04429"), ERR_04430("ERR_04430"), ERR_04431("ERR_04431"), ERR_04432("ERR_04432"), ERR_04433("ERR_04433"), ERR_04434("ERR_04434"), ERR_04435("ERR_04435"), ERR_04436("ERR_04436"), ERR_04437("ERR_04437"), ERR_04438("ERR_04438"), ERR_04439("ERR_04439"), ERR_04440("ERR_04440"), ERR_04441("ERR_04441"), ERR_04442_NOT_EXISTING_ATRIBUTE_TYPE("ERR_04442_NOT_EXISTING_ATRIBUTE_TYPE"), ERR_04443("ERR_04443"), ERR_04444("ERR_04444"), ERR_04445("ERR_04445"), ERR_04446("ERR_04446"), ERR_04447_CANNOT_NORMALIZE_VALUE("ERR_04447_CANNOT_NORMALIZE_VALUE"), ERR_04448("ERR_04448"), ERR_04449("ERR_04449"), ERR_04450("ERR_04450"), ERR_04451("ERR_04451"), ERR_04452("ERR_04452"), ERR_04453("ERR_04453"), ERR_04454("ERR_04454"), ERR_04455("ERR_04455"), ERR_04456("ERR_04456"), ERR_04457_NULL_ATTRIBUTE_ID("ERR_04457_NULL_ATTRIBUTE_ID"), ERR_04458("ERR_04458"), ERR_04459("ERR_04459"), ERR_04460_ATTRIBUTE_TYPE_NULL_NOT_ALLOWED("ERR_04460_ATTRIBUTE_TYPE_NULL_NOT_ALLOWED"), ERR_04461("ERR_04461"), ERR_04462("ERR_04462"), ERR_04463("ERR_04463"), ERR_04464("ERR_04464"), ERR_04465("ERR_04465"), ERR_04466("ERR_04466"), ERR_04467("ERR_04467"), ERR_04468("ERR_04468"), ERR_04469("ERR_04469"), ERR_04470("ERR_04470"), ERR_04471("ERR_04471"), ERR_04472("ERR_04472"), ERR_04473_NOT_VALID_VALUE("ERR_04473_NOT_VALID_VALUE"), ERR_04474("ERR_04474"), ERR_04475("ERR_04475"), ERR_04476("ERR_04476"), ERR_04477_NO_VALID_AT_FOR_THIS_ID("ERR_04477_NO_VALID_AT_FOR_THIS_ID"), ERR_04478_NO_VALUE_NOT_ALLOWED("ERR_04478_NO_VALUE_NOT_ALLOWED"), ERR_04479_INVALID_SYNTAX_VALUE("ERR_04479_INVALID_SYNTAX_VALUE"), ERR_04480_END_OF_STREAM("ERR_04480_END_OF_STREAM"), ERR_04481_ENTRY_NULL_VALUE("ERR_04481_ENTRY_NULL_VALUE"), ERR_04482_CANNOT_SUBTYPE_COLLECTIVE("ERR_04482_CANNOT_SUBTYPE_COLLECTIVE"), ERR_04483_COLLECTIVE_NOT_MULTI_VALUED("ERR_04483_COLLECTIVE_NOT_MULTI_VALUED"), ERR_04484_COLLECTIVE_NOT_ALLOWED_IN_MUST("ERR_04484_COLLECTIVE_NOT_ALLOWED_IN_MUST"), ERR_04485_COLLECTIVE_NOT_ALLOWED_IN_MAY("ERR_04485_COLLECTIVE_NOT_ALLOWED_IN_MAY"), ERR_04486_VALUE_ALREADY_EXISTS("ERR_04486_VALUE_ALREADY_EXISTS"), ERR_04487_ATTRIBUTE_IS_SINGLE_VALUED("ERR_04487_ATTRIBUTE_IS_SINGLE_VALUED"), ERR_04488_SYNTAX_INVALID("ERR_04488_SYNTAX_INVALID"), // ldap-constants ERR_05001_UNKNOWN_AUTHENT_LEVEL("ERR_05001_UNKNOWN_AUTHENT_LEVEL"), // ldap-converter ERR_06001_EMPTY_OR_NULL_SCHEMA_OBJECT("ERR_06001_EMPTY_OR_NULL_SCHEMA_OBJECT"), ERR_06002_PARSER_FAILURE("ERR_06002_PARSER_FAILURE"), ERR_06003_NO_NAME("ERR_06003_NO_NAME"), ERR_06004_CANNOT_GENERATE_SOURCES("ERR_06004_CANNOT_GENERATE_SOURCES"), ERR_06005_NULL_SCHEMA("ERR_06005_NULL_SCHEMA"), ERR_06006_NO_PROPERTY("ERR_06006_NO_PROPERTY"), // ldap-jndi // no exceptions to translate // ldap-schema ERR_08001("ERR_08001"), ERR_08002("ERR_08002"), ERR_08003("ERR_08003"), ERR_08004("ERR_08004"), ERR_08005("ERR_08005"), ERR_08006("ERR_08006"), // ldap-schema ERR_09001_DIRECTORY_CREATION_FAILED("ERR_09001_DIRECTORY_CREATION_FAILED"), // ldap-schema-loader ERR_10001("ERR_10001"), ERR_10002("ERR_10002"), ERR_10003("ERR_10003"), ERR_10004("ERR_10004"), ERR_10005("ERR_10005"), ERR_10006("ERR_10006"), ERR_10007("ERR_10007"), ERR_10008("ERR_10008"), ERR_10009("ERR_10009"), ERR_10010("ERR_10010"), ERR_10011("ERR_10011"), ERR_10012("ERR_10012"), ERR_10013("ERR_10013"), ERR_10014("ERR_10014"), ERR_10015("ERR_10015"), ERR_10016("ERR_10016"), ERR_10017("ERR_10017"), ERR_10018("ERR_10018"), ERR_10019("ERR_10019"), ERR_10020("ERR_10020"), ERR_10021("ERR_10021"), ERR_10022("ERR_10022"), ERR_10023("ERR_10023"), ERR_10024("ERR_10024"), ERR_10025("ERR_10025"), ERR_10026("ERR_10026"), ERR_10027("ERR_10027"), ERR_10028("ERR_10028"), // ldap-schema-manager ERR_11001("ERR_11001"), ERR_11002("ERR_11002"), ERR_11003("ERR_11003"), ERR_11004("ERR_11004"), ERR_11005("ERR_11005"), ERR_11006("ERR_11006"), ERR_11007("ERR_11007"), ERR_11008("ERR_11008"), ERR_11009("ERR_11009"), ERR_11010("ERR_11010"), ERR_11011("ERR_11011"), ERR_11012("ERR_11012"), ERR_11013("ERR_11013"), // ldap-schema-manager ERR_12001_UNKNOWN_CHANGE_TYPE("ERR_12001_UNKNOWN_CHANGE_TYPE"), ERR_12002_ENTRY_WITH_TWO_DNS("ERR_12002_ENTRY_WITH_TWO_DNS"), ERR_12003_LDIF_ENTRY_WITH_TWO_DNS("ERR_12003_LDIF_ENTRY_WITH_TWO_DNS"), ERR_12004_CHANGE_NOT_ALLOWED("ERR_12004_CHANGE_NOT_ALLOWED"), ERR_12005_NO_CHANGE("ERR_12005_NO_CHANGE"), ERR_12006_EXPECTING_ATTRIBUTE_TYPE("ERR_12006_EXPECTING_ATTRIBUTE_TYPE"), ERR_12007_BAD_ATTRIBUTE("ERR_12007_BAD_ATTRIBUTE"), ERR_12008_CANNOT_PARSE_LDIF_BUFFER("ERR_12008_CANNOT_PARSE_LDIF_BUFFER"), ERR_12009_ERROR_PARSING_LDIF_BUFFER("ERR_12009_ERROR_PARSING_LDIF_BUFFER"), ERR_12010_CANNOT_FIND_FILE("ERR_12010_CANNOT_FIND_FILE"), ERR_12011_CANNOT_READ_FILE("ERR_12011_CANNOT_READ_FILE"), ERR_12012_EMPTY_DN_NOT_ALLOWED("ERR_12012_EMPTY_DN_NOT_ALLOWED"), ERR_12013_NO_DN("ERR_12013_NO_DN"), ERR_12014_BASE64_DN_EXPECTED("ERR_12014_BASE64_DN_EXPECTED"), ERR_12015_INVALID_BASE64_DN("ERR_12015_INVALID_BASE64_DN"), ERR_12016_DN_EXPECTED("ERR_12016_DN_EXPECTED"), ERR_12017_INVALID_DN("ERR_12017_INVALID_DN"), ERR_12018_FILE_NOT_FOUND("ERR_12018_FILE_NOT_FOUND"), ERR_12019_BAD_URL_FILE_NOT_FOUND("ERR_12019_BAD_URL_FILE_NOT_FOUND"), ERR_12020_FILE_TOO_BIG("ERR_12020_FILE_TOO_BIG"), ERR_12022_ERROR_READING_FILE("ERR_12022_ERROR_READING_FILE"), ERR_12023_ERROR_READING_BAD_URL("ERR_12023_ERROR_READING_BAD_URL"), ERR_12024_CANNOT_CLOSE_FILE("ERR_12024_CANNOT_CLOSE_FILE"), ERR_12025_BAD_PROTOCOL("ERR_12025_BAD_PROTOCOL"), ERR_12026_UNSUPPORTED_PROTOCOL("ERR_12026_UNSUPPORTED_PROTOCOL"), ERR_12027_BAD_URL("ERR_12027_BAD_URL"), ERR_12029_CONTROL_WITHOUT_OID("ERR_12029_CONTROL_WITHOUT_OID"), ERR_12031_INVALID_OID("ERR_12031_INVALID_OID"), ERR_12033_INVALID_CRITICALITY("ERR_12033_INVALID_CRITICALITY"), ERR_12035_BAD_MODRDN_OPERATION("ERR_12035_BAD_MODRDN_OPERATION"), ERR_12038_NO_DELETEOLDRDN("ERR_12038_NO_DELETEOLDRDN"), ERR_12040_BAD_MODIFY_SEPARATOR("ERR_12040_BAD_MODIFY_SEPARATOR"), ERR_12042_BAD_MODIFY_SEPARATOR_2("ERR_12042_BAD_MODIFY_SEPARATOR_2"), ERR_12044("ERR_12044"), ERR_12045("ERR_12045"), ERR_12046("ERR_12046"), ERR_12047("ERR_12047"), ERR_12048("ERR_12048"), ERR_12049("ERR_12049"), ERR_12050("ERR_12050"), ERR_12051("ERR_12051"), ERR_12052("ERR_12052"), ERR_12053("ERR_12053"), ERR_12054("ERR_12054"), ERR_12055("ERR_12055"), ERR_12056("ERR_12056"), ERR_12057_BAD_ATTRIBUTE("ERR_12057_BAD_ATTRIBUTE"), ERR_12058_UNKNOWN_ENTRY_TYPE("ERR_12058_UNKNOWN_ENTRY_TYPE"), ERR_12059_UNKNOWN_ENTRY("ERR_12059_UNKNOWN_ENTRY"), ERR_12060_VERSION_NOT_A_NUMBER("ERR_12060_VERSION_NOT_A_NUMBER"), ERR_12061_LDIF_PARSING_ERROR("ERR_12061_LDIF_PARSING_ERROR"), ERR_12062_EMPTY_CONTINUATION_LINE("ERR_12062_EMPTY_CONTINUATION_LINE"), ERR_12063_ERROR_WHILE_READING_LDIF_LINE("ERR_12063_ERROR_WHILE_READING_LDIF_LINE"), ERR_12064_EMPTY_FILE_NAME("ERR_12064_EMPTY_FILE_NAME"), ERR_12066("ERR_12066"), ERR_12067("ERR_12067"), ERR_12068("ERR_12068"), ERR_12069("ERR_12069"), ERR_12070("ERR_12070"), ERR_12071("ERR_12071"), ERR_12072("ERR_12072"), ERR_12073("ERR_12073"), ERR_12074("ERR_12074"), ERR_12075("ERR_12075"), ERR_12076("ERR_12076"), ERR_12077("ERR_12077"), ERR_12078("ERR_12078"), ERR_12079("ERR_12079"), ERR_12080("ERR_12080"), ERR_12081("ERR_12081"), ERR_12082("ERR_12082"), ERR_12083("ERR_12083"), ERR_12084("ERR_12084"), ERR_12085("ERR_12085"), ERR_12086("ERR_12086"), ERR_12087("ERR_12087"), // The messages MSG_04489_SYNTAX_VALID( "MSG_04489_SYNTAX_VALID" ); /** 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 ) { try { return err + " " + format( ERR_BUNDLE.getString( err.getErrorCode() ), args ); } catch ( Exception e ) { StringBuilder sb = new StringBuilder(); boolean comma = false; for ( Object obj : args ) { if ( comma ) { sb.append( "," ); } else { comma = true; } sb.append( obj ); } return err + " (" + sb.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 ) { try { return msg + " " + format( ERR_BUNDLE.getString( msg.getErrorCode() ), args ); } catch ( Exception e ) { StringBuilder sb = new StringBuilder(); boolean comma = false; for ( Object obj : args ) { if ( comma ) { sb.append( "," ); } else { comma = true; } sb.append( obj ); } return msg + " (" + sb.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; for ( Object obj : args ) { if ( comma ) { sb.append( "," ); } else { comma = true; } sb.append( obj ); } return msg + " (" + sb.toString() + ")"; } } } /** * Format a message injecting some parameters in the pattern. * * @param pattern The message pattern * @param args The arguments to inject in the pattern * @return The resulting messages */ public static String format( String pattern, Object... args ) { return new MessageFormat( pattern, Locale.ROOT ).format( args ); } } apache-ldap-api-1.0.0-src/i18n/src/main/resources/org/apache/directory/api/i18n/errors.properties0100644 0000767 0000024 00000134067 13114114303 034207 0ustar00elecharnystaff0000000 0000000 # # 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. # # # asn1 ERR_00001_BAD_TRANSITION_FROM_STATE=Bad transition from state {0}, tag {1} ERR_00002_BAD_TRANSITION=Bad transition ! ERR_00003_CANNOT_PUT_PDU_IN_NULL_BUFFER=Cannot put a PDU in a null buffer ! ERR_00004_PDU_BUFFER_SIZE_TOO_SMALL=The PDU buffer size is too small ! ERR_00005_LENGTH_OVERFLOW=Overflow : can''t have more than 4 bytes long length ERR_00006_LENGTH_EXTENSION_RESERVED=Length reserved extension used ERR_00007_TLV_NULL=The current container TLV is null. ERR_00008_VALUE_LENGTH_ABOVE_EXPECTED_LENGTH=The current Value length {0} is above the expected length {1} ERR_00009_MORE_TLV_EXPECTED=The PDU is decoded, but we should have had more TLVs ERR_00010_TRUNCATED_PDU=Truncated PDU. Some elements are lacking, accordingly to the grammar ERR_00011_LENGTH_TOO_LONG_FOR_DEFINITE_FORM=Length above 126 bytes are not allowed for a definite form Length ERR_00013_ODD_NUM_OF_CHARS=Odd number of characters. ERR_00014_ILLEGAL_HEX_CHAR=Illegal hexadecimal character {0} at index {1} ERR_00016_END_OF_STREAM=End of stream. ERR_00017_EOF_FOUND_LENGTH_EXPECTED=EOF found when length expected. ERR_00018_DER_LENGTH_ABOVE_4_BYTES=DER length more than 4 bytes. ERR_00019_EOF_FOUND_IN_LENGTH=EOF found reading length. ERR_00020_CORRUPTED_STREAM=Corrupted steam - negative length found. ERR_00021_EOF_FOUND_IN_OBJECT=EOF encountered in middle of object. ERR_00022_READ_PAST_END_OF_FILE=Attempt to read past end of file. ERR_00023_UNKNOWN_BER_OBJECT=Unknown BER object encountered. ERR_00024_OBJECT_NOT_DER_ENCODABLE=Object not DEREncodable. ERR_00025_DER_OCTET_STRING_EXPECTED={0} found in input should only contain DEROctetString. ERR_00020_CANNOT_CONVERT_OCTETS=Exception converting octets {0} ERR_00020_NOT_IMPLEMENTED=Not implemented: {0} ERR_00020_INTERNAL_ERROR_ENCODING_BITSTRING_00028=Internal error encoding BitString. ERR_00020_NULL_OR_NEG_LENGTH_NOT_ALLOWED=Null or negative length are not allowed ERR_00030_BIT_NUMBER_OUT_OF_BOUND=Bad bit number : out of bound ERR_00031_CANNOT_FIND_BIT=Cannot get a bit at position {0} when the BitString contains only {1} ints ERR_00032_NULL_OID=Null OID ERR_00033_INVALID_OID=Invalid OID : {0} ERR_00034_0_BYTES_LONG_BOOLEAN=The value is 0 byte long. This is not allowed for a boolean ERR_00035_N_BYTES_LONG_BOOLEAN=The value is not 1 byte long. This is not allowed for a boolean ERR_00036_0_BYTES_LONG_INTEGER=The value is 0 byte long. This is not allowed for an integer ERR_00037_ABOVE_4_BYTES_INTEGER=The value is more than 4 bytes long. This is not allowed for an integer ERR_00038_VALUE_NOT_IN_RANGE=The value is not in the range [{0}, {1}] ERR_00039_0_BYTES_LONG_LONG=The value is 0 byte long. This is not allowed for a long ERR_00041_CURRENT_LENGTH_EXCEED_EXPECTED_LENGTH=Current Length is above expected Length ERR_00042_PDU_SIZE_TOO_LONG=The PDU current size ({1}) exceeds the maximum allowed PDU size ({2}) ERR_00043_REMAINING_BYTES_FOR_DECODED_PDU=The PDU has been fully decoded but there are still bytes in the buffer. # asn1-codec ERR_01001=Encoded result is not a ByteBuffer: {0} # cursor ERR_02001_MONITOR=monitor ERR_02002_FAILURE_ON_UNDERLYING_CURSOR=Failure on underlying Cursor. ERR_02003_REMOVAL_NOT_SUPPORTED=Underlying Cursor does not support removal. ERR_02004_EMPTY_CURSOR=This cursor is empty and cannot return elements! ERR_02005_START_INDEX_OUT_OF_RANGE=start index ''{0}'' out of range ERR_02006_END_INDEX_OUT_OF_RANGE=end index ''{0}'' out of range ERR_02007_START_INDEX_ABOVE_END_INDEX=start index ''{0}'' greater than or equal to end index ''{1}'' just does not make sense ERR_02008_LIST_MAY_BE_SORTED=don''t know if list is sorted and checking that is not worth it ERR_02009_CURSOR_NOT_POSITIONED=Cursor not positioned at an element ERR_02010_NO_COMPARATOR_CANT_MOVE_BEFORE=Without a comparator I cannot advance to just before the specified element. ERR_02011_NO_COMPARATOR_CANT_MOVE_AFTER=Without a comparator I cannot advance to just after the specified element. ERR_02012_CANNOT_ACCESS_IF_BEFORE_FIRST=Cannot access element if positioned before first. ERR_02013_CANNOT_ACCESS_IF_AFTER_LAST=Cannot access element if positioned after last. ERR_02014_UNSUPPORTED_OPERATION=The method method {0} is not supported # dsml-parser ERR_03001={0} - Line {1} - Column {2} ERR_03002=A requestID must be specified to each request when Processing is Parallel and ReponseOrder is Unordered. ERR_03003=Internal Error: {0} ERR_03004=Unknown type ERR_03005=type attribute is required ERR_03006=Incorrect value for ''type'' attribute. This is not an OID. ERR_03007=Incorrect value for ''criticality'' attribute ERR_03008=An unexpected error ocurred : {0} ERR_03009=the given resultCode is not an integer ERR_03010=code attribute is required ERR_03011=descr (''{0}'') doesn''t match with the possible values ERR_03012=name attribute is required ERR_03013=Unknown value for ''processing'' attribute. ERR_03014=Unknown value for ''onError'' attribute. ERR_03015=Unknown value for ''responseOrder'' attribute. ERR_03016=requestID attribute is required ERR_03017=the given abandonID is not an integer ERR_03018=abandonID attribute is required ERR_03019=dn attribute is required ERR_03020=can not add attribute value ERR_03021=principal attribute is required ERR_03022=The request name can''t be null ERR_03023=newrdn attribute is required ERR_03024=Incorrect value for ''deleteoldrdn'' attribute ERR_03025=operation attribute is required ERR_03026=unknown scope. Scope must be ''baseObject'', ''singleLevel'' or ''wholeSubtree''. ERR_03027=scope attribute is required ERR_03028=unknown derefAliases value. derefAliases must be ''neverDerefAliases'', ''derefInSearching'', ''derefFindingBaseObj'' or ''derefAlways''. ERR_03029=derefAliases attribute is required ERR_03030=the given sizeLimit is not an integer ERR_03031=the given timeLimit is not an integer ERR_03032=typesOnly must be a boolean (''true'' or ''false''). ERR_03033=dnAttributes must be a boolean (''true'' or ''false''). ERR_03034=Incorrect value for ''type'' attribute. This is not an OID. ERR_03035=type attribute is required ERR_03036=The tag {0} can''t be found at this position ERR_03037=An IOException occurred during parsing : {0} ERR_03038=The attribute requestID {0} can''t be below 0 ERR_03039=the given requestID is not an integer ERR_03040=unable to find the batch request # dsml-parser ERR_03101_MISSING_CONNECTION_TO BIND=Missing connection, can not bind # ldap ERR_04001_NULL_IDENTIFICATION_TAG=identificationTag parameter is null ERR_04002_BAD_PRECENDENCE=precedence parameter not in [0-255] : {0} ERR_04003_NULL_AUTHENTICATION_LEVEL=authenticationLevel parameter is null ERR_04004_PARSER_FAILURE_ACI_ITEM=Parser failure on ACIItem\:\n\t{0}\nAntlr exception trace\:\n{1} [Line:{2} - Column:{3}] ERR_04005=The PDU buffer size is too small ! ERR_04006=The And filter PDU must not be empty ERR_04007=The attribute description is empty ERR_04008=The type can''t be null ERR_04009=The Not filter PDU must not be empty ERR_04010=The Or filter PDU must not be empty ERR_04011=The Referrals must not be null ERR_04012=The Substring filter PDU must not be empty ERR_04013=Incorrect DN given : {0} ({1}) is invalid : {2} ERR_04014=Incorrect DN given : {0} ERR_04015=The URL {0} is not valid \: {1} ERR_04016=Invalid URL : {0} ERR_04017=The name must not be null ERR_04018=The result code {0} is invalid : {1}. The result code must be between (0 .. 121) ERR_04019=The substring any filter is empty ERR_04020=The substring final filter is empty ERR_04021=The URL {0} is not valid : {1} ERR_04022=The type cannot be null in a MatchingRuleAssertion ERR_04023=Cannot put a PDU in a null buffer ! ERR_04024=failed to decode the refreshDeletes flag for SyncDoneValueControl ERR_04025=failed to decode the refreshDone flag for SyncInfoValueControl ERR_04026=failed to decode the refreshDeletes flag for SyncInfoValueControl ERR_04027=Bad UUID value, its length is incorrect ( it should be 16 bytes long) ERR_04028=failed to decode the mode for SyncRequestValueControl ERR_04029=failed to decode the reloadHint flag for SyncRequestValueControl ERR_04030=failed to decode the mode for SyncStateValueControl ERR_04031=failed to decode the cancelId, the value should be between 0 and 2^31-1, it is ''{0}'' ERR_04032=invalid target DN {0} ERR_04033=failed to decode the target DN, it cannot be null or empty it is ''{0}'' ERR_04034=invalid issuer DN {0} ERR_04035=invalid subject DN {0} ERR_04036=failed to decode the delay, the value should be between 0 and 86400 seconds, it is ''{0}'' ERR_04037=failed to decode the timeOffline, the value should be between 0 and 720 minutes, it is ''{0}'' ERR_04038=The stored procedure language is null ERR_04039=The procedure can''t be null ERR_04040=The parameter type can''t be null ERR_04041=The parameter value can''t be null ERR_04042=The parameter value is empty. This is not allowed. ERR_04043=The request name must not be null ERR_04044=failed to decode the changeType for EntryChangeControl ERR_04045=The previousDN field should not contain anything if the changeType is not MODDN ERR_04046=Previous DN is not allowed for this change type ERR_04047=Bad Previous DN : ''{0}'' ERR_04048=failed to decode the previous DN ERR_04049=failed to decode the changeNumber for EntryChangeControl ERR_04050=failed to decode the size for PagedSearchControl ERR_04051=failed to decode the changeTypes for PSearchControl ERR_04052=failed to decode the changesOnly for PSearchControl ERR_04053=failed to decode the returnECs for PSearchControl ERR_04054=The visibility flag {0} is invalid : {1}. It should be 0 or 255 ERR_04055=Undefined changeType value: {0} ERR_04056=Cannot have a null matching rule and a null type ERR_04057=Cannot have more than one Filter within a Not Filter ERR_04058=Cannot have a null initial, any and final substring ERR_04059=Expected either a byte[] or ByteBuffer argument but got a {0} ERR_04060=Ldap decoder failure : {0} ERR_04061=Ldap decoder failure! ERR_04062=Ldap decoder failure, PDU does not contain enough data ERR_04063=The input stream does not contain a full PDU ERR_04064=Ldap decoder failure : The input stream does not contain a full PDU ERR_04065=Ldap encoder failed to encode object: {0}, error : {1} ERR_04066=The LdapMessage has a zero length. This is not allowed ERR_04067=The LdapMessage should not be empty ERR_04068=The messageId has a zero length. This is not allowed ERR_04069=The messageId should not be null ERR_04070=The Message Id {0} is invalid : {1}. The message ID must be between (0 .. 2 147 483 647) ERR_04071=The length of a UnBindRequest must be null, the actual value is {0} ERR_04072=The length of a UnBindRequest must be null ERR_04073=The entry must not be null ERR_04074=The DN to delete : {0} ({1}) is invalid : {2} ERR_04075=The AbandonRequest messageId must not be null ERR_04076=The Abandonned Message Id {0} is invalid : {1}. The message ID must be between (0 .. 2 147 483 647) ERR_04077=The BindRequest must not be null ERR_04078=The version {0} is invalid : {1}. The version must be between (0 .. 127) ERR_04079=The SaslCredential must not be null ERR_04080=The Referrals must not be null ERR_04081=The AttributeType can''t be empty ERR_04082=Invalid operation ({0}), it should be 0, 1 or 2 ERR_04083=The type can''t be null ERR_04084=The AddRequest must not be null ERR_04085=Empty entry DN given ERR_04086=Null or empty types are not allowed ERR_04087=Error while injecting the AttributeType ERR_04088=The AddResponse must not be null ERR_04089=The entry must not be null ERR_04090=The newrdn must not be null ERR_04091=The oldRdn flag {0} is invalid : {1}. It should be 0 or 255 ERR_04092=The new superior must not be null if the flag ''delete old DN'' is set to true ERR_04093=The attribute description must not be null ERR_04094=The CompareResponse must not be null ERR_04095=The name must not be null ERR_04096=The length of a control must not be null ERR_04097=The OID must not be null ERR_04098=The control type {0} is not a valid OID ERR_04099=Invalid control OID : {0} ERR_04100=The control criticality flag {0} is invalid : {1}. It should be 0 or 255 ERR_04101=The scope is not in [0..2] : {0} ERR_04102=The derefAlias is not in [0..3] : {0} ERR_04103=The sizeLimit is not a valid Integer: {0} ERR_04104=The timeLimit is not a valid Integer: {0} ERR_04105=The types only flag {0} is invalid : {1}. It should be 0 or 255 ERR_04106=The attribute description should not be null ERR_04107=The substrings sequence is empty ERR_04108=The substring initial filter is empty ERR_04109=The matching rule is empty ERR_04110=The DN attributes flag {0} is invalid : {1}. It should be 0 or 255 ERR_04111=Could not parse matchedDn while transforming Codec value to Internal: {0} ERR_04112=Error while transforming a ExprNode : {0} ERR_04113=shouldn''t happen - if it does then we have issues ERR_04114=The CSN must not be null or empty ERR_04115=The CSN''s length is incorrect, it should be 40 chars long ERR_04116=Cannot find a ''#'' in the CSN ''{0}'' ERR_04117=The timestamp is not long enough ERR_04118=Cannot parse the timestamp: ''{0}'' ERR_04119=The microseconds part is invalid ERR_04120=Missing a ''#'' in the CSN ''{0}'' ERR_04121=The changeCount ''{0}'' is not a valid number ERR_04122=Missing a ''#'' in the CSN ''{0}'' ERR_04123=The replicaID must not be null or empty ERR_04124=The replicaId ''{0}'' is not a valid number ERR_04125=The operationNumber is absent ERR_04126=The operationNumber ''{0}'' is not a valid number ERR_04127=I don't really know how to compare anything other than ServerBinaryValues at this point in time. ERR_04128=Cannot compare {0} with the unknown value {1} ERR_04129=Unknown value type: {0} ERR_04130=The value is expected to be a byte[] ERR_04131=The value is expected to be a String ERR_04132=An ID cannnot be null, empty, or resolved to an emtpy value when trimmed ERR_04133=The attributeType ID should not be null or empty ERR_04134=An exception has been raised while looking for attribute id ''{0}'' ERR_04135=The AttributeType list should not be null ERR_04136=The AttributeType list should not contain null values ERR_04137=The attribute ''{0}'' does not exist in the entry ERR_04138=The removal of values for the missing ''{0}'' attribute is not possible ERR_04139=Cannot validate {0} with a null SyntaxChecker ERR_04140_UNACCEPTABLE_RESULT_CODE=Unacceptable result code for this exception type: {0} ERR_04141={0} is not an acceptable result code. ERR_04142=Only UNWILLING_TO_PERFORM and UNAVAILABLE_CRITICAL_EXTENSION result codes are allowed to be used with this exception ERR_04143=Only the following LDAP result codes can be used: {0} ERR_04144=ScopeNode can''t be part of a refinement ERR_04145=AssertionNode can''t be part of a refinement ERR_04146=AssertionValue expected ERR_04147=Expected MatchingRule or assertionValue ERR_04148=MatchingRule expected ERR_04149=Not a valid escaped value ERR_04150=Bad substring ERR_04151=Bad char ERR_04152=Expecting a ''\='' ERR_04153=An item is expected ERR_04154=Empty filterComp ERR_04155=No ''('' at the beginning of the filter ERR_04156=Bad filter ERR_04157=The filter has no right parenthese ERR_04158=Empty filter ERR_04159=Cannot add more than one element to a negation node. ERR_04160=Unknown JNDI scope constant value: {0} ERR_04161=Unknown LDAP URL scope value: {0} ERR_04162=Invalid attribute {0} for a refinement ERR_04163=Unknown SyncStateTypeEnum value {0} ERR_04164=Failed to encode payload GracefulShutdownRequest ERR_04165=failed to decode payload ERR_04166=The result code can only be one of: {0}, {1}, {2} ERR_04167=Failed to encode payload CertGenerateRequest ERR_04168=the OID is fixed: {0} ERR_04169=Failed to decode response value ERR_04170=Failed while parsing LDAP url {0} ERR_04171=Failed to encode message value. ERR_04172=Failed while decoding response ERR_04173=the response is hardcoded as zero length array ERR_04174=Failed to encode payload StoredProcedureRequest ERR_04175=class loading of procedure type not implemented ERR_04176=conversion of value to java type not implemented ERR_04177=provider monitor class {0} not found ERR_04178=provider monitor class {0} does not expose a public default constructor ERR_04179=provider monitor class {0} failed during instantiation ERR_04180=Could not instantiate provider - environment does not specify {0} property! ERR_04181=Count not find the Provider class {0} ERR_04182=Count not invoke the Provider''s factory method: {0}.getProvider() - it may not exist! ERR_04183=Count not invoke the Provider''s factory method: {0}.getProvider() - it does seem to be a public method! ERR_04184=Call to Provider''s factory method\: {0}.getProvider() threw the following exception\:\n{1} ERR_04185=RFC 2251 [Section 4.11]: Abandon, Bind, Unbind, and StartTLS operations cannot be abandoned. ERR_04186=Unrecognized value ''{0}'' for {1} JNDI property.\nExpected a value of either always, never, searching, or finding. ERR_04187=Class has bug: check for valid enumeration values ERR_04188=The type cannot be empty or null ERR_04189=The User Provided type cannot be empty or null ERR_04190=The User provided name does not contains an ''='' ERR_04191=The AVA type cannot be null or empty ERR_04192=Unexpected character ''{0}'' at position {1}. Excpected '','' or '';''. ERR_04193=RDN must not be empty ERR_04194=RDN must not be null ERR_04195=Unexpected character ''{0}'' at position {1}. Excpected start of attributeType. ERR_04196=Unexpected character ''{0}'' at position {1}. Excpected start of attributeType descr. ERR_04197=Unexpected character ''{0}'' at position {1}. Excpected numericoid. ERR_04198=Numeric OID must contain at least one dot. ERR_04199=Unexpected character ''{0}'' at position {1}. Excpected start of attributeType numericoid. ERR_04200=Unexpected character ''{0}'' at position {1}. Excpected EQUALS ''=''. ERR_04201=No more characters available at position {0} ERR_04202=A value is missing on some RDN ERR_04203=Impossible to get the position {0}, the DN only has {1} RDNs ERR_04204=Failed to parse RDN for name {0} ERR_04205=Exceeded number of elements in the current object ERR_04206=The posn({0}) should be in the range [0, {1}] ERR_04207=The clone operation has failed ERR_04208=Assertion failure : cannot clone the object ERR_04209_EMPTY_TYPE_NOT_ALLOWED=Empty type not allowed in a DN ERR_04210=Cannot serialize a NULL DN ERR_04211=The DN should have been normalized before being serialized ERR_04212=The DN should have been normalized before being serialized {0} ERR_04213=This value is not in hex form, we have an odd number of hex chars ERR_04214=This value is not in hex form ERR_04215=Unescaped special characters are not allowed ERR_04216=This class is not aware of schema information and cannot normalize ERR_04217=None of the arguments are Comparable objects\:\n\targ1 \= {0}\n\targ2 \= {1} ERR_04218=I do not know how to handle dn comparisons with objects of class: {0} ERR_04219_ARGUMENT1_NULL=Argument ''obj1'' is null ERR_04220_ARGUMENT2_NULL=Argument ''obj2'' is null ERR_04221=Matching rule not found: {0} ERR_04222=The value stored in a non Human Readable attribute as a String should be convertible to a byte[] ERR_04223=The value stored in an Human Readable attribute as a byte[] should be convertible to a String ERR_04224=Invalid value : {0} ERR_04225=Encountered name based id of {0} which was not found in the OID registry ERR_04226=I do not know how to handle NameAndOptionalUID normalization with objects of class: {0} ERR_04227=Cannot parse a null AttributeType ERR_04228=Parser failure on attribute type description\:\n{0}\nAntlr message\: {1}\nAntlr column\: {2} ERR_04229=Parser failure on attribute type description\:\n\t{0}\nAntlr message\: {1} ERR_04230=Cannot parse a null DITContentRule ERR_04231=Parser failure on DIT content rule description\:\n\t{0}\nAntlr message\: {1}\nAntlr column\: {2} ERR_04232=Parser failure on DIT content rule description\:\n\t{0}\nAntlr message\: {1} ERR_04233=Cannot parse a null DITStructureRule description ERR_04234=Parser failure on DIT structure rule description\:\n\t{0}\nAntlr message\: {1}nAntlr column\: {2} ERR_04235=Parser failure on DIT structure rule description\:\n\t{0}\nAntlr message\: {1} ERR_04236=Cannot parse a null LdapComparator description ERR_04237=Parser failure on comparator description\:\n\t{0}\nAntlr message\: {1}\nAntlr column\: {2} ERR_04238=Parser failure on comparator description\:\n\t{0}\nAntlr message\: {1} ERR_04239=Cannot parse a null LdapSyntax ERR_04240=Parser failure on LDAP syntay description\:\n\t{0}\nAntlr message\: {1}\nAntlr column\: {2} ERR_04241=Parser failure on LDAP syntay description\:\n\t{0}\nAntlr message\: {1} ERR_04242=Cannot parse a null MatchingRule ERR_04243=Parser failure on matching rule description\:\n\t{0}\nAntlr message\: {1}\nAntlr column\: {2} ERR_04244=Parser failure on matching rule description\:\n\t{0}\nAntlr message\: {1} ERR_04245=Cannot parse a null MatchingRuleUse ERR_04246=Parser failure on matching rule description\:\n\t{0}\nAntlr message\: {1}\nAntlr column\: {2} ERR_04247=Parser failure on matching rule description\:\n\t{0}\nAntlr message\: {1} ERR_04248=Cannot parse a null NameForm ERR_04249=Parser failure on name form description\:\n\t{0}\nAntlr message\: {1}\nAntlr column\: {2} ERR_04250="Parser failure on name form description\:\n\t{0}\nAntlr message\: {1} ERR_04251=Cannot parse a null Normalizer description ERR_04252=Parser failure on normalizer description\:\n\t{0}\nAntlr message\: {1}\nAntlr column\: {2} ERR_04253=Parser failure on normalizer description\:\n\t{0}\nAntlr message\: {1} ERR_04254=Cannot parse a null LdapComparator description ERR_04255=Parser failure on object class description\:\n\t{0}\nAntlr message\: {1}\nAntlr column\: {2} ERR_04256=Parser failure on object class description\:\n\t{0}\nAntlr message\: {1} ERR_04257=No object identifier macro with name {0} ERR_04258=The schemaObject is either null or is the empty String! ERR_04259="Parser failure on syntax checker description\:\n\t{0}\nAntlr message\: {1}\nAntlr column\: {2} ERR_04260=Parser failure on syntax checker description\:\n\t{0}\nAntlr message\: {1} ERR_04261=entry cannot be null ERR_04262=entry must have a valid cn attribute ERR_04263=RuleId {0} not found in ruleId to schema name map! ERR_04264=DITStructureRule with RuleId {0} already registered! ERR_04265=DITStructureRule for ruleId {0} does not exist! ERR_04266=name cannot be null ERR_04267=Looks like the arg is not a numeric OID ERR_04268_OID_NOT_FOUND=OID ''{0}'' not found in oid to schema name map! ERR_04269={0} for OID {1} does not exist! ERR_04270={0} with OID {1} already registered! ERR_04271={0} with name {1} already registered! ERR_04272=OID {0} is not a numeric OID ERR_04273={0} with OID {1} not registered! ERR_04274=Can''t find an OID for the name {0} ERR_04275=Cannot modify the AttributeTypeRegistry copy ERR_04276=Cannot modify the ComparatorRegistry copy ERR_04277=Cannot modify the DITContentRuleRegistry copy ERR_04278=Cannot modify the DITStructureRuleRegistry copy ERR_04279=Cannot modify the LdapSyntaxRegistry copy ERR_04280=Cannot modify the MatchingRuleRegistry copy ERR_04281=Cannot modify the MatchingRuleUseRegistry copy ERR_04282=Cannot modify the NameFormRegistry copy ERR_04283=Cannot modify the NormalizerRegistry copy ERR_04284=Cannot modify the ObjectClassRegistry copy ERR_04285=Cannot modify the SyntaxCheckerRegistry copy ERR_04286=OID ''{0}'' was not found within the OID registry ERR_04287=There is no SchemaObject associated with OID ''{0}'' ERR_04288=OID ''{0}'' was not found within the OID registry ERR_04289=Cannot register a Null SchemaObject ! ERR_04290=The given SchemaObject does not have a valid OID ERR_04291=There is already a SchemaObject for OID ''{0}'' ERR_04292=Cannot build the references for {0}, error : {1} ERR_04293=Cannot remove the references for {0}, error : {1} ERR_04294=The MatchingRule {0} does not have a syntax. This is invalid ERR_04295=The MatchingRule {0} does not have a normalizer. This is invalid ERR_04296=The MatchingRule {0} does not have a comparator. This is invalid ERR_04297=The AttributeType {0} can''t have itself as a superior, or a cycle has been detected while processing the superior''s tree ERR_04298=The AttributeType {0} does not have a superior nor a Syntax. This is invalid ERR_04299=The ObjectClass {0} has some AttribteType in MAY which is already declared in one of its superior MUST ERR_04300=The ObjectClass {0} can''t have itself as a superior, or a cycle has been detected while processing the superior''s tree, or this superior has already been added \: \n{1} ERR_04301=Registering of {0}:{1} failed, it''s already present in the Registries ERR_04302=Unregistering of {0}:{1} failed, it''s not present in the Registries ERR_04303=Cannot find the SUPERIOR object {0} while building cross-references for the {1} AttributeType. ERR_04304=A cycle has been detected in the superior hierarchyOid while building cross-references for the {0} AttributeType. ERR_04305=Cannot find the SUPERIOR object {0} while building cross-references for the {1} AttributeType. ERR_04306=Cannot find a Syntax object {0} while building cross-references for the {1} AttributeType. ERR_04307=The AttributeType {0} must have a syntax OID or a superior, it does not have any. ERR_04308=Cannot find an Equality MatchingRule object for {0} while building cross-references for the {1} AttributeType. ERR_04309=Cannot find an EQUALITY MatchingRule instance for {0} while building cross-references for the {1} AttributeType. ERR_04310=Cannot find a Ordering MatchingRule object for {0} while building cross-references for the {1} AttributeType. ERR_04311=Cannot find an ORDERING MatchingRule instance for {0} while building cross-references for the {1} AttributeType. ERR_04312=Cannot find a SUBSTR MatchingRule object for {0} while building cross-references for the {1} AttributeType. ERR_04313=Cannot find a SUBSTR MatchingRule instance for {0} while building cross-references for the {1} AttributeType. ERR_04314=The attributeType {0} must have the same USAGE than its superior ERR_04315=The attributeType {0} is a USER-APPLICATION attribute, it must be USER-MODIFIABLE ERR_04316=The attributeType {0} is a COLLECTIVE AttributeType, it must be a USER-APPLICATION attributeType too. ERR_04317=The created MatchingRule must refers to an existing SYNTAX element ERR_04318=Cannot register the SchemaObject {0}, an ABSTRACT ObjectClass cannot inherit from an {1} ObjectClass :/n {2} ERR_04319=Cannot register the SchemaObject {0}, an AUXILIARY ObjectClass cannot inherit from a STRUCTURAL ObjectClass :/n {1} ERR_04320=Cannot register the SchemaObject {0}, a STRUCTURAL ObjectClass cannot inherit from an AUXILIARY ObjectClass :/n {1} ERR_04321=Cannot register the SchemaObject {0}, the given SUPERIOR does not exist : {1} ERR_04322=Cannot register the SchemaObject {0}, there are some duplicate AT in the MAY : {1} ERR_04323=Cannot register the SchemaObject {0}, the AT we want to add to MAY does not exist : {1} ERR_04324=Cannot register the SchemaObject {0}, there are some duplicate AT in the MUST : {1} ERR_04325=Cannot register the SchemaObject {0}, there are some duplicate AT in MAY and MUST : {1} ERR_04326=Cannot register the SchemaObject {0}, the AT we want to add to MUST does not exist : {1} ERR_04327=Unknown objectClass type name ''{0}'': options are AUXILIARY, STRUCTURAL, ABSTRACT. ERR_04328=undefined modification type: {0} ERR_04329=Parser failure on subtree specification\:\n\t{0}\nAntlr exception trace\:\n{1} ERR_04330=A negative minimum base distance is undefined! ERR_04331=TriggerSpecification cannot be initialized with any NULL argument. ERR_04332=TriggerSpecification cannot be initialized with emtpy SPSPec list. ERR_04333=Parser failure on Trigger Specification\:\n\t{0}\nAntlr exception trace\:\n{1} ERR_04334=Overlapping partitions are not allowed ERR_04335=Invalid Character 0x{0} ERR_04336=Unregistered or previously used component: {0} ERR_04337=The Array must not be null ERR_04338=Index: {0}, Length: {1} ERR_04339=Cannot figure out attribute ID if both args are null ERR_04340=Cannot take difference of attributes with different IDs! ERR_04341=Cannot figure out attribute ID if both args are null ERR_04342=Cannot take union of attributes with different IDs! ERR_04343=An empty option is not allowed ERR_04344=Invalid OID, missing ''.'' ERR_04345=Invalid OID, missing a number after a ''.'' ERR_04346=Empty attributes ERR_04347=Bad char in attribute ERR_04348=Miscalculated data length (wrote {0} instead of {1}) ERR_04349=The Integer did not match either specified value ERR_04350=The String did not match any specified value ERR_04351=The Array must not be null ERR_04352=Array is empty ERR_04353=The array must not contain any null elements ERR_04354=initialSize must be greater than zero ERR_04355=Unexpected IllegalAccessException ERR_04356=The PrintWriter must not be null ERR_04357=The List must not be null ERR_04358=Calendar must not be null. ERR_04359=generalizedTime is null ERR_04360=Generalized Time too short, doesn''t contain field ''minute'' or ''fraction of hour'' or ''timezone''. ERR_04361=Generalized Time too short, doesn''t contain field ''second'' or ''fraction of minute'' or ''timezone''. ERR_04362=Generalized Time too short, doesn''t contain field ''fraction of second'' or ''timezone''. ERR_04363=Invalid Time too short, expected field ''fraction of second'' or ''timezone''. ERR_04364=Invalid Time too short, expected field ''second'' or ''fraction of minute'' or ''timezone''. ERR_04365=Invalid Generalized Time, expected field ''minute'' or ''fraction of hour'' or ''timezone''. ERR_04366=Invalid date/time values. ERR_04367=Generalized Time too short, doesn''t contain field ''timezone''. ERR_04368=Invalid Generalized Time, expected ''timezone'' as the last field. ERR_04369=Invalid Generalized Time, expected field ''timezone'' must contain 2 or 4 digits. ERR_04370=Invalid Generalized Time, expected ''timezone'' as the last field. ERR_04371=Generalized Time too short, doesn''t contain number for ''fraction''. ERR_04372=Generalized Time too short, doesn''t contain field 'second'. ERR_04373=Invalid Generalized Time, field ''second'' is not numeric. ERR_04374=Generalized Time too short, doesn''t contain field ''minute''. ERR_04375=Invalid Generalized Time, field ''minute'' is not numeric. ERR_04376=Generalized Time too short, doesn''t contain field ''hour''. ERR_04377=Invalid Generalized Time, field ''hour'' is not numeric. ERR_04378=Generalized Time too short, doesn''t contain field ''day''. ERR_04379=Invalid Generalized Time, field ''day'' is not numeric. ERR_04380=Generalized Time too short, doesn''t contain field ''month''. ERR_04381=Invalid Generalized Time, field ''month'' is not numeric. ERR_04382=Generalized Time too short, doesn''t contain field ''century/year''. ERR_04383=Invalid Generalized Time, field ''century/year'' is not numeric. ERR_04384=HashCodeBuilder requires a non zero initial value ERR_04385=HashCodeBuilder requires an odd initial value ERR_04386=HashCodeBuilder requires a non zero multiplier ERR_04387=HashCodeBuilder requires an odd multiplier ERR_04388=The object to build a hash code for must not be null ERR_04389=Putting attributes not supported by immutable attributes ERR_04390=Removing attributes not supported by immutable attributes ERR_04391=Now why would you want to clone() an immutable object in the first place. ERR_04392=Value addition not supported for immutable attribute ERR_04393=Value removal not supported for immutable attribute ERR_04394=Clearing all values not supported for immutable attribute ERR_04395=Now why would you ever want to clone an immutable object? ERR_04396=Value alteration is not supported for immutable attribute ERR_04397=Iterator[] arg must not be null, empty or composed of less than two Iterators ERR_04398=A LdapUrl must start with "ldap\://" or "ldaps\://" ERR_04399=The hostport is invalid ERR_04400=Bad character, position {0}, ''{1}'', ''/'' expected ERR_04401=The DN is invalid ERR_04402=Bad character, position {0}, ''{1}'', ''?'' expected ERR_04403=Attributes are invalid ERR_04404=Scope is invalid ERR_04405=Filter is invalid ERR_04406=Extensions are invalid ERR_04407=Invalid character at the end of the ldapUrl ERR_04408=The string is empty : this is not a valid LdapURL. ERR_04409=Bad Ldap URL : {0} ERR_04410=The byte array is empty : this is not a valid LdapURL. ERR_04411=Parameter may not be null ERR_04412=charset may not be null or empty ERR_04413=HttpClient requires ASCII support ERR_04414=Invalid URL encoding ERR_04415=Common element, "{0}" detected for Mandatory and Optional components. ERR_04416=Unregistered or previously used component: {0} ERR_04417={0} is not ancestually related to context: {1} ERR_04418=invalid name - a name cannot start with a ''+'': {0} ERR_04419=The Nestable implementation passed to the NestableDelegate(Nestable) constructor must extend java.lang.Throwable" ERR_04420=The start index was out of bounds: {0} ERR_04421=The start index was out of bounds: {0} >= {1} ERR_04422=Adding duplicate keys is not permitted. ERR_04423=can''t get keys from prefs ERR_04424=Unexpected IllegalAccessException: {0} ERR_04425=bad iterator type: {0} ERR_04426=remove() must follow next() ERR_04427={0} < 0 ERR_04428={0} >= {1} ERR_04429=Regex was null ERR_04430=Ldap regex must have wild cards! ERR_04431=Expected string to start with a ''#'' character. Invalid hex encoded string for empty or null string. ERR_04432=Expected string to start with a ''\#'' character. Invalid hex encoded string\: {0} ERR_04433=Expected string to be non-null with valid index. ERR_04434=Expected string to be non-empty with valid index. ERR_04435=The DN must contain valid escaped characters. ERR_04436=The DN must not ends with a ''\\''. ERR_04437=Caught a SecurityException reading the system property ''{0}''; the SystemUtils property value will default to null. ERR_04438=The style must not be null ERR_04439=Usage - java org.mortbay.util.UnixCrypt ERR_04440=Crypt={0} ERR_04441=Cannot modify the SchemaObject {0}, it has been locked ERR_04442_NOT_EXISTING_ATRIBUTE_TYPE=The AttributeType {0} does not exist ERR_04443=Failed to compare normalized values for {0} and {1} ERR_04444=I don''t really know how to compare anything other than ServerBinaryValues at this point in time. ERR_04445=There is no Syntax associated with this attributeType ERR_04446=Cannot use standard serialization for a ServerStringValue ERR_04447_CANNOT_NORMALIZE_VALUE=Cannot normalize the wrapped value {0} ERR_04448=I don''t know what to do if value is not a ServerStringValue ERR_04449=The value ''{0}'' can't be normalized, it hasn''t been added ERR_04450=The value ''{0}'' is incorrect, it hasn''t been added ERR_04451=The value must be a String, as its AttributeType is H/R ERR_04452=The value must be a byte[], as its AttributeType is not H/R ERR_04453=The upID ({0}) is not an OID or is different from the AttributeType OID ({1}) ERR_04454=Cannot use standard serialization for a ServerAttribute ERR_04455=The ID ''{0}''is incompatible with the AttributeType''s id ''{1}'' ERR_04456=An ID cannnot be null, empty, or resolved to an emtpy value when trimmed ERR_04457_NULL_ATTRIBUTE_ID=The ID should not be null or empty ERR_04458=Cannot add an attribute without an ID ERR_04459=We have had an error while adding the ''{0}'' AttributeType : {1} ERR_04460_ATTRIBUTE_TYPE_NULL_NOT_ALLOWED=The attributeType should not be null ERR_04461=Only String values supported for objectClass attribute ERR_04462=The EntryAttribute list should not contain null elements ERR_04463=The ''{0}'' id is not compatible with the ''{1}'' attribute type ERR_04464=Error while adding values into the ''{0}'' attribute. Error \: {1} ERR_04465=The removal of values for the missing ''{0}'' attribute is not possible ERR_04466=The removal of values for the bad ''{0}'' attribute is not possible ERR_04467=The AttributeType list should not contain null values ERR_04468=Cannot use standard serialization for a ServerAttribute ERR_04469=Cannot use standard serialization for a ServerEntry ERR_04470=Cannot read the attribute as it''s OID (''{0}'') does not exist ERR_04471=Cannot serialize a Modification with no attribute ERR_04472=The attribute ''{0}'' is incorrect ERR_04473_NOT_VALID_VALUE=Not a valid value ''{0}'' for the AttributeType ''{1}'' ERR_04474=Expected string to normalize ERR_04475=Expected byte[] to normalize ERR_04476=Cannot set an AttributeType {0} when another one ({1}) is already present ERR_04477_NO_VALID_AT_FOR_THIS_ID=Cannot find a valid AttributeType for the ''{0}'' id ERR_04478_NO_VALUE_NOT_ALLOWED=Cannot create or add an Attribute with no value in it ERR_04479_INVALID_SYNTAX_VALUE= The value ''{0}'' does not respect the AttributeType ''{1}'' syntax ERR_04480_END_OF_STREAM=End of stream ERR_04481_ENTRY_NULL_VALUE=Entry can''t be null ERR_04482_CANNOT_SUBTYPE_COLLECTIVE=The Collective Attribute ({0}) cannot be subtyped ({1}) ERR_04483_COLLECTIVE_NOT_MULTI_VALUED=The Collective Attribute ({0}) cannot be single valued ERR_04484_COLLECTIVE_NOT_ALLOWED_IN_MUST=The Collective Attribute ({0}) cannot be added in the MUST list of the {1} ObjectClass ERR_04485_COLLECTIVE_NOT_ALLOWED_IN_MAY=The Collective Attribute ({0}) cannot be added in the MAY list of the {1} ObjectClass ERR_04486_VALUE_ALREADY_EXISTS=The value ''{0}'' already exists in the attribute ({1}) ERR_04487_ATTRIBUTE_IS_SINGLE_VALUED=The attribute ''{0}'' is single valued, we can't add no more values into it ERR_04488_SYNTAX_INVALID=Syntax invalid for ''{0}'' # ldap-constants ERR_05001_UNKNOWN_AUTHENT_LEVEL=Unknown AuthenticationLevel {0} # ldap-converter ERR_06001_EMPTY_OR_NULL_SCHEMA_OBJECT=The schemaObject is either null or is empty! ERR_06002_PARSER_FAILURE=Parser failure on\:\n\t{0}\nAntlr exception trace\:\n{1} ERR_06003_NO_NAME={0} the schema configuration element must specify a name. ERR_06004_CANNOT_GENERATE_SOURCES=Failed while generating sources for {0} : {1} ERR_06005_NULL_SCHEMA=Can''t generate a ldif for a null schema ERR_06006_NO_PROPERTY=the schema property must be set # ldap-jndi # no exception to translate ERR_08001=Cannot overwrite yet schema output directory already exists: {0} ERR_08002=Cannot copy non-existant source file {0} ERR_08003=Cannot have more than one entry in a schema ldif file : {0} ERR_08004=Exception occurred while parsing the ldif file {0} : {1} ERR_08005=Should not be hitting root without schema/schema pattern. ERR_08006=parent cannot be null # ldap-schema ERR_09001_DIRECTORY_CREATION_FAILED=The directory {0} could not be created # ldap-schema-loader ERR_10001=The attribute must be binary ERR_10002=Failed to access attribute bytes. ERR_10003=Failed to load schema LDIF file {0} ERR_10004=Expecting to find a schema.ldif file in provided baseDirectory path ''{0}'' but no such file found. ERR_10005={0} entry must have a valid {1} attribute, it''s null ERR_10006=Comparator OID {0} is not a valid OID ERR_10007={0} entry cannot be null ERR_10008={0} Schema description cannot be null ERR_10009=The schema {0} does not exists or is not loaded ERR_10010=entry cannot be null ERR_10011=entry must have a valid cn attribute ERR_10012=entry must have a valid {0} attribute ERR_10013=Cannot add the SyntaxChecker {0}, as the associated schema ({1}) is not loaded ERR_10014=Cannot add the SyntaxChecker {0} into the registries, as the associated schema ({1}) is disabled ERR_10015=The Comparator''s OID ({0}) is different from the loaded class'' OID ({1}) ERR_10016=Cannot add the Comparator {0}, as the associated schema ({1}) is not loaded ERR_10017=Cannot add the Comparator {0} into the registries, as the associated schema ({1}) is disabled ERR_10018=Cannot add the Normalizer {0}, as the associated schema ({1}) is not loaded ERR_10019=Cannot add the Normalizer {0} into the registries, as the associated schema ({1}) is disabled ERR_10020=Cannot add the Syntax {0}, as the associated schema ({1}) is not loaded ERR_10021=Cannot add the SyntaxChecker {0} into the registries, as the associated schema ({1}) is disabled ERR_10022=Cannot add the MatchingRule {0}, as the associated schema ({1}) is not loaded ERR_10023=Cannot add the MatchingRule {0} into the registries, as the associated schema ({1}) is disabled ERR_10024=Cannot add the ObjectClass {0}, as the associated schema ({1}) is not loaded ERR_10025=Cannot add the ObjectClass {0} into the registries, as the associated schema ({1}) is disabled ERR_10026=Cannot add the AttributeType {0}, as the associated schema ({1}) is not loaded ERR_10027=Cannot add the AttributeType {0} into the registries, as the associated schema ({1}) is disabled ERR_10028={0} entry must have a valid {1} attribute # ldap-schema-manager ERR_11001=Cannot load the unknown schema {0} ERR_11002=Cannot load the Schema {0} as one of its dependencies has not been loaded ERR_11003=Need to implement factory method for creating a DitContentRule ERR_11004=Need to implement factory method for creating a DitStructureRule ERR_11005=Need to implement factory method for creating a MatchingRuleUse ERR_11006=Need to implement factory method for creating a NameForm ERR_11007=the SchemaObject {0} cannot be added, it''s not a valid LoadableSchemaObject. ERR_11008=Oid {0} for new schema entity is not unique. ERR_11009=Cannot add the SchemaObject {0} into a non existing schema {1} ERR_11010=Cannot inject the SchemaObject {0} as it''s not associated with a schema ERR_11011=Oid {0} for new schema entity does not exist. ERR_11012=Cannot remove {0} for the registries, it would become inconsistent. The following SchemaObjects are referencing this SchemaObject : {1} ERR_11013=Cannot delete the SchemaObject {0} as it''s not associated with a schema # ldif ERR_12001_UNKNOWN_CHANGE_TYPE=Unknown change type value {0} ERR_12002_ENTRY_WITH_TWO_DNS=An entry must not have two DNs, at line {0} ERR_12003_LDIF_ENTRY_WITH_TWO_DNS=A ldif entry should not have two DNs ERR_12004_CHANGE_NOT_ALLOWED=We cannot have changes when reading a file which already contains entries, at line {0} ERR_12005_NO_CHANGE=No changes within entries ERR_12006_EXPECTING_ATTRIBUTE_TYPE=Expecting an attribute type ERR_12007_BAD_ATTRIBUTE=Bad attribute ERR_12008_CANNOT_PARSE_LDIF_BUFFER=Cannot parse the ldif buffer : {0} ERR_12009_ERROR_PARSING_LDIF_BUFFER=Error while parsing the ldif buffer ERR_12010_CANNOT_FIND_FILE=Cannot find file {0} ERR_12011_CANNOT_READ_FILE=Cannot read file {0} ERR_12012_EMPTY_DN_NOT_ALLOWED=A ldif entry must have a non empty DN, at line {0} ERR_12013_NO_DN=No DN for entry ERR_12014_BASE64_DN_EXPECTED=The ldif entry is supposed to have a base 64 encoded DN, at line {0} ERR_12015_INVALID_BASE64_DN=Invalid base 64 encoded DN ERR_12016_DN_EXPECTED=A ldif entry must start with a DN, at line {0} ERR_12017_INVALID_DN=The DN {0} is not valid, at line {1} ERR_12018_FILE_NOT_FOUND=File {0} not found, at line {1} ERR_12019_BAD_URL_FILE_NOT_FOUND=Bad URL, file not found ERR_12020_FILE_TOO_BIG=File {0} is too big, at line {1} ERR_12022_ERROR_READING_FILE=File {0} error reading, at line {1} ERR_12023_ERROR_READING_BAD_URL=Bad URL, file can''t be read ERR_12024_CANNOT_CLOSE_FILE=Error while closing the stream : {0}, at line {1} ERR_12025_BAD_PROTOCOL=Protocols other than file: are not supported ERR_12026_UNSUPPORTED_PROTOCOL=Unsupported URL protocol, at line {0} ERR_12027_BAD_URL=Bad URL {0}, at line {1} ERR_12029_CONTROL_WITHOUT_OID=The control does not have an OID, at line {0} ERR_12031_INVALID_OID=The OID {0} is not valid, at line {1} ERR_12033_INVALID_CRITICALITY=The control must have a valid criticality, at line {0} ERR_12035_BAD_MODRDN_OPERATION=A modrdn operation must start with a "newrdn\:", at line {0} ERR_12038_NO_DELETEOLDRDN=A modrdn operation must contains a "deleteoldrdn\:", at line {0} ERR_12040_BAD_MODIFY_SEPARATOR=Bad state : we should have come from an ATTRVAL_SPEC, at line {0} ERR_12042_BAD_MODIFY_SEPARATOR_2=Bad state : we should have come from a MOD_SPEC or an ATTRVAL_SPEC, at line {0} ERR_12044=The modified attribute and the attribute value spec must be equal, at line {0} ERR_12045=Bad modify attribute ERR_12046=A moddn operation must contains a "newsuperior\:", at line {0} ERR_12047=Bad moddn operation, no newsuperior ERR_12048=Unknown operation, at line {0} ERR_12049=Bad operation ERR_12050=We already have had a control, at line {0} ERR_12051=Control misplaced ERR_12052=We already have had a changeType, at line {0} ERR_12053=ChangeType misplaced ERR_12054=We can''t have a Attribute/Value pair after a control or a changeType, at line {0} ERR_12055=AttributeType misplaced ERR_12056=Expecting an attribute type, at line {0} ERR_12057_BAD_ATTRIBUTE=Bad attribute ERR_12058_UNKNOWN_ENTRY_TYPE=Unknown entry type, at line {0} ERR_12059_UNKNOWN_ENTRY=Unknown entry ERR_12060_VERSION_NOT_A_NUMBER=The version is not a number, at line {0} ERR_12061_LDIF_PARSING_ERROR=Ldif parsing error ERR_12062_EMPTY_CONTINUATION_LINE=Cannot have an empty continuation line, at line {0} ERR_12063_ERROR_WHILE_READING_LDIF_LINE=Error while reading ldif lines ERR_12064_EMPTY_FILE_NAME=Cannot parse an empty file name ! ERR_12066=Cannot parse the file {0}, it does not exist ERR_12067=Filename {0} not found. ERR_12068=Cannot find file {0} ERR_12069=Cannot parse the ldif buffer : {0} ERR_12070=Error while parsing the ldif buffer ERR_12071=Premature termination of LDIF iterator ERR_12072=Error while parsing ldif : {0} ERR_12073=Could not deduce reverse modifications from provided modifications: {0} ERR_12074=newSuperiorDn must not be null ERR_12075=modifiedDn must not be null ERR_12076=Don''t think about moving the rootDSE. ERR_12077=The newRdn must not be null ERR_12078=The modified Dn must not be null ERR_12079=Don''t think about renaming the rootDSE. ERR_12080=Can''t rename an entry using the same name ... ERR_12081=Invalid Entry : a deleted entry should not contain attributes ERR_12082=Invalid Entry : a added or modified entry should contain attributes ERR_12083=Invalid Entry : a modifyDN operation entry should not contain attributes ERR_12084=The length of each line must be at least 2 chars long ERR_12085=The Attribute ID #{0} must be a String ERR_12086=The Attribute value #{0} must be a String or a byte[] ERR_12087=A value is missing at the end apache-ldap-api-1.0.0-src/i18n/src/main/resources/org/apache/directory/api/i18n/messages.properties0100644 0000767 0000024 00000001563 13114114303 034474 0ustar00elecharnystaff0000000 0000000 # # 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. # # # ldap model messages MSG_04489_SYNTAX_VALID=Syntax valid for ''{0}'' apache-ldap-api-1.0.0-src/i18n/src/site/site.xml0100644 0000767 0000024 00000002011 13114114303 022664 0ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/pom.xml0100644 0000767 0000024 00000007674 13114114302 021332 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-parent 1.0.0 api-integ Apache Directory API Integration Tests A place to put integration tests that if put in their rightful project position would incure some cyclic dependencies even if the dependencies were test scoped dependencies. org.apache.directory.junit junit-addons test ${project.groupId} api-ldap-schema-data test ${project.groupId} api-ldap-extras-aci test ${project.groupId} api-ldap-extras-codec test ${project.groupId} api-ldap-net-mina test ${project.groupId} api-ldap-codec-standalone test ${project.build.directory}/pluginDirectory org.apache.maven.plugins maven-dependency-plugin copy process-test-resources copy ${project.groupId} api-ldap-extras-codec ${project.version} ${codec.plugin.directory} apache-ldap-api-1.0.0-src/integ/src/checkstyle/suppressions.xml0100644 0000767 0000024 00000002321 13114114302 026221 0ustar00elecharnystaff0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/site/site.xml0100644 0000767 0000024 00000002011 13114114302 023212 0ustar00elecharnystaff0000000 0000000 ././@LongLink0100644 0000000 0000000 00000000150 13114114302 011615 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemCheckerTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemCheckerTest.j0100644 0000767 0000024 00000033425 13114114302 034451 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.aci; import static org.junit.Assert.fail; import java.text.ParseException; 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; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Unit tests class for ACIItem checker (wrapper). * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class ACIItemCheckerTest { /** the ACIItem checker wrapper */ private static ACIItemChecker checker; /** * Initialization */ @BeforeClass public static void init() throws Exception { JarLdifSchemaLoader loader = new JarLdifSchemaLoader(); SchemaManager schemaManager = new DefaultSchemaManager( loader ); schemaManager.loadAllEnabled(); checker = new ACIItemChecker( schemaManager ); } /** * Tests the checker with an ACIItem of ItemFirst main component. */ @Test public void testItemFirst() throws Exception { String spec = " { " + " identificationTag \"id1\" , " + " precedence 114 , " + " authenticationLevel simple , " + " itemOrUserFirst itemFirst :" + " { " + " protectedItems " + " { " + " entry , " + " attributeType { 1.2.3 , ou } ," + " attributeValue { ou=people , cn=Ersin } , " + " rangeOfValues (cn=ErsinEr) , " + " classes and : " + " { " + " item: xyz , " + " or:{item:X,item:Y} " + " }" + " } , " + " itemPermissions " + " { " + " { " + " userClasses " + " {" + " allUsers , " + " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } ," + " subtree { { base \"ou=people\" } } " + " } , " + " grantsAndDenials { denyCompare , grantModify } " + " }," + " { " + " precedence 10, " + " userClasses " + " {" + " allUsers , " + " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } ," + " subtree { { base \"ou=people\" } } " + " } , " + " grantsAndDenials { denyCompare , grantModify } " + " } " + " } " + " }" + " }"; checker.parse( spec ); } /** * Tests the checker with an ACIItem of UserFirst main component. */ @Test public void testUserFirst() throws Exception { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {cn=y,sn=n,dc=l} , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } } } "; checker.parse( spec ); } @Test public void testAllowAddAllUsers() throws Exception { String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, " + "itemOrUserFirst userFirst: { " + "userClasses { allUsers }, " + "userPermissions { { protectedItems {entry}, " + "grantsAndDenials { grantAdd } } } } }"; checker.parse( spec ); } @Test public void testCombo() throws Exception { String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, " + "itemOrUserFirst userFirst: { " + "userClasses { allUsers, name { \"ou=blah\" } }, " + "userPermissions { { protectedItems {entry}, " + "grantsAndDenials { grantAdd } } } } }"; checker.parse( spec ); } @Test public void testOrderOfProtectedItemsDoesNotMatter() throws Exception { String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , " + "itemOrUserFirst itemFirst :{ protectedItems { attributeType { 1.2.3 , ou }, entry , " + " rangeOfValues (cn=ErsinEr) , attributeValue { ou=people , cn=Ersin }," + "classes and : { item: xyz , or:{item:X,item:Y} }} , " + "itemPermissions { { userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } }," + "{ precedence 10, userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}"; checker.parse( spec ); } @Test public void testOrderOfUserClassesDoesNotMatter() throws Exception { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { name { \"ou=people,cn=ersin\" }, allUsers, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {dc=y,sn=n,dc=l} , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } } } "; checker.parse( spec ); } @Test public void testItemPermissionComponentsOrderDoesNotMatter() throws Exception { String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , " + "itemOrUserFirst itemFirst :{ protectedItems { attributeType { 1.2.3 , ou }, entry , " + " rangeOfValues (cn=ErsinEr) , attributeValue { ou=people , cn=Ersin }," + "classes and : { item: xyz , or:{item:X,item:Y} }} , " + "itemPermissions { { grantsAndDenials { denyCompare , grantModify }, userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } } }," + "{ precedence 10, userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}"; checker.parse( spec ); } @Test public void testUserPermissionComponentsOrderDoesNotMatter() throws Exception { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { grantsAndDenials { grantBrowse }, protectedItems{ entry , attributeType { cn , ou } , attributeValue {cn=y,sn=n,dc=l} , " + "rangeOfValues (cn=ErsinEr) } } } } } "; checker.parse( spec ); } @Test public void testOrderOfMainACIComponentsDoesNotMatter() throws Exception { String spec = "{ itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {cn=y,sn=n,dc=l} , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } }, " + " identificationTag \"id2\" , authenticationLevel none, precedence 14 } "; checker.parse( spec ); } @Test public void testRestrictedValueComponentsOrderDoesNotMatter() throws Exception { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\"}, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , " + "maxValueCount { { type 10.11.12, maxCount 10 }, { maxCount 20, type 11.12.13 } } " + " } , grantsAndDenials { grantBrowse } } } } } "; checker.parse( spec ); } @Test public void testMaxValueCountComponentsOrderDoesNotMatter() throws Exception { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , " + "restrictedBy { { type 10.11.12, valuesIn ou }, { valuesIn cn, type 11.12.13 } } " + " } , grantsAndDenials { grantBrowse } } } } } "; checker.parse( spec ); } /** * Test case for DIRSERVER-891 */ @Test public void testInvalidAttributeValue() { String spec; // no name-value-pair spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue { must_be_a_name_value_pair } , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } }, userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + " maximum 2, minimum 1 } } } } } "; try { checker.parse( spec ); fail( "Expected ParseException, invalid protected item 'attributeValue { must_be_a_name_value_pair }'" ); } catch ( ParseException e ) { // Expected } // no name-value-pair spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue { x=y,m=n,k=l,x } , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } }, userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + " maximum 2, minimum 1 } } } } } "; try { checker.parse( spec ); fail( "Expected ParseException, invalid protected item 'attributeValue { must_be_a_name_value_pair }'" ); } catch ( ParseException e ) { // Expected } } /** * Test case for DIRSERVER-891 */ @Test public void testIncomplete() { String spec; spec = "{ }"; try { checker.parse( spec ); fail( "Expected ParseException, ACIItem is incomplete'" ); } catch ( ParseException e ) { // Expected } spec = "{ identificationTag \"id2\" }"; try { checker.parse( spec ); fail( "Expected ParseException, ACIItem is incomplete'" ); } catch ( ParseException e ) { // Expected } spec = "{ identificationTag \"id2\", precedence 14 } "; try { checker.parse( spec ); fail( "Expected ParseException, ACIItem is incomplete'" ); } catch ( ParseException e ) { // Expected } spec = "{ identificationTag \"id2\", precedence 14, authenticationLevel none } "; try { checker.parse( spec ); fail( "Expected ParseException, ACIItem is incomplete'" ); } catch ( ParseException e ) { // Expected } } } ././@LongLink0100644 0000000 0000000 00000000147 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.ja0100644 0000767 0000024 00000077752 13114114302 034515 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.aci; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import java.text.ParseException; 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; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Unit tests class for ACIItem parser (wrapper). * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class ACIItemParserTest { /** the ACIItem parser wrapper */ private static ACIItemParser parser; /** * Initialization */ @BeforeClass public static void init() throws Exception { JarLdifSchemaLoader loader = new JarLdifSchemaLoader(); SchemaManager schemaManager = new DefaultSchemaManager( loader ); schemaManager.loadAllEnabled(); parser = new ACIItemParser( schemaManager ); } private void checkItemToString( String spec, ACIItem item ) throws Exception { // try to parse the result of item.toString() again parser.parse( item.toString() ); } /** * Tests the parser with a rangeOfValues with a nested filter. */ @Test public void testRangeOfValues() throws Exception { String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , " + "itemOrUserFirst itemFirst :{ protectedItems " + "{ rangeOfValues (&(&(|(|(cn=ccc)(!(cn=ddd))(&(cn=aaa)(cn=bbb)))))) " + "} , itemPermissions { } } }"; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); spec = " { identificationTag \"id8\", precedence 0, authenticationLevel simple " + ", itemOrUserFirst userFirst: { userClasses { allUsers }, userPermissions { " + " { protectedItems { rangeOfValues (&(cn=test)(sn=test)) }, grantsAndDenials { grantAdd } }, " + "{ protectedItems { rangeOfValues (|(!(cn=aaa))(sn=bbb)) }, grantsAndDenials { grantAdd } } " + " } } }"; item = parser.parse( spec ); checkItemToString( spec, item ); } /** * Tests the parser with an ACIItem of ItemFirst main component. */ @Test public void testItemFirst() throws Exception { String spec = "{ " + " identificationTag \"id1\" , " + " precedence 114 , " + " authenticationLevel simple , " + " itemOrUserFirst itemFirst :" + " { " + " protectedItems { entry , attributeType { 2.5.4.3 , ou } , " + " attributeValue { ou=people , cn=Ersin } , " + " rangeOfValues (cn=ErsinEr) , " + " classes and : { item: xyz , or:{item:X,item:Y} }" + " } , " + " itemPermissions " + " { " + " { " + " userClasses " + " {" + " allUsers , " + " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } , " + " subtree { { base \"ou=people\" } } " + " } , " + " grantsAndDenials { denyCompare , grantModify } " + " }," + " { " + " precedence 10, " + " userClasses " + " {" + " allUsers , " + " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } ," + " subtree { { base \"ou=people\" } } " + " } , " + " grantsAndDenials { denyCompare , grantModify } } " + " } " + " }" + "}"; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } /** * Tests the parser with an ACIItem of UserFirst main component. */ @Test public void testUserFirst() throws Exception { String spec = "{ " + " identificationTag \"id2\" , " + " precedence 14, " + " authenticationLevel none , " + " itemOrUserFirst userFirst: " + " { " + " userClasses " + " { " + " allUsers , " + " name { \"ou=people,cn=ersin\" }, " + " subtree " + " {" + " { base \"ou=system\" }, " + " { " + " base \"ou=ORGANIZATIONUNIT\"," + " minimum 1, " + " maximum 2 " + " } " + " } " + " } , " + " userPermissions " + " { " + " { " + " protectedItems" + " { " + " entry , " + " attributeType { cn , ou } , " + " attributeValue {cn=y,sn=n,dc=l} , " + " rangeOfValues (cn=ErsinEr) " + " } , " + " grantsAndDenials { grantBrowse } " + " } " + " } " + " } " + "} "; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } @Test public void testAllowAddAllUsers() throws Exception { String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, " + "itemOrUserFirst userFirst: { " + "userClasses { allUsers }, " + "userPermissions { { protectedItems {entry}, " + "grantsAndDenials { grantAdd } } } } }"; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } @Test public void testCombo() throws Exception { String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, " + "itemOrUserFirst userFirst: { " + "userClasses { allUsers, name { \"ou=blah\" } }, " + "userPermissions { { protectedItems {entry}, " + "grantsAndDenials { grantAdd } } } } }"; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } @Test public void testOrderOfProtectedItemsDoesNotMatter() throws Exception { String spec = " { " + " identificationTag \"id1\" , " + " precedence 114 , " + " authenticationLevel simple , " + " itemOrUserFirst itemFirst :" + " { " + " protectedItems " + " { " + " attributeType { 2.5.4.3 , ou }, " + " entry , " + " rangeOfValues (cn=ErsinEr) , " + " attributeValue { ou=people , cn=Ersin }," + " classes and : " + " { item: xyz , or:{item:X,item:Y} }" + " } , " + " itemPermissions " + " { " + " { " + " userClasses " + " {" + " allUsers , " + " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,sn=d\" } " + " , " + " subtree " + " { " + " { base \"ou=people\" } " + " } " + " } , " + " grantsAndDenials " + " { " + " denyCompare , " + " grantModify " + " } " + " }," + " { " + " precedence 10, " + " userClasses " + " {" + " allUsers , " + " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } " + " } , " + " grantsAndDenials { denyCompare , grantModify } " + " } " + " } " + " }" + " }"; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } @Test public void testOrderOfUserClassesDoesNotMatter() throws Exception { String spec = "{ " + " identificationTag \"id2\" , " + " precedence 14, " + " authenticationLevel none , " + " itemOrUserFirst userFirst: " + " { " + " userClasses " + " { " + " name { \"ou=people,cn=ersin\" }, " + " allUsers, " + " subtree " + " {" + " { base \"ou=system\" }, " + " { " + " base \"ou=ORGANIZATIONUNIT\"," + " minimum 1, " + " maximum 2 " + " } " + " } " + " } , " + " userPermissions " + " { " + " { " + " protectedItems" + " { " + " entry , " + " attributeType { cn , ou } , " + " attributeValue {cn=y,sn=n,dc=l} , " + " rangeOfValues (cn=ErsinEr) " + " } , " + " grantsAndDenials { grantBrowse } " + " } " + " } " + " } " + "}"; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } @Test public void testOrderOfProtectedItemsDoesNotMatterButDuplicatesMatter() throws Exception { String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , " + "itemOrUserFirst itemFirst :{ protectedItems { attributeType { 1.2.3 , ou }, entry, entry , " + " rangeOfValues (cn=ErsinEr) , attributeValue { ou=people , cn=Ersin }," + "classes and : { item: xyz , or:{item:X,item:Y} }} , " + "itemPermissions { { userClasses {allUsers , userGroup { \"1.2=y,z=t\" , \"a=b,c=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } }," + "{ precedence 10, userClasses {allUsers , userGroup { \"1.2=y,z=t\" , \"a=b,c=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}"; try { parser.parse( spec ); fail( "testItemFirstOrderOfProtectedItemsDoesNotMatterButDuplicatesMatter() should not have run this line." ); } catch ( ParseException e ) { assertNotNull( e ); } } @Test public void testOrderOfUserClassesDoesNotMatterButDuplicatesMatter() throws Exception { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { name { \"ou=people,cn=ersin\" }, allUsers, allUsers, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {x=y,m=n,k=l} , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } } } "; try { parser.parse( spec ); fail( "testUserFirstOrderOfUserClassesDoesNotMatterButDuplicatesMatter() should not have run this line." ); } catch ( ParseException e ) { assertNotNull( e ); } } @Test public void testItemPermissionComponentsOrderDoesNotMatter() throws Exception { String spec = " { " + " identificationTag \"id1\" , " + " precedence 114 , " + " authenticationLevel simple , " + " itemOrUserFirst itemFirst :" + " { " + " protectedItems " + " { " + " attributeType { 2.5.4.3 , ou }, " + " entry , " + " rangeOfValues (cn=ErsinEr) , " + " attributeValue { ou=people , cn=Ersin }," + " classes and : { item: xyz , or:{item:X,item:Y} }" + " } , " + " itemPermissions " + " { " + " { " + " grantsAndDenials " + " { " + " denyCompare , grantModify " + " }, " + " userClasses " + " {" + " allUsers , " + " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } " + " } " + " }," + " { " + " precedence 10, " + " userClasses " + " {" + " allUsers , " + " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } " + " } , " + " grantsAndDenials { denyCompare , grantModify } " + " } " + " } " + " }" + " }"; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } @Test public void testItemPermissionComponentsOrderDoesNotMatterButDuplicatesMatter() throws Exception { String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , " + "itemOrUserFirst itemFirst :{ protectedItems { attributeType { 1.2.3 , ou }, entry , " + " rangeOfValues (cn=ErsinEr) , attributeValue { ou=people , cn=Ersin }," + "classes and : { item: xyz , or:{item:X,item:Y} }} , " + "itemPermissions { { userClasses {allUsers , userGroup { \"1.2=y,z=t\" , \"a=b,c=d\" } " + " , subtree { { base \"ou=people\" } } }, grantsAndDenials { denyCompare , grantModify }, userClasses {allUsers , userGroup { \"1.2=y,z=t\" , \"a=b,c=d\" } " + " , subtree { { base \"ou=people\" } } } }," + "{ precedence 10, userClasses {allUsers , userGroup { \"1.2=y,z=t\" , \"a=b,c=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}"; try { parser.parse( spec ); fail( "testItemPermissionComponentsOrderDoesNotMatterButDuplicatesMatter() should not have run this line." ); } catch ( ParseException e ) { assertNotNull( e ); } } @Test public void testUserPermissionComponentsOrderDoesNotMatter() throws Exception { String spec = "{ " + " identificationTag \"id2\" , " + " precedence 14, " + " authenticationLevel none , " + " itemOrUserFirst userFirst: " + " { " + " userClasses " + " { " + " allUsers , " + " name { \"ou=people,cn=ersin\" }, " + " subtree " + " {" + " { base \"ou=system\" }, " + " { " + " base \"ou=ORGANIZATIONUNIT\"," + " minimum 1, " + " maximum 2 " + " } " + " } " + " } , " + " userPermissions " + " { " + " { " + " grantsAndDenials { grantBrowse }, " + " protectedItems" + " { " + " entry , " + " attributeType { cn , ou } , " + " attributeValue {cn=y,sn=n,dc=l} , " + " rangeOfValues (cn=ErsinEr) " + " } " + " } " + " } " + " } " + "} "; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } @Test public void testUserPermissionComponentsOrderDoesNotMatterButDuplicatesMatter() throws Exception { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { grantsAndDenials { grantBrowse }, grantsAndDenials { grantBrowse }, protectedItems{ entry , attributeType { cn , ou } , attributeValue {x=y,m=n,k=l} , " + "rangeOfValues (cn=ErsinEr) } } } } } "; try { parser.parse( spec ); fail( "testUserPermissionComponentsOrderDoesNotMatterButDuplicatesMatter() should not have run this line." ); } catch ( ParseException e ) { assertNotNull( e ); } } @Test public void testOrderOfMainACIComponentsDoesNotMatter() throws Exception { String spec = "{ " + " itemOrUserFirst userFirst: " + " { " + " userClasses " + " { " + " allUsers , " + " name { \"ou=people,cn=ersin\" }, " + " subtree " + " {" + " { base \"ou=system\" }, " + " { " + " base \"ou=ORGANIZATIONUNIT\"," + " minimum 1, " + " maximum 2 " + " } " + " } " + " } , " + " userPermissions " + " { " + " { " + " protectedItems" + " { " + " entry , " + " attributeType { cn , ou } , " + " attributeValue {cn=y,sn=n,dc=l} , " + " rangeOfValues (cn=ErsinEr) " + " } , " + " grantsAndDenials { grantBrowse } " + " } " + " } " + " }, " + " identificationTag \"id2\" , " + " authenticationLevel none, " + " precedence 14 " + "} "; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } @Test public void testOrderOfMainACIComponentsDoesNotMatterButDuplicatesMatter() throws Exception { String spec = "{ itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {x=y,m=n,k=l} , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } }, " + " identificationTag \"id2\" , authenticationLevel none, authenticationLevel simple, precedence 14 } "; try { parser.parse( spec ); fail( "testOrderOfMainACIComponentsDoesNotMatterButDuplicatesMatter() should not have run this line." ); } catch ( ParseException e ) { assertNotNull( e ); } } @Test public void testOrderOfMainACIComponentsDoesNotMatterButMissingsMatter() throws Exception { String spec = "{ itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {x=y,m=n,k=l} , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } }, " + " identificationTag \"id2\" , precedence 14 } "; try { parser.parse( spec ); fail( "testOrderOfMainACIComponentsDoesNotMatterButMissingsMatter() should not have run this line." ); } catch ( ParseException e ) { assertNotNull( e ); } } @Test public void testGrantAndDenialBitsOrderDoesNotMatterButDuplicatesMatter() throws Exception { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers } , " + "userPermissions { { protectedItems{ entry } , grantsAndDenials { grantBrowse, grantInvoke, denyAdd, grantBrowse } } } } }"; try { parser.parse( spec ); fail( "testGrantAndDenialBitsOrderDoesNotMatterButDuplicatesMatter() should not have run this line." ); } catch ( ParseException e ) { assertNotNull( e ); } } @Test public void testMaxValueCountComponentsOrderDoesNotMatter() throws Exception { String spec = "{ " + " identificationTag \"id2\" , " + " precedence 14, " + " authenticationLevel none , " + " itemOrUserFirst userFirst: " + " { " + " userClasses " + " { " + " allUsers , " + " name { \"ou=people,cn=ersin\" }, " + " subtree " + " {" + " { base \"ou=system\"}, " + " { base \"ou=ORGANIZATIONUNIT\", minimum 1, maximum 2 } " + " } " + " } , " + " userPermissions " + " { " + " { " + " protectedItems" + " { " + " entry , " + " maxValueCount " + " { " + " { type 2.5.4.3, maxCount 10 }, " + " { maxCount 20, type 2.5.4.3 } " + " } " + " } , " + " grantsAndDenials { grantBrowse } " + " } " + " } " + " } " + "} "; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } @Test public void testRestrictedValueComponentsOrderDoesNotMatter() throws Exception { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , " + "restrictedBy { { type 2.5.4.3, valuesIn ou }, { valuesIn cn, type 2.5.4.3 } } " + " } , grantsAndDenials { grantBrowse } } } } } "; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } @Test public void testMaxImmSubComponentsOrderDoesNotMatter() throws Exception { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , maxImmSub 5 " + " } , grantsAndDenials { grantBrowse } } } } } "; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } /** * Test case for DIRSERVER-891 */ @Test public void testInvalidAttributeValue() { String spec; // no name-value-pair spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue { must_be_a_name_value_pair } , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } }, userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + " maximum 2, minimum 1 } } } } } "; try { parser.parse( spec ); fail( "Expected ParseException, invalid protected item 'attributeValue { must_be_a_name_value_pair }'" ); } catch ( ParseException e ) { // Expected } // no name-value-pair spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue { x=y,m=n,k=l,x } , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } }, userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + " maximum 2, minimum 1 } } } } } "; try { parser.parse( spec ); fail( "Expected ParseException, invalid protected item 'attributeValue { x=y,m=n,k=l,x }'" ); } catch ( ParseException e ) { // Expected } } @Test public void testUserClassParentOfEntry() throws Exception { String spec = "{ " + " identificationTag \"id\" , " + " precedence 10, " + " authenticationLevel none , " + " itemOrUserFirst userFirst: " + " { " + " userClasses " + " { " + " parentOfEntry , " + " name { \"cn=ersin,ou=people\" }, " + " subtree " + " {" + " { base \"ou=system\" }, " + " { " + " base \"ou=ORGANIZATIONUNIT\"," + " minimum 1, " + " maximum 2 " + " } " + " } " + " } , " + " userPermissions " + " { " + " { " + " protectedItems" + " { " + " entry , " + " attributeType { cn , ou } , " + " attributeValue {cn=y,sn=n,dc=l} , " + " rangeOfValues (cn=ErsinEr) " + " } , " + " grantsAndDenials { grantBrowse } " + " } " + " } " + " } " + "} "; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); } /** * Test case for DIRSTUDIO-440 */ @Test public void testPrecedenceOfUserFirst() throws Exception { 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 } } } } }"; ACIItem item = parser.parse( spec ); checkItemToString( spec, item ); UserFirstACIItem userFirstItem = ( UserFirstACIItem ) item; int aciPrecedence = userFirstItem.getPrecedence(); assertEquals( 14, aciPrecedence ); for ( UserPermission permission : userFirstItem.getUserPermission() ) { int precedence = permission.getPrecedence(); if ( precedence == 1 ) { assertEquals( 1, precedence ); } else if ( precedence == 2 ) { assertEquals( 2, precedence ); } else { fail( "Got precedence " + precedence + ", expected precedence 1 or 2." ); } } } /** * Test case for DIRSERVER-891 */ @Test public void testIncomplete() { String spec; spec = "{ }"; try { parser.parse( spec ); fail( "Expected ParseException, ACIItem is incomplete'" ); } catch ( ParseException e ) { // Expected } spec = "{ identificationTag \"id2\" }"; try { parser.parse( spec ); fail( "Expected ParseException, ACIItem is incomplete'" ); } catch ( ParseException e ) { // Expected } spec = "{ identificationTag \"id2\", precedence 14 } "; try { parser.parse( spec ); fail( "Expected ParseException, ACIItem is incomplete'" ); } catch ( ParseException e ) { // Expected } spec = "{ identificationTag \"id2\", precedence 14, authenticationLevel none } "; try { parser.parse( spec ); fail( "Expected ParseException, ACIItem is incomplete'" ); } catch ( ParseException e ) { // Expected } } } ././@LongLink0100644 0000000 0000000 00000000172 13114114302 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdap0100644 0000767 0000024 00000012567 13114114302 034650 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.codec.api; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import org.apache.directory.api.ldap.codec.standalone.StandaloneLdapApiService; import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicy; import org.apache.directory.api.ldap.extras.extended.storedProcedure.StoredProcedureRequest; import org.apache.directory.api.ldap.extras.extended.storedProcedure.StoredProcedureRequestImpl; import org.apache.directory.api.ldap.model.message.Control; import org.apache.directory.api.util.Strings; import org.junit.BeforeClass; import org.junit.Test; /** * Tests for StandaloneLdapCodecService. * * @author Apache Directory Project */ public class StandaloneLdapCodecServiceTest { @BeforeClass public static void setupLdapApiService() throws Exception { // Load the extension points System.setProperty( StandaloneLdapApiService.CONTROLS_LIST, "org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory," + "org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory," + "org.apache.directory.api.ldap.codec.controls.proxiedauthz.ProxiedAuthzFactory," + "org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory," + "org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory," + "org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory," + "org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory," + "org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory," + "org.apache.directory.api.ldap.extras.controls.vlv_impl.VirtualListViewRequestFactory," + "org.apache.directory.api.ldap.extras.controls.vlv_impl.VirtualListViewResponseFactory," + "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory," + "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory," + "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory," + "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory," + "org.apache.directory.api.ldap.extras.controls.ad_impl.AdDirSyncFactory" ); System .setProperty( StandaloneLdapApiService.EXTENDED_OPERATIONS_LIST, "org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory," + "org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory," + "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory," + "org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory," + "org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyFactory," + "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory," + "org.apache.directory.api.ldap.extras.extended.ads_impl.whoAmI.WhoAmIFactory," + "org.apache.directory.api.ldap.extras.extended.ads_impl.startTls.StartTlsFactory" ); } /** * Test method for {@link org.apache.directory.api.ldap.codec.standalone.StandaloneLdapCodecService#StandaloneLdapCodecService()}. */ @Test public void testLoadingExtras() throws Exception { LdapApiService codec = LdapApiServiceFactory.getSingleton(); assertTrue( codec.isControlRegistered( PasswordPolicy.OID ) ); CodecControl control = codec.newControl( PasswordPolicy.OID ); assertNotNull( control ); assertNotNull( codec ); } /** * Test an extended operation. */ @Test public void testLoadingExtendedOperation() throws Exception { LdapApiService codec = LdapApiServiceFactory.getSingleton(); StoredProcedureRequest req = new StoredProcedureRequestImpl(); req.setLanguage( "Java" ); req.setProcedure( Strings.getBytesUtf8( "bogusProc" ) ); assertNotNull( req ); assertNotNull( codec ); StoredProcedureRequest decorator = ( StoredProcedureRequest ) codec.decorate( req ); assertNotNull( decorator ); } } ././@LongLink0100644 0000000 0000000 00000000175 13114114302 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareAttributeSerializationTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareAttribu0100644 0000767 0000024 00000016276 13114114302 035006 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.entry; import static org.junit.Assert.assertEquals; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; 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.exception.LdapInvalidAttributeValueException; import org.apache.directory.api.ldap.model.schema.AttributeType; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.junit.BeforeClass; import org.junit.Test; /** * Test the Attribute Serialization * * @author Apache Directory Project */ public class SchemaAwareAttributeSerializationTest { private static byte[] data1 = new byte[] { 0x01, 0x02, 0x03, 0x04 }; private static byte[] data2 = new byte[] { 0x05, 0x06, 0x07, 0x08 }; private static byte[] data3 = new byte[] { 0x09, 0x0A, 0x0B, 0x0C }; private static AttributeType cn = null; private static AttributeType userCertificate = null; private static SchemaManager schemaManager; /** * Initialize OIDs maps for normalization */ @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); cn = schemaManager.getAttributeType( "cn" ); userCertificate = schemaManager.getAttributeType( "userCertificate" ); } @Test public void testEntryAttributeNoStringValueSerialization() throws IOException, ClassNotFoundException, LdapInvalidAttributeValueException { Attribute attribute1 = new DefaultAttribute( cn ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); attribute1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Attribute attribute2 = new DefaultAttribute( cn ); attribute2.readExternal( in ); attribute2.apply( cn ); assertEquals( attribute1, attribute2 ); } @Test public void testEntryAttributeOneStringValueSerialization() throws IOException, ClassNotFoundException, LdapInvalidAttributeValueException { Attribute attribute1 = new DefaultAttribute( "CommonName", cn, "test" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); attribute1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Attribute attribute2 = new DefaultAttribute( cn ); attribute2.readExternal( in ); attribute2.apply( cn ); assertEquals( attribute1, attribute2 ); assertEquals( "CommonName", attribute2.getUpId() ); } @Test public void testEntryAttributeManyStringValuesSerialization() throws IOException, ClassNotFoundException, LdapInvalidAttributeValueException { Attribute attribute1 = new DefaultAttribute( "CN", cn, "test1", "test2", "test3" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); attribute1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Attribute attribute2 = new DefaultAttribute( cn ); attribute2.readExternal( in ); attribute2.apply( cn ); assertEquals( attribute1, attribute2 ); assertEquals( "CN", attribute2.getUpId() ); } @Test public void testEntryAttributeNoBinaryValueSerialization() throws IOException, ClassNotFoundException, LdapInvalidAttributeValueException, LdapInvalidAttributeValueException { Attribute attribute1 = new DefaultAttribute( userCertificate ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); attribute1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Attribute attribute2 = new DefaultAttribute( userCertificate ); attribute2.readExternal( in ); attribute2.apply( userCertificate ); assertEquals( attribute1, attribute2 ); } @Test public void testEntryAttributeOneBinaryValueSerialization() throws IOException, ClassNotFoundException, LdapInvalidAttributeValueException { Attribute attribute1 = new DefaultAttribute( userCertificate, data1 ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); attribute1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Attribute attribute2 = new DefaultAttribute( userCertificate ); attribute2.readExternal( in ); attribute2.apply( userCertificate ); assertEquals( attribute1, attribute2 ); } @Test public void testEntryAttributeManyBinaryValuesSerialization() throws IOException, ClassNotFoundException, LdapInvalidAttributeValueException { Attribute attribute1 = new DefaultAttribute( "UserCertificate", userCertificate, data1, data2, data3 ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); attribute1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Attribute attribute2 = new DefaultAttribute( userCertificate ); attribute2.readExternal( in ); attribute2.apply( userCertificate ); assertEquals( attribute1, attribute2 ); assertEquals( "UserCertificate", attribute2.getUpId() ); } } ././@LongLink0100644 0000000 0000000 00000000160 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareAttributeTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareAttribu0100644 0000767 0000024 00000202411 13114114302 034772 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.entry; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import org.apache.directory.api.ldap.model.entry.Attribute; import org.apache.directory.api.ldap.model.entry.BinaryValue; import org.apache.directory.api.ldap.model.entry.DefaultAttribute; import org.apache.directory.api.ldap.model.entry.StringValue; 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.LdapInvalidAttributeValueException; import org.apache.directory.api.ldap.model.schema.AttributeType; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.apache.directory.api.util.Strings; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; @RunWith(ConcurrentJunitRunner.class) @Concurrency() /** * Test the schema aware Attribute * * @author Apache Directory Project */ public class SchemaAwareAttributeTest { private AttributeType atCN = null; private AttributeType atDC; private AttributeType atSN; private AttributeType atName; // A SINGLE-VALUE attribute private AttributeType atC; // A Binary attribute private AttributeType atPwd; // A String attribute which allows null value private AttributeType atEMail; private final Value nullStringValue = new StringValue( ( String ) null ); private final Value nullBinaryValue = new BinaryValue( ( byte[] ) null ); private static final byte[] BYTES1 = new byte[] { 'a', 'b' }; private static final byte[] BYTES2 = new byte[] { 'b' }; private static final byte[] BYTES3 = new byte[] { 'c' }; private static final byte[] BYTES4 = new byte[] { 'd' }; private final StringValue stringValue1 = new StringValue( "a" ); private final StringValue stringValue2 = new StringValue( "b" ); private final StringValue stringValue3 = new StringValue( "c" ); private final StringValue stringValue4 = new StringValue( "d" ); private final BinaryValue binaryValue1 = new BinaryValue( BYTES1 ); private final BinaryValue binaryValue2 = new BinaryValue( BYTES2 ); private final BinaryValue binaryValue3 = new BinaryValue( BYTES3 ); private final BinaryValue binaryValue4 = new BinaryValue( BYTES4 ); private static SchemaManager schemaManager; /** * Serialize a DefaultEntryAttribute */ private ByteArrayOutputStream serializeValue( DefaultAttribute value ) throws IOException { ObjectOutputStream oOut = null; ByteArrayOutputStream out = new ByteArrayOutputStream(); try { oOut = new ObjectOutputStream( out ); value.writeExternal( oOut ); } catch ( IOException ioe ) { throw ioe; } finally { try { if ( oOut != null ) { oOut.flush(); oOut.close(); } } catch ( IOException ioe ) { throw ioe; } } return out; } /** * Deserialize a DefaultEntryAttribute */ private DefaultAttribute deserializeValue( ByteArrayOutputStream out, AttributeType at ) throws IOException, ClassNotFoundException { ObjectInputStream oIn = null; ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() ); try { oIn = new ObjectInputStream( in ); DefaultAttribute value = new DefaultAttribute( at ); value.readExternal( oIn ); return value; } catch ( IOException ioe ) { throw ioe; } finally { try { if ( oIn != null ) { oIn.close(); } } catch ( IOException ioe ) { throw ioe; } } } @BeforeClass public static void startup() throws Exception { schemaManager = new DefaultSchemaManager(); } /** * Initialize the schemaManager */ @Before public void setup() throws Exception { atCN = schemaManager.getAttributeType( "cn" ); atDC = schemaManager.lookupAttributeTypeRegistry( "dc" ); atC = schemaManager.lookupAttributeTypeRegistry( "c" ); atSN = schemaManager.lookupAttributeTypeRegistry( "sn" ); atPwd = schemaManager.lookupAttributeTypeRegistry( "userpassword" ); atEMail = schemaManager.lookupAttributeTypeRegistry( "email" ); atName = schemaManager.lookupAttributeTypeRegistry( "name" ); } /** * Test method isValid( SyntaxChecker ) */ @Test public void testIsValidSyntaxChecker() throws LdapException { Attribute attr = new DefaultAttribute( "test" ); attr.add( "test", "another test" ); assertTrue( attr.isValid( atCN ) ); attr.add( "test an invalid '\uFFFD' char" ); assertFalse( attr.isValid( atCN ) ); } @Test public void testAddOneValue() throws Exception { AttributeType at = TestEntryUtils.getIA5StringAttributeType(); DefaultAttribute attr = new DefaultAttribute( at ); // Add a String value attr.add( "test" ); assertEquals( 1, attr.size() ); assertTrue( attr.getAttributeType().getSyntax().isHumanReadable() ); Value value = attr.get(); assertTrue( value instanceof StringValue ); assertEquals( "test", ( ( StringValue ) value ).getString() ); // Add a binary value assertEquals( 0, attr.add( new byte[] { 0x01 } ) ); // Add a Value Value ssv = new StringValue( at, "test2" ); attr.add( ssv ); assertEquals( 2, attr.size() ); Set expected = new HashSet(); expected.add( "test" ); expected.add( "test2" ); for ( Value val : attr ) { if ( expected.contains( val.getValue() ) ) { expected.remove( val.getValue() ); } else { fail(); } } assertEquals( 0, expected.size() ); } @Test public void testAddTwoValue() throws Exception { AttributeType at = TestEntryUtils.getIA5StringAttributeType(); DefaultAttribute attr = new DefaultAttribute( at ); // Add String values attr.add( "test" ); attr.add( "test2" ); assertEquals( 2, attr.size() ); assertTrue( attr.getAttributeType().getSyntax().isHumanReadable() ); Set expected = new HashSet(); expected.add( "test" ); expected.add( "test2" ); for ( Value val : attr ) { if ( expected.contains( val.getValue() ) ) { expected.remove( val.getValue() ); } else { fail(); } } assertEquals( 0, expected.size() ); } @Test public void testAddNullValue() throws Exception { AttributeType at = TestEntryUtils.getIA5StringAttributeType(); DefaultAttribute attr = new DefaultAttribute( at ); // Add a null value attr.add( new StringValue( at, null ) ); assertEquals( 1, attr.size() ); assertTrue( attr.getAttributeType().getSyntax().isHumanReadable() ); Value value = attr.get(); assertTrue( value instanceof StringValue ); assertNull( ( ( StringValue ) value ).getValue() ); } @Test public void testGetAttribute() throws Exception { AttributeType at = TestEntryUtils.getIA5StringAttributeType(); DefaultAttribute attr = new DefaultAttribute( at ); attr.add( "Test1" ); attr.add( "Test2" ); attr.add( "Test3" ); assertEquals( "1.1", attr.getId() ); assertEquals( 3, attr.size() ); assertTrue( attr.contains( "Test1" ) ); assertTrue( attr.contains( "Test2" ) ); assertTrue( attr.contains( "Test3" ) ); } /** * Test the contains() method */ @Test public void testContains() throws Exception { AttributeType at = TestEntryUtils.getIA5StringAttributeType(); DefaultAttribute attr = new DefaultAttribute( at ); attr.add( "Test 1" ); attr.add( "Test 2" ); attr.add( "Test 3" ); assertTrue( attr.contains( "test 1" ) ); assertTrue( attr.contains( "Test 2" ) ); assertTrue( attr.contains( "TEST 3" ) ); } /** * Test method getBytes() */ @Test public void testGetBytes() throws LdapInvalidAttributeValueException { Attribute attr1 = new DefaultAttribute( atPwd ); attr1.add( ( byte[] ) null ); assertNull( attr1.getBytes() ); Attribute attr2 = new DefaultAttribute( atPwd ); attr2.add( BYTES1, BYTES2 ); assertTrue( Arrays.equals( BYTES1, attr2.getBytes() ) ); Attribute attr3 = new DefaultAttribute( atCN ); attr3.add( "a", "b" ); try { attr3.getBytes(); fail(); } catch ( LdapInvalidAttributeValueException ivae ) { assertTrue( true ); } } /** * Test method getId() */ @Test public void testGetId() { Attribute attr = new DefaultAttribute( atCN ); assertEquals( "2.5.4.3", attr.getId() ); attr.setUpId( " CN " ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( " CN ", attr.getUpId() ); attr.setUpId( " CommonName " ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( " CommonName ", attr.getUpId() ); attr.setUpId( " 2.5.4.3 " ); assertEquals( "2.5.4.3", attr.getId() ); } /** * Test method getString() */ @Test public void testGetString() throws LdapInvalidAttributeValueException { Attribute attr1 = new DefaultAttribute( atDC ); assertEquals( 1, attr1.add( ( String ) null ) ); Attribute attr2 = new DefaultAttribute( atDC ); attr2.add( "a" ); assertEquals( "a", attr2.getString() ); Attribute attr3 = new DefaultAttribute( atPwd ); attr3.add( BYTES1, BYTES2 ); try { attr3.getString(); fail(); } catch ( LdapInvalidAttributeValueException ivae ) { assertTrue( true ); } } /** * Test method getUpId */ @Test public void testGetUpId() { Attribute attr = new DefaultAttribute( atCN ); assertNotNull( attr.getUpId() ); assertEquals( "cn", attr.getUpId() ); attr.setUpId( "CN" ); assertEquals( "CN", attr.getUpId() ); attr.setUpId( " Cn " ); assertEquals( " Cn ", attr.getUpId() ); attr.setUpId( " 2.5.4.3 " ); assertEquals( " 2.5.4.3 ", attr.getUpId() ); } /** * Test method hashCode() */ @Test public void testHashCode() throws LdapException { Attribute attr1 = new DefaultAttribute( atDC ); Attribute attr2 = new DefaultAttribute( atSN ); assertNotSame( attr1.hashCode(), attr2.hashCode() ); attr2.apply( atDC ); assertEquals( attr1.hashCode(), attr2.hashCode() ); attr1.add( ( String ) null ); assertNotSame( attr1.hashCode(), attr2.hashCode() ); attr1.clear(); assertEquals( attr1.hashCode(), attr2.hashCode() ); attr1.add( "a", "b" ); assertNotSame( attr1.hashCode(), attr2.hashCode() ); attr2.add( "a", "b" ); assertEquals( attr1.hashCode(), attr2.hashCode() ); // Order matters attr2.clear(); attr2.add( "b", "a" ); assertNotSame( attr1.hashCode(), attr2.hashCode() ); Attribute attr3 = new DefaultAttribute( atPwd ); Attribute attr4 = new DefaultAttribute( atPwd ); assertNotSame( attr3.hashCode(), attr4.hashCode() ); attr3.add( ( byte[] ) null ); assertNotSame( attr3.hashCode(), attr4.hashCode() ); attr3.clear(); assertEquals( attr3.hashCode(), attr4.hashCode() ); attr3.add( new byte[] { 0x01, 0x02 }, new byte[] { 0x03, 0x04 } ); assertNotSame( attr1.hashCode(), attr2.hashCode() ); attr4.add( new byte[] { 0x01, 0x02 }, new byte[] { 0x03, 0x04 } ); assertNotSame( attr1.hashCode(), attr2.hashCode() ); // Order matters attr4.clear(); attr4.add( new byte[] { 0x03, 0x04 }, new byte[] { 0x01, 0x02 } ); assertNotSame( attr1.hashCode(), attr2.hashCode() ); } /** * Test method SetId(String) */ @Test public void testSetId() { Attribute attr = new DefaultAttribute( atCN ); attr.setUpId( "Cn" ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "Cn", attr.getUpId() ); attr.setUpId( " CN " ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( " CN ", attr.getUpId() ); attr.setUpId( " 2.5.4.3 " ); assertEquals( " 2.5.4.3 ", attr.getUpId() ); assertEquals( "2.5.4.3", attr.getId() ); attr.setUpId( " commonName " ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( " commonName ", attr.getUpId() ); attr.setUpId( null ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); attr.setUpId( "" ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); attr.setUpId( " " ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); try { attr.setUpId( " SN " ); fail(); } catch ( IllegalArgumentException iae ) { assertTrue( true ); } } /** * Test method isValid() */ @Test public void testIsValid() throws Exception { Attribute attr = new DefaultAttribute( atCN ); // No value, this should not be valid assertFalse( attr.isValid( atCN ) ); attr.add( "test", "test2", "A123\\;" ); assertTrue( attr.isValid( atCN ) ); // If we try to add a wrong value, it will not be added. The // attribute remains valid. assertEquals( 0, attr.add( new byte[] { 0x01 } ) ); assertTrue( attr.isValid( atCN ) ); // test a SINGLE-VALUE attribute. CountryName is SINGLE-VALUE attr.clear(); attr.apply( atC ); attr.add( "FR" ); assertTrue( attr.isValid( atC ) ); assertEquals( 0, attr.add( "US" ) ); assertFalse( attr.contains( "US" ) ); assertTrue( attr.isValid( atC ) ); } /** * Test method add( Value... ) */ @Test public void testAddValueArray() throws LdapException { Attribute attr1 = new DefaultAttribute( atDC ); int nbAdded = attr1.add( ( String ) null ); assertEquals( 1, nbAdded ); assertTrue( attr1.isHumanReadable() ); assertEquals( nullStringValue, attr1.get() ); Attribute attr2 = new DefaultAttribute( atPwd ); nbAdded = attr2.add( new BinaryValue( atPwd, null ) ); assertEquals( 1, nbAdded ); assertFalse( attr2.isHumanReadable() ); assertEquals( nullBinaryValue, attr2.get() ); Attribute attr3 = new DefaultAttribute( atCN ); nbAdded = attr3.add( new StringValue( atCN, "a" ), new StringValue( atCN, "b" ) ); assertEquals( 2, nbAdded ); assertTrue( attr3.isHumanReadable() ); assertTrue( attr3.contains( "a" ) ); assertTrue( attr3.contains( "b" ) ); Attribute attr4 = new DefaultAttribute( atCN ); nbAdded = attr4.add( new BinaryValue( atPwd, BYTES1 ), new BinaryValue( atPwd, BYTES2 ) ); assertEquals( 0, nbAdded ); assertTrue( attr4.isHumanReadable() ); assertFalse( attr4.contains( BYTES1 ) ); assertFalse( attr4.contains( BYTES2 ) ); Attribute attr5 = new DefaultAttribute( atCN ); nbAdded = attr5.add( new StringValue( atCN, "c" ), new BinaryValue( atPwd, BYTES1 ) ); assertEquals( 1, nbAdded ); assertTrue( attr5.isHumanReadable() ); assertFalse( attr5.contains( "ab" ) ); assertTrue( attr5.contains( "c" ) ); Attribute attr6 = new DefaultAttribute( atPwd ); nbAdded = attr6.add( new BinaryValue( atPwd, BYTES1 ), new StringValue( atCN, "c" ) ); assertEquals( 1, nbAdded ); assertFalse( attr6.isHumanReadable() ); assertTrue( attr6.contains( BYTES1 ) ); assertFalse( attr6.contains( BYTES3 ) ); Attribute attr7 = new DefaultAttribute( atPwd ); nbAdded = attr7.add( new BinaryValue( atPwd, null ), new StringValue( atCN, "c" ) ); assertEquals( 1, nbAdded ); assertFalse( attr7.isHumanReadable() ); assertTrue( attr7.contains( nullBinaryValue ) ); assertFalse( attr7.contains( BYTES3 ) ); Attribute attr8 = new DefaultAttribute( atDC ); nbAdded = attr8.add( new StringValue( atDC, null ), new BinaryValue( atPwd, BYTES1 ) ); assertEquals( 1, nbAdded ); assertTrue( attr8.isHumanReadable() ); assertTrue( attr8.contains( nullStringValue ) ); assertFalse( attr8.contains( "ab" ) ); Attribute attr9 = new DefaultAttribute( atDC ); nbAdded = attr9.add( new StringValue( ( String ) null ), new StringValue( "ab" ) ); assertEquals( 2, nbAdded ); assertTrue( attr9.isHumanReadable() ); assertTrue( attr9.contains( nullStringValue ) ); assertTrue( attr9.contains( "ab" ) ); Attribute attr10 = new DefaultAttribute( atPwd ); nbAdded = attr10.add( new BinaryValue( ( byte[] ) null ), new BinaryValue( BYTES1 ) ); assertEquals( 2, nbAdded ); assertFalse( attr10.isHumanReadable() ); assertTrue( attr10.contains( nullBinaryValue ) ); assertTrue( attr10.contains( BYTES1 ) ); } /** * Test method add( String... ) */ @Test public void testAddStringArray() throws LdapInvalidAttributeValueException { Attribute attr1 = new DefaultAttribute( atDC ); int nbAdded = attr1.add( ( String ) null ); assertEquals( 1, nbAdded ); assertTrue( attr1.isHumanReadable() ); assertEquals( nullStringValue, attr1.get() ); Attribute attr2 = new DefaultAttribute( atDC ); nbAdded = attr2.add( "" ); assertEquals( 1, nbAdded ); assertTrue( attr2.isHumanReadable() ); assertEquals( "", attr2.getString() ); Attribute attr3 = new DefaultAttribute( atCN ); nbAdded = attr3.add( "t" ); assertEquals( 1, nbAdded ); assertTrue( attr3.isHumanReadable() ); assertEquals( "t", attr3.getString() ); Attribute attr4 = new DefaultAttribute( atCN ); nbAdded = attr4.add( "a", "b", "c", "d" ); assertEquals( 4, nbAdded ); assertTrue( attr4.isHumanReadable() ); assertEquals( "a", attr4.getString() ); assertTrue( attr4.contains( "a" ) ); assertTrue( attr4.contains( "b" ) ); assertTrue( attr4.contains( "c" ) ); assertTrue( attr4.contains( "d" ) ); nbAdded = attr4.add( "e" ); assertEquals( 1, nbAdded ); assertTrue( attr4.isHumanReadable() ); assertEquals( "a", attr4.getString() ); assertTrue( attr4.contains( "a" ) ); assertTrue( attr4.contains( "b" ) ); assertTrue( attr4.contains( "c" ) ); assertTrue( attr4.contains( "d" ) ); assertTrue( attr4.contains( "e" ) ); nbAdded = attr4.add( BYTES1 ); assertEquals( 0, nbAdded ); assertTrue( attr4.isHumanReadable() ); assertEquals( "a", attr4.getString() ); assertTrue( attr4.contains( "a" ) ); assertTrue( attr4.contains( "b" ) ); assertTrue( attr4.contains( "c" ) ); assertTrue( attr4.contains( "d" ) ); assertTrue( attr4.contains( "e" ) ); assertFalse( attr4.contains( "ab" ) ); Attribute attr5 = new DefaultAttribute( atEMail ); nbAdded = attr5.add( "a", "b", ( String ) null, "d" ); assertEquals( 4, nbAdded ); assertTrue( attr5.isHumanReadable() ); assertTrue( attr5.contains( "a" ) ); assertTrue( attr5.contains( "b" ) ); assertTrue( attr5.contains( nullStringValue ) ); assertTrue( attr5.contains( "d" ) ); Attribute attr6 = new DefaultAttribute( atPwd ); nbAdded = attr6.add( "a", ( String ) null ); assertEquals( 2, nbAdded ); assertFalse( attr6.isHumanReadable() ); } /** * Test method add( byte[]... ) */ @Test public void testAddByteArray() throws LdapInvalidAttributeValueException { Attribute attr1 = new DefaultAttribute( atPwd ); int nbAdded = attr1.add( ( byte[] ) null ); assertEquals( 1, nbAdded ); assertFalse( attr1.isHumanReadable() ); assertTrue( Arrays.equals( nullBinaryValue.getBytes(), attr1.getBytes() ) ); Attribute attr2 = new DefaultAttribute( atPwd ); nbAdded = attr2.add( Strings.EMPTY_BYTES ); assertEquals( 1, nbAdded ); assertFalse( attr2.isHumanReadable() ); assertTrue( Arrays.equals( Strings.EMPTY_BYTES, attr2.getBytes() ) ); Attribute attr3 = new DefaultAttribute( atPwd ); nbAdded = attr3.add( BYTES1 ); assertEquals( 1, nbAdded ); assertFalse( attr3.isHumanReadable() ); assertTrue( Arrays.equals( BYTES1, attr3.getBytes() ) ); Attribute attr4 = new DefaultAttribute( atPwd ); nbAdded = attr4.add( BYTES1, BYTES2, BYTES3, BYTES4 ); assertEquals( 4, nbAdded ); assertFalse( attr4.isHumanReadable() ); assertTrue( attr4.contains( BYTES1 ) ); assertTrue( attr4.contains( BYTES2 ) ); assertTrue( attr4.contains( BYTES3 ) ); assertTrue( attr4.contains( BYTES4 ) ); Attribute attr5 = new DefaultAttribute( atPwd ); nbAdded = attr5.add( BYTES1, BYTES2, ( byte[] ) null, BYTES3 ); assertEquals( 4, nbAdded ); assertFalse( attr5.isHumanReadable() ); assertTrue( attr5.contains( BYTES1 ) ); assertTrue( attr5.contains( BYTES2 ) ); assertTrue( attr5.contains( ( byte[] ) null ) ); assertTrue( attr5.contains( BYTES3 ) ); Attribute attr6 = new DefaultAttribute( atPwd ); nbAdded = attr6.add( "ab", ( String ) null ); assertEquals( 2, nbAdded ); assertFalse( attr6.isHumanReadable() ); } /** * Test method clear() */ @Test public void testClear() throws LdapException { Attribute attr = new DefaultAttribute( "email", atEMail ); assertEquals( 0, attr.size() ); attr.add( ( String ) null, "a", "b" ); assertEquals( 3, attr.size() ); attr.clear(); assertTrue( attr.isHumanReadable() ); assertEquals( 0, attr.size() ); assertEquals( atEMail, attr.getAttributeType() ); } /** * Test method contains( Value... ) throws LdapException */ @Test public void testContainsValueArray() throws LdapException { Attribute attr1 = new DefaultAttribute( atEMail ); assertEquals( 0, attr1.size() ); assertFalse( attr1.contains( stringValue1 ) ); assertFalse( attr1.contains( nullStringValue ) ); attr1.add( ( String ) null ); assertEquals( 1, attr1.size() ); assertTrue( attr1.contains( nullStringValue ) ); attr1.remove( ( String ) null ); assertFalse( attr1.contains( nullStringValue ) ); assertEquals( 0, attr1.size() ); attr1.add( "a", "b", "c" ); assertEquals( 3, attr1.size() ); assertTrue( attr1.contains( stringValue1 ) ); assertTrue( attr1.contains( stringValue2 ) ); assertTrue( attr1.contains( stringValue3 ) ); assertTrue( attr1.contains( stringValue1, stringValue3 ) ); assertFalse( attr1.contains( stringValue4 ) ); assertFalse( attr1.contains( nullStringValue ) ); Attribute attr2 = new DefaultAttribute( atPwd ); assertEquals( 0, attr2.size() ); assertFalse( attr2.contains( BYTES1 ) ); assertFalse( attr2.contains( nullBinaryValue ) ); attr2.add( ( byte[] ) null ); assertEquals( 1, attr2.size() ); assertTrue( attr2.contains( nullBinaryValue ) ); attr2.remove( ( byte[] ) null ); assertFalse( attr2.contains( nullBinaryValue ) ); assertEquals( 0, attr2.size() ); attr2.add( BYTES1, BYTES2, BYTES3 ); assertEquals( 3, attr2.size() ); assertTrue( attr2.contains( binaryValue1 ) ); assertTrue( attr2.contains( binaryValue2 ) ); assertTrue( attr2.contains( binaryValue3 ) ); assertFalse( attr2.contains( nullBinaryValue ) ); } /** * Test method contains( String... ) */ @Test public void testContainsStringArray() throws LdapException { Attribute attr1 = new DefaultAttribute( atEMail ); assertEquals( 0, attr1.size() ); assertFalse( attr1.contains( "a" ) ); assertFalse( attr1.contains( ( String ) null ) ); attr1.add( ( String ) null ); assertEquals( 1, attr1.size() ); assertTrue( attr1.contains( ( String ) null ) ); attr1.remove( ( String ) null ); assertFalse( attr1.contains( ( String ) null ) ); assertEquals( 0, attr1.size() ); attr1.add( "a", "b", "c" ); assertEquals( 3, attr1.size() ); assertTrue( attr1.contains( "a" ) ); assertTrue( attr1.contains( "b" ) ); assertTrue( attr1.contains( "c" ) ); assertFalse( attr1.contains( "e" ) ); assertFalse( attr1.contains( ( String ) null ) ); } /** * Test method contains( byte[]... ) */ @Test public void testContainsByteArray() throws LdapException { Attribute attr1 = new DefaultAttribute( atPwd ); assertEquals( 0, attr1.size() ); assertFalse( attr1.contains( BYTES1 ) ); assertFalse( attr1.contains( ( byte[] ) null ) ); attr1.add( ( byte[] ) null ); assertEquals( 1, attr1.size() ); assertTrue( attr1.contains( ( byte[] ) null ) ); attr1.remove( ( byte[] ) null ); assertFalse( attr1.contains( ( byte[] ) null ) ); assertEquals( 0, attr1.size() ); attr1.add( BYTES1, BYTES2, BYTES3 ); assertEquals( 3, attr1.size() ); assertTrue( attr1.contains( BYTES1 ) ); assertTrue( attr1.contains( BYTES2 ) ); assertTrue( attr1.contains( BYTES3 ) ); assertFalse( attr1.contains( BYTES4 ) ); assertFalse( attr1.contains( ( byte[] ) null ) ); } /** * Test method testEquals() */ @Test public void testEquals() throws LdapException { Attribute attr1 = new DefaultAttribute( atCN ); assertFalse( attr1.equals( null ) ); Attribute attr2 = new DefaultAttribute( atCN ); assertTrue( attr1.equals( attr2 ) ); attr2.setUpId( "CN" ); assertTrue( attr1.equals( attr2 ) ); attr1.setUpId( "CommonName" ); assertTrue( attr1.equals( attr2 ) ); attr1.setUpId( "CN" ); assertTrue( attr1.equals( attr2 ) ); attr1.add( "a", "b", "c" ); attr2.add( "c", "b", "a" ); assertTrue( attr1.equals( attr2 ) ); assertTrue( attr1.equals( attr2 ) ); Attribute attr3 = new DefaultAttribute( atPwd ); Attribute attr4 = new DefaultAttribute( atPwd ); attr3.add( nullBinaryValue ); attr4.add( nullBinaryValue ); assertTrue( attr3.equals( attr4 ) ); Attribute attr5 = new DefaultAttribute( atPwd ); Attribute attr6 = new DefaultAttribute( atDC ); assertFalse( attr5.equals( attr6 ) ); attr5.add( nullBinaryValue ); attr6.add( nullStringValue ); assertFalse( attr5.equals( attr6 ) ); Attribute attr7 = new DefaultAttribute( atCN ); Attribute attr8 = new DefaultAttribute( atPwd ); attr7.add( "a" ); attr8.add( BYTES2 ); assertFalse( attr7.equals( attr8 ) ); Attribute attr9 = new DefaultAttribute( atCN ); Attribute attr10 = new DefaultAttribute( atPwd ); attr9.add( "a" ); attr9.add( BYTES2 ); attr10.add( "a", "b" ); assertFalse( attr9.equals( attr10 ) ); Attribute attr11 = new DefaultAttribute( atPwd, BYTES1 ); Attribute attr12 = new DefaultAttribute( atPwd, BYTES1 ); assertTrue( attr11.get().equals( attr12.get() ) ); assertTrue( attr12.get().equals( attr11.get() ) ); Attribute attr13 = new DefaultAttribute( "userPassword", BYTES1 ); assertTrue( attr11.get().equals( attr13.get() ) ); assertTrue( attr13.get().equals( attr11.get() ) ); Attribute attr14 = new DefaultAttribute( "userPassword", BYTES1 ); assertTrue( attr14.get().equals( attr13.get() ) ); assertTrue( attr13.get().equals( attr14.get() ) ); } /** * Test method get() */ @Test public void testGet() throws LdapException { Attribute attr1 = new DefaultAttribute( "dc", atDC ); attr1.add( ( String ) null ); assertEquals( nullStringValue, attr1.get() ); Attribute attr2 = new DefaultAttribute( "email", atEMail ); attr2.add( "a", "b", "c" ); assertEquals( "a", attr2.get().getString() ); attr2.remove( "a" ); assertEquals( "b", attr2.get().getString() ); attr2.remove( "b" ); assertEquals( "c", attr2.get().getString() ); attr2.remove( "c" ); assertNull( attr2.get() ); Attribute attr3 = new DefaultAttribute( "userPassword", atPwd ); attr3.add( BYTES1, BYTES2, BYTES3 ); assertTrue( Arrays.equals( BYTES1, attr3.get().getBytes() ) ); attr3.remove( BYTES1 ); assertTrue( Arrays.equals( BYTES2, attr3.get().getBytes() ) ); attr3.remove( BYTES2 ); assertTrue( Arrays.equals( BYTES3, attr3.get().getBytes() ) ); attr3.remove( BYTES3 ); assertNull( attr2.get() ); } /** * Test method getAll() */ @Test public void testIterator2() throws LdapException { Attribute attr = new DefaultAttribute( atEMail ); Iterator> iterator = attr.iterator(); assertFalse( iterator.hasNext() ); attr.add( nullStringValue ); iterator = attr.iterator(); assertTrue( iterator.hasNext() ); Value value = iterator.next(); assertEquals( nullStringValue, value ); attr.clear(); iterator = attr.iterator(); assertFalse( iterator.hasNext() ); attr.add( "a", "b", "c" ); iterator = attr.iterator(); assertTrue( iterator.hasNext() ); assertEquals( "a", iterator.next().getString() ); assertEquals( "b", iterator.next().getString() ); assertEquals( "c", iterator.next().getString() ); assertFalse( iterator.hasNext() ); } /** * Test method size() */ @Test public void testSize() throws Exception { Attribute attr1 = new DefaultAttribute( atDC ); assertEquals( 0, attr1.size() ); attr1.add( ( String ) null ); assertEquals( 1, attr1.size() ); Attribute attr2 = new DefaultAttribute( atCN ); attr2.add( "a", "b" ); assertEquals( 2, attr2.size() ); attr2.clear(); assertEquals( 0, attr2.size() ); Attribute attr3 = new DefaultAttribute( atC ); attr3.add( "US" ); assertEquals( 1, attr3.size() ); // TODO : forbid addition of more than 1 value for SINGLE-VALUE attributes attr3.add( "FR" ); assertEquals( 1, attr3.size() ); } /** * Test method put( byte[]... ) */ @Test public void testPutByteArray() throws LdapException, Exception { Attribute attr1 = new DefaultAttribute( atPwd ); int nbAdded = attr1.add( ( byte[] ) null ); assertEquals( 1, nbAdded ); assertFalse( attr1.isHumanReadable() ); assertTrue( Arrays.equals( nullBinaryValue.getBytes(), attr1.getBytes() ) ); Attribute attr2 = new DefaultAttribute( atPwd ); nbAdded = attr2.add( Strings.EMPTY_BYTES ); assertEquals( 1, nbAdded ); assertFalse( attr2.isHumanReadable() ); assertTrue( Arrays.equals( Strings.EMPTY_BYTES, attr2.getBytes() ) ); Attribute attr3 = new DefaultAttribute( atPwd ); nbAdded = attr3.add( BYTES1 ); assertEquals( 1, nbAdded ); assertFalse( attr3.isHumanReadable() ); assertTrue( Arrays.equals( BYTES1, attr3.getBytes() ) ); Attribute attr4 = new DefaultAttribute( atPwd ); nbAdded = attr4.add( BYTES1, BYTES2 ); assertEquals( 2, nbAdded ); assertFalse( attr4.isHumanReadable() ); assertTrue( attr4.contains( BYTES1 ) ); assertTrue( attr4.contains( BYTES2 ) ); attr4.clear(); nbAdded = attr4.add( BYTES3, BYTES4 ); assertEquals( 2, nbAdded ); assertFalse( attr4.isHumanReadable() ); assertTrue( attr4.contains( BYTES3 ) ); assertTrue( attr4.contains( BYTES4 ) ); Attribute attr5 = new DefaultAttribute( atPwd ); nbAdded = attr5.add( BYTES1, BYTES2, ( byte[] ) null, BYTES3 ); assertEquals( 4, nbAdded ); assertFalse( attr5.isHumanReadable() ); assertTrue( attr5.contains( BYTES1 ) ); assertTrue( attr5.contains( BYTES2 ) ); assertTrue( attr5.contains( ( byte[] ) null ) ); assertTrue( attr5.contains( BYTES3 ) ); Attribute attr6 = new DefaultAttribute( atPwd ); assertFalse( attr6.isHumanReadable() ); nbAdded = attr6.add( BYTES1, ( byte[] ) null ); assertEquals( 2, nbAdded ); assertTrue( attr6.contains( BYTES1 ) ); assertTrue( attr6.contains( ( byte[] ) null ) ); } /** * Test method put( String... ) */ @Test public void testPutStringArray() throws LdapInvalidAttributeValueException { Attribute attr1 = new DefaultAttribute( atDC ); int nbAdded = attr1.add( ( String ) null ); assertEquals( 1, nbAdded ); assertTrue( attr1.isHumanReadable() ); assertEquals( nullStringValue, attr1.get() ); Attribute attr2 = new DefaultAttribute( atDC ); nbAdded = attr2.add( "" ); assertEquals( 1, nbAdded ); assertTrue( attr2.isHumanReadable() ); assertEquals( "", attr2.getString() ); Attribute attr3 = new DefaultAttribute( atDC ); nbAdded = attr3.add( "t" ); assertEquals( 1, nbAdded ); assertTrue( attr3.isHumanReadable() ); assertEquals( "t", attr3.getString() ); Attribute attr4 = new DefaultAttribute( atEMail ); nbAdded = attr4.add( "a", "b", "c", "d" ); assertEquals( 4, nbAdded ); assertTrue( attr4.isHumanReadable() ); assertEquals( "a", attr4.getString() ); assertTrue( attr4.contains( "a" ) ); assertTrue( attr4.contains( "b" ) ); assertTrue( attr4.contains( "c" ) ); assertTrue( attr4.contains( "d" ) ); attr4.clear(); nbAdded = attr4.add( "e" ); assertEquals( 1, nbAdded ); assertTrue( attr4.isHumanReadable() ); assertEquals( "e", attr4.getString() ); assertFalse( attr4.contains( "a" ) ); assertFalse( attr4.contains( "b" ) ); assertFalse( attr4.contains( "c" ) ); assertFalse( attr4.contains( "d" ) ); assertTrue( attr4.contains( "e" ) ); attr4.clear(); nbAdded = attr4.add( BYTES1 ); assertEquals( 0, nbAdded ); assertTrue( attr4.isHumanReadable() ); Attribute attr5 = new DefaultAttribute( atEMail ); nbAdded = attr5.add( "a", "b", ( String ) null, "d" ); assertEquals( 4, nbAdded ); assertTrue( attr5.isHumanReadable() ); assertTrue( attr5.contains( "a" ) ); assertTrue( attr5.contains( "b" ) ); assertTrue( attr5.contains( nullStringValue ) ); assertTrue( attr5.contains( "d" ) ); Attribute attr6 = new DefaultAttribute( atPwd ); nbAdded = attr6.add( "a", ( String ) null ); assertEquals( 2, nbAdded ); assertFalse( attr6.isHumanReadable() ); } /** * Test method put( Value... ) */ @Test public void testPutValueArray() throws Exception { Attribute attr1 = new DefaultAttribute( atDC ); assertEquals( 0, attr1.size() ); attr1.add( nullStringValue ); assertEquals( 1, attr1.size() ); assertTrue( attr1.contains( nullStringValue ) ); attr1.clear(); attr1.add( stringValue1, stringValue2, stringValue3 ); assertEquals( 3, attr1.size() ); assertTrue( attr1.contains( stringValue1 ) ); assertTrue( attr1.contains( stringValue2 ) ); assertTrue( attr1.contains( stringValue3 ) ); attr1.clear(); attr1.add( stringValue1, nullStringValue, stringValue3 ); assertEquals( 3, attr1.size() ); assertTrue( attr1.contains( stringValue1 ) ); assertTrue( attr1.contains( nullStringValue ) ); assertTrue( attr1.contains( stringValue3 ) ); attr1.clear(); attr1.add( stringValue1, nullStringValue, binaryValue3 ); assertEquals( 2, attr1.size() ); assertTrue( attr1.contains( stringValue1 ) ); assertTrue( attr1.contains( nullStringValue ) ); assertFalse( attr1.contains( stringValue3 ) ); Attribute attr2 = new DefaultAttribute( atPwd ); assertEquals( 0, attr2.size() ); attr2.add( nullBinaryValue ); assertEquals( 1, attr2.size() ); assertTrue( attr2.contains( nullBinaryValue ) ); attr2.clear(); attr2.add( binaryValue1, binaryValue2, binaryValue3 ); assertEquals( 3, attr2.size() ); assertTrue( attr2.contains( binaryValue1 ) ); assertTrue( attr2.contains( binaryValue2 ) ); assertTrue( attr2.contains( binaryValue3 ) ); attr2.clear(); attr2.add( binaryValue1, nullBinaryValue, stringValue3 ); assertEquals( 2, attr2.size() ); assertTrue( attr2.contains( binaryValue1 ) ); assertTrue( attr2.contains( nullBinaryValue ) ); assertFalse( attr2.contains( binaryValue3 ) ); } /** * Test method remove( Value... ) */ @Test public void testRemoveValueArray() throws Exception { Attribute attr1 = new DefaultAttribute( atEMail ); assertFalse( attr1.remove( stringValue1 ) ); attr1.add( "a", "b", "c" ); assertTrue( attr1.remove( stringValue1 ) ); assertEquals( 2, attr1.size() ); assertTrue( attr1.remove( stringValue2, stringValue3 ) ); assertEquals( 0, attr1.size() ); assertFalse( attr1.remove( stringValue4 ) ); attr1.clear(); attr1.add( "a", "b", "c" ); assertFalse( attr1.remove( stringValue2, stringValue4 ) ); assertEquals( 2, attr1.size() ); attr1.clear(); attr1.add( "a", ( String ) null, "b" ); assertTrue( attr1.remove( nullStringValue, stringValue1 ) ); assertEquals( 1, attr1.size() ); attr1.clear(); attr1.add( "a", ( String ) null, "b" ); attr1.add( BYTES3 ); assertFalse( attr1.remove( nullStringValue, stringValue1, binaryValue3 ) ); assertEquals( 1, attr1.size() ); Attribute attr2 = new DefaultAttribute( atPwd ); assertFalse( attr2.remove( binaryValue1 ) ); attr2.add( BYTES1, BYTES2, BYTES3 ); assertTrue( attr2.remove( binaryValue1 ) ); assertEquals( 2, attr2.size() ); assertTrue( attr2.remove( binaryValue2, binaryValue3 ) ); assertEquals( 0, attr2.size() ); assertFalse( attr2.remove( binaryValue4 ) ); attr2.clear(); attr2.add( BYTES1, BYTES2, BYTES3 ); assertFalse( attr2.remove( binaryValue2, stringValue4 ) ); assertEquals( 2, attr2.size() ); attr2.clear(); attr2.add( BYTES1, ( byte[] ) null, BYTES3 ); assertFalse( attr2.remove( nullStringValue, binaryValue1 ) ); assertEquals( 2, attr2.size() ); attr2.clear(); attr2.add( BYTES1, ( byte[] ) null, BYTES2 ); attr2.add( "c" ); assertEquals( 4, attr2.size() ); assertFalse( attr2.remove( nullStringValue, binaryValue1, stringValue3 ) ); assertEquals( 3, attr2.size() ); } /** * Test method remove( byte... ) */ @Test public void testRemoveByteArray() throws Exception { Attribute attr1 = new DefaultAttribute( atPwd ); assertFalse( attr1.remove( BYTES1 ) ); attr1.add( BYTES1, BYTES2, BYTES3 ); assertTrue( attr1.remove( BYTES1 ) ); assertEquals( 2, attr1.size() ); assertTrue( attr1.remove( BYTES2, BYTES3 ) ); assertEquals( 0, attr1.size() ); assertFalse( attr1.remove( BYTES4 ) ); attr1.clear(); attr1.add( BYTES1, BYTES2, BYTES3 ); assertFalse( attr1.remove( BYTES3, BYTES4 ) ); assertEquals( 2, attr1.size() ); attr1.clear(); attr1.add( BYTES1, ( byte[] ) null, BYTES2 ); assertTrue( attr1.remove( ( byte[] ) null, BYTES1 ) ); assertEquals( 1, attr1.size() ); } /** * Test method remove( String... ) */ @Test public void testRemoveStringArray() throws Exception { Attribute attr1 = new DefaultAttribute( atEMail ); assertFalse( attr1.remove( "a" ) ); attr1.add( "a", "b", "c" ); assertTrue( attr1.remove( "a" ) ); assertEquals( 2, attr1.size() ); assertTrue( attr1.remove( "b", "c" ) ); assertEquals( 0, attr1.size() ); assertFalse( attr1.remove( "d" ) ); attr1.clear(); attr1.add( "a", "b", "c" ); assertFalse( attr1.remove( "b", "e" ) ); assertEquals( 2, attr1.size() ); attr1.clear(); attr1.add( "a", ( String ) null, "b" ); assertTrue( attr1.remove( ( String ) null, "a" ) ); assertEquals( 1, attr1.size() ); Attribute attr2 = new DefaultAttribute( "test" ); attr2.add( BYTES1, BYTES2, BYTES3 ); assertFalse( attr2.remove( ( String ) null ) ); assertTrue( attr2.remove( "ab", "c" ) ); assertFalse( attr2.remove( "d" ) ); } /** * Test method iterator() */ @Test public void testIterator() throws LdapException { Attribute attr1 = new DefaultAttribute( atCN ); attr1.add( "a", "b", "c" ); Iterator> iter = attr1.iterator(); assertTrue( iter.hasNext() ); String[] values = new String[] { "a", "b", "c" }; int pos = 0; for ( Value val : attr1 ) { assertTrue( val instanceof StringValue ); assertEquals( values[pos++], val.getString() ); } } /** * Test method toString */ @Test public void testToString() throws LdapException { Attribute attr = new DefaultAttribute( atEMail ); assertEquals( "email: (null)", attr.toString() ); attr.setUpId( "EMail" ); assertEquals( "EMail: (null)", attr.toString() ); attr.add( ( String ) null ); assertEquals( "EMail: ''", attr.toString() ); attr.clear(); attr.add( "a", "b" ); assertEquals( "EMail: a\nEMail: b", attr.toString() ); } /** * Test method instanceOf() */ @Test public void testInstanceOf() throws Exception { Attribute attr = new DefaultAttribute( atCN ); assertTrue( attr.isInstanceOf( atCN ) ); assertTrue( attr.isInstanceOf( atName ) ); assertFalse( attr.isInstanceOf( atSN ) ); } /** * Test method setUpId( String, AttributeType ) */ @Test public void testSetUpIdStringAttributeType() throws Exception { Attribute attr = new DefaultAttribute( atSN ); attr.setUpId( null, atCN ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); attr.setUpId( " ", atCN ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); attr.setUpId( " CN ", atCN ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( " CN ", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); attr.setUpId( " CommonName ", atCN ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( " CommonName ", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); attr.setUpId( " 2.5.4.3 ", atCN ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( " 2.5.4.3 ", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); // Check with wrong IDs try { attr.setUpId( "sn", atCN ); fail(); } catch ( IllegalArgumentException iae ) { assertTrue( true ); } try { attr.setUpId( " 2.5.4.4 ", atCN ); fail(); } catch ( IllegalArgumentException iae ) { assertTrue( true ); } } /** * Test method setUpId( String ) inherited from ClientAttribute */ @Test public void testSetUpIdString() throws Exception { Attribute attr = new DefaultAttribute( atCN ); attr.setUpId( "cn" ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); attr.setUpId( " CN " ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( " CN ", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); attr.setUpId( " CommonName " ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( " CommonName ", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); attr.setUpId( " 2.5.4.3 " ); assertEquals( " 2.5.4.3 ", attr.getUpId() ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( atCN, attr.getAttributeType() ); // Now check wrong IDs attr = new DefaultAttribute( atCN ); try { attr.setUpId( "sn" ); fail(); } catch ( IllegalArgumentException iae ) { // Expected } assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); try { attr.setUpId( " SN " ); fail(); } catch ( IllegalArgumentException iae ) { // Expected } assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); try { attr.setUpId( " surname " ); fail(); } catch ( IllegalArgumentException iae ) { // Expected } assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); try { attr.setUpId( " 2.5.4.4 " ); fail(); } catch ( IllegalArgumentException iae ) { // Expected } assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); } /** * Test method setAttributeType( AttributeType ) */ @Test public void testSetAttributeType() throws Exception { Attribute attr = new DefaultAttribute( atCN ); try { attr.apply( null ); fail(); } catch ( IllegalArgumentException iae ) { assertTrue( true ); } attr.apply( atSN ); assertTrue( attr.isInstanceOf( atSN ) ); assertEquals( "2.5.4.4", attr.getId() ); assertEquals( "sn", attr.getUpId() ); } /** * Test method getAttributeType() */ @Test public void testGetAttributeType() throws Exception { Attribute attr = new DefaultAttribute( atSN ); assertEquals( atSN, attr.getAttributeType() ); } /** * Test constructor DefaultEntryAttribute( AttributeType ) */ @Test public void testDefaultServerAttributeAttributeType() { Attribute attr = new DefaultAttribute( atCN ); assertTrue( attr.isHumanReadable() ); assertEquals( 0, attr.size() ); assertEquals( "2.5.4.3", attr.getId() ); assertEquals( "cn", attr.getUpId() ); assertEquals( atCN, attr.getAttributeType() ); } /** * Test constructor DefaultEntryAttribute( String, AttributeType ) */ @Test public void testDefaultServerAttributeStringAttributeType() { Attribute attr1 = new DefaultAttribute( "cn", atCN ); assertTrue( attr1.isHumanReadable() ); assertEquals( 0, attr1.size() ); assertEquals( "2.5.4.3", attr1.getId() ); assertEquals( "cn", attr1.getUpId() ); assertEquals( atCN, attr1.getAttributeType() ); Attribute attr2 = new DefaultAttribute( " CommonName ", atCN ); assertTrue( attr2.isHumanReadable() ); assertEquals( 0, attr2.size() ); assertEquals( "2.5.4.3", attr2.getId() ); assertEquals( " CommonName ", attr2.getUpId() ); assertEquals( atCN, attr2.getAttributeType() ); Attribute attr3 = new DefaultAttribute( " ", atCN ); assertTrue( attr3.isHumanReadable() ); assertEquals( 0, attr3.size() ); assertEquals( "2.5.4.3", attr3.getId() ); assertEquals( "cn", attr3.getUpId() ); assertEquals( atCN, attr3.getAttributeType() ); } /** * Test constructor DefaultEntryAttribute( AttributeType, Value... ) */ @Test public void testDefaultServerAttributeAttributeTypeValueArray() throws Exception { Attribute attr1 = new DefaultAttribute( atDC, stringValue1, stringValue2, nullStringValue ); assertTrue( attr1.isHumanReadable() ); assertEquals( 3, attr1.size() ); assertEquals( "0.9.2342.19200300.100.1.25", attr1.getId() ); assertEquals( "dc", attr1.getUpId() ); assertEquals( atDC, attr1.getAttributeType() ); assertTrue( attr1.contains( "a", "b" ) ); assertTrue( attr1.contains( nullStringValue ) ); Attribute attr2 = new DefaultAttribute( atDC, stringValue1, binaryValue2, nullStringValue ); assertTrue( attr2.isHumanReadable() ); assertEquals( 2, attr2.size() ); assertEquals( "0.9.2342.19200300.100.1.25", attr2.getId() ); assertEquals( "dc", attr2.getUpId() ); assertEquals( atDC, attr2.getAttributeType() ); assertTrue( attr2.contains( "a" ) ); assertTrue( attr2.contains( nullStringValue ) ); } /** * Test constructor DefaultEntryAttribute( String, AttributeType, Value... ) */ @Test public void testDefaultServerAttributeStringAttributeTypeValueArray() throws LdapException { Attribute attr1 = new DefaultAttribute( "dc", atDC, stringValue1, stringValue2, nullStringValue ); assertTrue( attr1.isHumanReadable() ); assertEquals( 3, attr1.size() ); assertEquals( "0.9.2342.19200300.100.1.25", attr1.getId() ); assertEquals( "dc", attr1.getUpId() ); assertEquals( atDC, attr1.getAttributeType() ); assertTrue( attr1.contains( "a", "b" ) ); assertTrue( attr1.contains( nullStringValue ) ); Attribute attr2 = new DefaultAttribute( atDC, stringValue1, binaryValue2, nullStringValue ); assertTrue( attr2.isHumanReadable() ); assertEquals( 2, attr2.size() ); assertEquals( "0.9.2342.19200300.100.1.25", attr2.getId() ); assertEquals( "dc", attr2.getUpId() ); assertEquals( atDC, attr2.getAttributeType() ); assertTrue( attr2.contains( "a" ) ); assertTrue( attr2.contains( nullStringValue ) ); Attribute attr3 = new DefaultAttribute( "DomainComponent", atDC, stringValue1, stringValue2, nullStringValue ); assertTrue( attr3.isHumanReadable() ); assertEquals( 3, attr3.size() ); assertEquals( "0.9.2342.19200300.100.1.25", attr3.getId() ); assertEquals( "DomainComponent", attr3.getUpId() ); assertEquals( atDC, attr3.getAttributeType() ); assertTrue( attr3.contains( "a", "b" ) ); assertTrue( attr3.contains( nullStringValue ) ); Attribute attr4 = new DefaultAttribute( " 0.9.2342.19200300.100.1.25 ", atDC, stringValue1, stringValue2, nullStringValue ); assertTrue( attr4.isHumanReadable() ); assertEquals( 3, attr4.size() ); assertEquals( "0.9.2342.19200300.100.1.25", attr4.getId() ); assertEquals( " 0.9.2342.19200300.100.1.25 ", attr4.getUpId() ); assertEquals( atDC, attr4.getAttributeType() ); assertTrue( attr4.contains( "a", "b" ) ); assertTrue( attr4.contains( nullStringValue ) ); } /** * Test constructor DefaultEntryAttribute( AttributeType, String... ) */ @Test public void testDefaultServerAttributeAttributeTypeStringArray() throws LdapException { Attribute attr1 = new DefaultAttribute( atEMail, "a", "b", ( String ) null ); assertTrue( attr1.isHumanReadable() ); assertEquals( 3, attr1.size() ); assertEquals( "1.2.840.113549.1.9.1", attr1.getId() ); assertEquals( "email", attr1.getUpId() ); assertEquals( atEMail, attr1.getAttributeType() ); assertTrue( attr1.contains( "a", "b" ) ); assertTrue( attr1.contains( nullStringValue ) ); Attribute attr2 = new DefaultAttribute( atEMail, stringValue1, binaryValue2, nullStringValue ); assertTrue( attr2.isHumanReadable() ); assertEquals( 2, attr2.size() ); assertEquals( "1.2.840.113549.1.9.1", attr2.getId() ); assertEquals( "email", attr2.getUpId() ); assertEquals( atEMail, attr2.getAttributeType() ); assertTrue( attr2.contains( "a" ) ); assertTrue( attr2.contains( nullStringValue ) ); } /** * Test constructor DefaultEntryAttribute( String, AttributeType, String... ) */ @Test public void testDefaultServerAttributeStringAttributeTypeStringArray() throws LdapException { Attribute attr1 = new DefaultAttribute( "email", atEMail, "a", "b", ( String ) null ); assertTrue( attr1.isHumanReadable() ); assertEquals( 3, attr1.size() ); assertEquals( "1.2.840.113549.1.9.1", attr1.getId() ); assertEquals( "email", attr1.getUpId() ); assertEquals( atEMail, attr1.getAttributeType() ); assertTrue( attr1.contains( "a", "b" ) ); assertTrue( attr1.contains( nullStringValue ) ); Attribute attr2 = new DefaultAttribute( "EMail", atEMail, "a", "b", ( String ) null ); assertTrue( attr2.isHumanReadable() ); assertEquals( 3, attr2.size() ); assertEquals( "1.2.840.113549.1.9.1", attr2.getId() ); assertEquals( "EMail", attr2.getUpId() ); assertEquals( atEMail, attr2.getAttributeType() ); assertTrue( attr2.contains( "a", "b" ) ); assertTrue( attr2.contains( nullStringValue ) ); Attribute attr3 = new DefaultAttribute( " 1.2.840.113549.1.9.1 ", atEMail, "a", "b", ( String ) null ); assertTrue( attr3.isHumanReadable() ); assertEquals( 3, attr3.size() ); assertEquals( "1.2.840.113549.1.9.1", attr3.getId() ); assertEquals( " 1.2.840.113549.1.9.1 ", attr3.getUpId() ); assertEquals( atEMail, attr3.getAttributeType() ); assertTrue( attr3.contains( "a", "b" ) ); assertTrue( attr3.contains( nullStringValue ) ); } /** * Test method DefaultEntryAttribute( AttributeType, byte[]... ) */ @Test public void testDefaultServerAttributeAttributeTypeByteArray() throws LdapException { Attribute attr1 = new DefaultAttribute( atPwd, BYTES1, BYTES2, ( byte[] ) null ); assertFalse( attr1.isHumanReadable() ); assertEquals( 3, attr1.size() ); assertEquals( "2.5.4.35", attr1.getId() ); assertEquals( "userPassword", attr1.getUpId() ); assertEquals( atPwd, attr1.getAttributeType() ); assertTrue( attr1.contains( BYTES1, BYTES2 ) ); assertTrue( attr1.contains( nullBinaryValue ) ); Attribute attr2 = new DefaultAttribute( atPwd, stringValue1, binaryValue2, nullBinaryValue ); assertFalse( attr2.isHumanReadable() ); assertEquals( 2, attr2.size() ); assertEquals( "2.5.4.35", attr2.getId() ); assertEquals( "userPassword", attr2.getUpId() ); assertEquals( atPwd, attr2.getAttributeType() ); assertTrue( attr2.contains( BYTES2 ) ); assertTrue( attr2.contains( nullBinaryValue ) ); } /** * Test method DefaultEntryAttribute( String, AttributeType, byte[]... ) */ @Test public void testDefaultServerAttributeStringAttributeTypeByteArray() throws LdapException { Attribute attr1 = new DefaultAttribute( "userPassword", atPwd, BYTES1, BYTES2, ( byte[] ) null ); assertFalse( attr1.isHumanReadable() ); assertEquals( 3, attr1.size() ); assertEquals( "2.5.4.35", attr1.getId() ); assertEquals( "userPassword", attr1.getUpId() ); assertEquals( atPwd, attr1.getAttributeType() ); assertTrue( attr1.contains( BYTES1, BYTES2 ) ); assertTrue( attr1.contains( nullBinaryValue ) ); Attribute attr2 = new DefaultAttribute( "2.5.4.35", atPwd, stringValue1, binaryValue2, nullBinaryValue ); assertFalse( attr2.isHumanReadable() ); assertEquals( 2, attr2.size() ); assertEquals( "2.5.4.35", attr2.getId() ); assertEquals( "2.5.4.35", attr2.getUpId() ); assertEquals( atPwd, attr2.getAttributeType() ); assertTrue( attr2.contains( BYTES2 ) ); assertTrue( attr2.contains( nullBinaryValue ) ); } /** * Test method testClone() */ @Test public void testClone() throws LdapException { Attribute attr = new DefaultAttribute( atDC ); Attribute clone = attr.clone(); assertEquals( attr, clone ); attr.setUpId( "DomainComponent" ); assertEquals( "0.9.2342.19200300.100.1.25", clone.getId() ); attr.add( "a", ( String ) null, "b" ); clone = attr.clone(); assertEquals( attr, clone ); attr.remove( "a" ); assertNotSame( attr, clone ); clone = attr.clone(); assertEquals( attr, clone ); } /** * Test the copy constructor of a EntryAttribute */ @Test public void testCopyConstructorServerAttribute() throws LdapException { Attribute attribute = new DefaultAttribute( atCN ); Attribute copy = new DefaultAttribute( atCN, attribute ); assertEquals( copy, attribute ); Attribute attribute2 = new DefaultAttribute( atCN, "test" ); Attribute copy2 = new DefaultAttribute( atCN, attribute2 ); assertEquals( copy2, attribute2 ); attribute2.add( "test2" ); assertNotSame( copy2, attribute2 ); assertEquals( "test", copy2.getString() ); } /** * Test the copy constructor of a ClientAttribute */ @Test public void testCopyConstructorClientAttribute() throws LdapException { Attribute attribute = new DefaultAttribute( "commonName" ); attribute.add( "test" ); Attribute copy = new DefaultAttribute( atCN, attribute ); assertEquals( atCN, copy.getAttributeType() ); assertEquals( "test", copy.getString() ); assertTrue( copy.isHumanReadable() ); attribute.add( "test2" ); assertFalse( copy.contains( "test2" ) ); } /** * Test the conversion method */ @Test public void testToClientAttribute() throws LdapException { Attribute attribute = new DefaultAttribute( atCN, "test", "test2" ); Attribute clientAttribute = attribute.clone(); assertTrue( clientAttribute instanceof Attribute ); assertTrue( clientAttribute.contains( "test", "test2" ) ); assertEquals( "2.5.4.3", clientAttribute.getId() ); attribute.remove( "test", "test2" ); assertTrue( clientAttribute.contains( "test", "test2" ) ); } /** * Test the serialization of a complete server attribute */ @Test public void testSerializeCompleteAttribute() throws LdapException, IOException, ClassNotFoundException { DefaultAttribute dsa = new DefaultAttribute( atCN ); dsa.setUpId( "CommonName" ); dsa.add( "test1", "test2" ); DefaultAttribute dsaSer = deserializeValue( serializeValue( dsa ), atCN ); assertEquals( dsa.toString(), dsaSer.toString() ); assertEquals( "2.5.4.3", dsaSer.getId() ); assertEquals( "CommonName", dsaSer.getUpId() ); assertEquals( "test1", dsaSer.getString() ); assertTrue( dsaSer.contains( "test2", "test1" ) ); assertTrue( dsaSer.isHumanReadable() ); } /** * Test the serialization of a server attribute with no value */ @Test public void testSerializeAttributeWithNoValue() throws LdapException, IOException, ClassNotFoundException { DefaultAttribute dsa = new DefaultAttribute( atCN ); dsa.setUpId( "cn" ); DefaultAttribute dsaSer = deserializeValue( serializeValue( dsa ), atCN ); assertEquals( dsa.toString(), dsaSer.toString() ); assertEquals( "2.5.4.3", dsaSer.getId() ); assertEquals( "cn", dsaSer.getUpId() ); assertEquals( 0, dsaSer.size() ); assertTrue( dsaSer.isHumanReadable() ); } /** * Test the serialization of a server attribute with a null value */ @Test public void testSerializeAttributeNullValue() throws LdapException, IOException, ClassNotFoundException { DefaultAttribute dsa = new DefaultAttribute( atDC ); dsa.setUpId( "DomainComponent" ); dsa.add( ( String ) null ); DefaultAttribute dsaSer = deserializeValue( serializeValue( dsa ), atDC ); assertEquals( dsa.toString(), dsaSer.toString() ); assertEquals( "0.9.2342.19200300.100.1.25", dsaSer.getId() ); assertEquals( "DomainComponent", dsaSer.getUpId() ); assertEquals( "", dsaSer.getString() ); assertEquals( 1, dsaSer.size() ); assertTrue( dsaSer.contains( ( String ) null ) ); assertTrue( dsaSer.isHumanReadable() ); } /** * Test the serialization of a server attribute with a binary value */ @Test public void testSerializeAttributeBinaryValue() throws LdapException, IOException, ClassNotFoundException { DefaultAttribute dsa = new DefaultAttribute( atPwd ); byte[] password = Strings.getBytesUtf8( "secret" ); dsa.add( password ); DefaultAttribute dsaSer = deserializeValue( serializeValue( dsa ), atPwd ); assertEquals( dsa.toString(), dsaSer.toString() ); assertEquals( "2.5.4.35", dsaSer.getId() ); assertEquals( "userPassword", dsaSer.getUpId() ); assertTrue( Arrays.equals( dsa.getBytes(), dsaSer.getBytes() ) ); assertEquals( 1, dsaSer.size() ); assertTrue( dsaSer.contains( password ) ); assertFalse( dsaSer.isHumanReadable() ); } } ././@LongLink0100644 0000000 0000000 00000000171 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareEntrySerializationTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareEntrySe0100644 0000767 0000024 00000012341 13114114302 034752 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.entry; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.apache.directory.api.ldap.model.entry.DefaultEntry; import org.apache.directory.api.ldap.model.entry.Entry; 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.manager.impl.DefaultSchemaManager; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Test the Entry Serialization * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class SchemaAwareEntrySerializationTest { private static SchemaManager schemaManager; /** * Initialize OIDs maps for normalization */ @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); } @Test public void testEntryFullSerialization() throws IOException, LdapException, ClassNotFoundException { Entry entry1 = new DefaultEntry( schemaManager, "dc=example, dc=com", "ObjectClass: top", "ObjectClass: domain", "dc: example", "l: test" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); entry1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Entry entry2 = new DefaultEntry( schemaManager ); entry2.readExternal( in ); assertEquals( entry1, entry2 ); assertTrue( entry2.contains( "2.5.4.0", "top", "domain" ) ); } @Test public void testEntryNoDnSerialization() throws IOException, LdapException, ClassNotFoundException { Entry entry1 = new DefaultEntry( schemaManager, "", "ObjectClass: top", "ObjectClass: domain", "dc: example", "l: test" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); entry1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Entry entry2 = new DefaultEntry( schemaManager ); entry2.readExternal( in ); assertEquals( entry1, entry2 ); assertTrue( entry2.contains( "ObjectClass", "top", "domain" ) ); assertEquals( "", entry2.getDn().toString() ); } @Test public void testEntryNoAttributesSerialization() throws IOException, LdapException, ClassNotFoundException { Entry entry1 = new DefaultEntry( schemaManager, "dc=example, dc=com" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); entry1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Entry entry2 = new DefaultEntry( schemaManager ); entry2.readExternal( in ); assertEquals( entry1, entry2 ); assertEquals( 0, entry2.size() ); } @Test public void testEntryNoAttributesNoDnSerialization() throws IOException, LdapException, ClassNotFoundException { Entry entry1 = new DefaultEntry( schemaManager, "" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); entry1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Entry entry2 = new DefaultEntry( schemaManager ); entry2.readExternal( in ); assertEquals( entry1, entry2 ); assertEquals( 0, entry2.size() ); } } ././@LongLink0100644 0000000 0000000 00000000154 13114114302 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareEntryTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareEntryTe0100644 0000767 0000024 00000120032 13114114302 034750 0ustar00elecharnystaff0000000 0000000 /* * 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. */ package org.apache.directory.api.ldap.entry; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import org.apache.directory.api.ldap.model.entry.Attribute; import org.apache.directory.api.ldap.model.entry.BinaryValue; 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.Entry; import org.apache.directory.api.ldap.model.entry.StringValue; 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.name.Dn; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.apache.directory.api.util.Strings; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * A test class for the DefaultEntry class * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class SchemaAwareEntryTest { private static Dn exampleDn; private static final byte[] BYTES1 = new byte[] { 'a', 'b' }; private static final byte[] BYTES2 = new byte[] { 'b' }; private static final byte[] BYTES3 = new byte[] { 'c' }; private static SchemaManager schemaManager; /** * Helper method which creates an entry with 4 attributes. */ private Entry createEntry() { try { Entry entry = new DefaultEntry( exampleDn ); Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" ); Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); entry.put( attrOC, attrCN, attrSN, attrPWD ); return entry; } catch ( LdapException ne ) { // Do nothing return null; } } /** * Serialize a ClientEntry */ private ByteArrayOutputStream serializeValue( Entry value ) throws IOException { ObjectOutputStream oOut = null; ByteArrayOutputStream out = new ByteArrayOutputStream(); try { oOut = new ObjectOutputStream( out ); oOut.writeObject( value ); } catch ( IOException ioe ) { throw ioe; } finally { try { if ( oOut != null ) { oOut.flush(); oOut.close(); } } catch ( IOException ioe ) { throw ioe; } } return out; } /** * Deserialize a ClientEntry */ private Entry deserializeValue( ByteArrayOutputStream out ) throws IOException, ClassNotFoundException { ObjectInputStream oIn = null; ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() ); try { oIn = new ObjectInputStream( in ); Entry value = ( Entry ) oIn.readObject(); return value; } catch ( IOException ioe ) { throw ioe; } finally { try { if ( oIn != null ) { oIn.close(); } } catch ( IOException ioe ) { throw ioe; } } } /** * @throws java.lang.Exception */ @BeforeClass public static void setUpBeforeClass() throws Exception { exampleDn = new Dn( "dc=example,dc=com" ); schemaManager = new DefaultSchemaManager(); } /** * Test method for DefaultEntry() */ @Test public void testDefaultClientEntry() { Entry entry = new DefaultEntry(); assertNotNull( entry ); assertEquals( Dn.EMPTY_DN, entry.getDn() ); assertEquals( 0, entry.size() ); } /** * Test method for DefaultEntry() */ @Test public void testDefaultClientEntryLdif() throws Exception { Entry entry = new DefaultEntry( "ou=example, dc=com", "ObjectClass: top", "ObjectClass: person", "cn: test", "sn: test" ); assertNotNull( entry ); assertEquals( "ou=example, dc=com", entry.getDn().toString() ); assertEquals( 3, entry.size() ); assertTrue( entry.contains( "objectClass", "top", "person" ) ); assertTrue( entry.contains( "cn", "test" ) ); assertTrue( entry.contains( "sn", "test" ) ); } /** * Test method for DefaultEntry( Dn ) */ @Test public void testDefaultClientEntryLdapDN() { Entry entry = new DefaultEntry( exampleDn ); assertNotNull( entry ); assertNotNull( entry.getDn() ); assertEquals( exampleDn, entry.getDn() ); assertEquals( 0, entry.size() ); } /** * Test method for add( EntryAttribute... ) */ @Test public void testAddEntryAttributeArray() throws LdapException { Entry entry = createEntry(); assertEquals( 4, entry.size() ); assertTrue( entry.containsAttribute( "ObjectClass" ) ); assertTrue( entry.containsAttribute( "CN" ) ); assertTrue( entry.containsAttribute( " sn " ) ); assertTrue( entry.containsAttribute( "userPassword" ) ); Attribute attr = entry.get( "objectclass" ); assertEquals( 2, attr.size() ); Attribute attrCN2 = new DefaultAttribute( "cn", "test1", "test3" ); entry.add( attrCN2 ); assertEquals( 4, entry.size() ); attr = entry.get( "cn" ); assertEquals( 3, attr.size() ); assertTrue( attr.contains( "test1", "test2", "test3" ) ); // Check adding some byte[] values (they will not be transformed to Strings) attrCN2.clear(); attrCN2.add( BYTES1, BYTES2 ); entry.add( attrCN2 ); assertEquals( 4, entry.size() ); attr = entry.get( "cn" ); assertEquals( 3, attr.size() ); assertTrue( attr.contains( "test1", "test2", "test3" ) ); assertFalse( attr.contains( "ab", "b" ) ); } /** * Test method for add( String, byte[]... ) */ @Test public void testAddStringByteArrayArray() throws LdapException { Entry entry = new DefaultEntry(); entry.add( "userPassword", ( byte[] ) null ); assertEquals( 1, entry.size() ); Attribute attributePWD = entry.get( "userPassword" ); assertEquals( 1, attributePWD.size() ); assertNotNull( attributePWD.get() ); assertNull( attributePWD.get().getValue() ); entry.add( "jpegPhoto", BYTES1, BYTES1, BYTES2 ); assertEquals( 2, entry.size() ); Attribute attributeJPG = entry.get( "jpegPhoto" ); assertEquals( 2, attributeJPG.size() ); assertNotNull( attributeJPG.get() ); assertTrue( attributeJPG.contains( BYTES1 ) ); assertTrue( attributeJPG.contains( BYTES2 ) ); } /** * Test method for add( String, String... ) */ @Test public void testAddStringStringArray() throws LdapException { Entry entry = new DefaultEntry(); entry.add( "cn", ( String ) null ); assertEquals( 1, entry.size() ); Attribute attributeCN = entry.get( "cn" ); assertEquals( 1, attributeCN.size() ); assertNotNull( attributeCN.get() ); assertNull( attributeCN.get().getValue() ); entry.add( "sn", "test", "test", "TEST" ); assertEquals( 2, entry.size() ); Attribute attributeSN = entry.get( "sn" ); assertEquals( 2, attributeSN.size() ); assertNotNull( attributeSN.get() ); assertTrue( attributeSN.contains( "test" ) ); assertTrue( attributeSN.contains( "TEST" ) ); } /** * Test method for add( String, Value... ) */ @Test public void testAddStringValueArray() throws LdapException { Entry entry = new DefaultEntry(); Value value = new StringValue( ( String ) null ); entry.add( "cn", value ); assertEquals( 1, entry.size() ); Attribute attributeCN = entry.get( "cn" ); assertEquals( 1, attributeCN.size() ); assertNotNull( attributeCN.get() ); assertNull( attributeCN.get().getValue() ); Value value1 = new StringValue( "test1" ); Value value2 = new StringValue( "test2" ); Value value3 = new StringValue( "test1" ); entry.add( "sn", value1, value2, value3 ); assertEquals( 2, entry.size() ); Attribute attributeSN = entry.get( "sn" ); assertEquals( 2, attributeSN.size() ); assertNotNull( attributeSN.get() ); assertTrue( attributeSN.contains( value1 ) ); assertTrue( attributeSN.contains( value2 ) ); Value value4 = new BinaryValue( BYTES1 ); entry.add( "l", value1, value4 ); assertEquals( 3, entry.size() ); Attribute attributeL = entry.get( "l" ); assertEquals( 2, attributeL.size() ); assertNotNull( attributeL.get() ); assertTrue( attributeL.contains( value1 ) ); // The byte[] value must have been transformed to a String assertTrue( attributeL.contains( "ab" ) ); } /** * Test method for clear() */ @Test public void testClear() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); assertEquals( 0, entry.size() ); assertNull( entry.get( "ObjectClass" ) ); entry.clear(); assertEquals( 0, entry.size() ); assertNull( entry.get( "ObjectClass" ) ); entry.add( "ObjectClass", "top", "person" ); assertEquals( 1, entry.size() ); assertNotNull( entry.get( "ObjectClass" ) ); entry.clear(); assertEquals( 0, entry.size() ); assertNull( entry.get( "ObjectClass" ) ); } /** * Test method for clone() */ @Test public void testClone() throws LdapException { Entry entry1 = new DefaultEntry(); Entry entry2 = entry1.clone(); assertEquals( entry1, entry2 ); entry2.setDn( exampleDn ); assertEquals( Dn.EMPTY_DN, entry1.getDn() ); entry1.setDn( exampleDn ); entry2 = entry1.clone(); assertEquals( entry1, entry2 ); entry1.add( "objectClass", "top", "person" ); entry1.add( "cn", "test1", "test2" ); entry2 = entry1.clone(); assertEquals( entry1, entry2 ); entry1.add( "cn", "test3" ); assertEquals( 2, entry2.get( "cn" ).size() ); assertFalse( entry2.contains( "cn", "test3" ) ); entry1.add( "sn", ( String ) null ); assertFalse( entry2.containsAttribute( "sn" ) ); } /** * Test method for contains( EntryAttribute... ) */ @Test public void testContainsEntryAttributeArray() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" ); Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); assertFalse( entry.contains( attrOC, attrCN ) ); entry.add( attrOC, attrCN ); assertTrue( entry.contains( attrOC, attrCN ) ); assertFalse( entry.contains( attrOC, attrCN, attrSN ) ); entry.add( attrSN, attrPWD ); assertTrue( entry.contains( attrSN, attrPWD ) ); } /** * Test method for contains( String, byte[]... ) */ @Test public void testContainsStringByteArray() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); assertFalse( entry.containsAttribute( "objectClass" ) ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, ( byte[] ) null, BYTES2 ); entry.add( attrPWD ); assertTrue( entry.contains( " userPASSWORD ", BYTES1, BYTES2 ) ); assertTrue( entry.contains( " userPASSWORD ", ( byte[] ) null ) ); // We can search for byte[] using Strings. the strings will be converted to byte[] assertTrue( entry.contains( " userPASSWORD ", "ab", "b" ) ); assertFalse( entry.contains( " userPASSWORD ", "ab", "b", "d" ) ); } /** * Test method for contains( String, String... ) */ @Test public void testContainsStringStringArray() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); assertFalse( entry.containsAttribute( "objectClass" ) ); Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" ); Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2", ( String ) null ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); entry.add( attrOC, attrCN, attrSN, attrPWD ); assertTrue( entry.contains( "OBJECTCLASS", "top", "person" ) ); assertTrue( entry.contains( " cn ", "test1", "test2" ) ); assertTrue( entry.contains( "Sn", "Test1", "Test2", ( String ) null ) ); assertTrue( entry.contains( " userPASSWORD ", "ab", "b" ) ); assertFalse( entry.contains( "OBJECTCLASS", "PERSON" ) ); assertFalse( entry.contains( " cn ", "test1", "test3" ) ); assertFalse( entry.contains( "Sn", "Test" ) ); assertFalse( entry.contains( " userPASSWORD ", ( String ) null ) ); } /** * Test method for contains( Sring, Value... ) */ @Test public void testContainsStringValueArray() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); assertFalse( entry.containsAttribute( "objectClass" ) ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2", ( String ) null ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2, ( byte[] ) null ); entry.add( attrCN, attrPWD ); Value strValue1 = new StringValue( "test1" ); Value strValue2 = new StringValue( "test2" ); Value strValue3 = new StringValue( "test3" ); Value strNullValue = new StringValue( ( String ) null ); Value binValue1 = new BinaryValue( BYTES1 ); Value binValue2 = new BinaryValue( BYTES2 ); Value binValue3 = new BinaryValue( BYTES3 ); Value binNullValue = new BinaryValue( ( byte[] ) null ); assertTrue( entry.contains( "CN", strValue1, strValue2, strNullValue ) ); assertTrue( entry.contains( "userpassword", binValue1, binValue2, binNullValue ) ); assertFalse( entry.contains( "cn", strValue3 ) ); assertFalse( entry.contains( "UserPassword", binValue3 ) ); } /** * Test method for containsAttribute( String ) */ @Test public void testContainsAttribute() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); assertFalse( entry.containsAttribute( "objectClass" ) ); Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" ); Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); entry.add( attrOC, attrCN, attrSN, attrPWD ); assertTrue( entry.containsAttribute( "OBJECTCLASS" ) ); assertTrue( entry.containsAttribute( " cn " ) ); assertTrue( entry.containsAttribute( "Sn" ) ); assertTrue( entry.containsAttribute( " userPASSWORD " ) ); entry.clear(); assertFalse( entry.containsAttribute( "OBJECTCLASS" ) ); assertFalse( entry.containsAttribute( " cn " ) ); assertFalse( entry.containsAttribute( "Sn" ) ); assertFalse( entry.containsAttribute( " userPASSWORD " ) ); } /** * Test method for equals() */ @Test public void testEqualsObject() throws LdapException { Entry entry1 = new DefaultEntry(); Entry entry2 = new DefaultEntry(); assertEquals( entry1, entry2 ); entry1.setDn( exampleDn ); assertNotSame( entry1, entry2 ); entry2.setDn( exampleDn ); assertEquals( entry1, entry2 ); Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" ); Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); entry1.put( attrOC, attrCN, attrSN, attrPWD ); entry2.put( attrOC, attrCN, attrSN ); assertNotSame( entry1, entry2 ); entry2.put( attrPWD ); assertEquals( entry1, entry2 ); Attribute attrL1 = new DefaultAttribute( "l", "Paris", "New-York" ); Attribute attrL2 = new DefaultAttribute( "l", "Paris", "Tokyo" ); entry1.put( attrL1 ); entry2.put( attrL1 ); assertEquals( entry1, entry2 ); entry1.add( "l", "London" ); assertNotSame( entry1, entry2 ); entry2.add( attrL2 ); assertNotSame( entry1, entry2 ); entry1.clear(); entry2.clear(); assertEquals( entry1, entry2 ); } /** * Test method for get( String ) */ @Test public void testGet() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); assertNull( entry.get( "objectClass" ) ); Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" ); Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); entry.add( attrOC, attrCN, attrSN, attrPWD ); assertNotNull( entry.get( " CN " ) ); Attribute attribute = entry.get( "cN" ); assertEquals( attribute, attrCN ); assertNull( entry.get( ( String ) null ) ); assertNull( entry.get( " " ) ); assertNull( entry.get( "l" ) ); } /** * Test method for getDN() */ @Test public void testGetDn() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); assertEquals( exampleDn, entry.getDn() ); Dn testDn = new Dn( "cn=test" ); entry.setDn( testDn ); assertEquals( testDn, entry.getDn() ); } /** * Test method for hashcode() */ @Test public void testHashCode() throws LdapException, LdapException { Entry entry1 = new DefaultEntry( exampleDn ); Entry entry2 = new DefaultEntry( exampleDn ); assertEquals( entry1.hashCode(), entry2.hashCode() ); entry2.setDn( new Dn( "ou=system,dc=com" ) ); assertNotSame( entry1.hashCode(), entry2.hashCode() ); entry2.setDn( exampleDn ); assertEquals( entry1.hashCode(), entry2.hashCode() ); Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" ); Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); entry1.add( attrOC, attrCN, attrSN, attrPWD ); entry2.add( attrOC, attrCN, attrSN, attrPWD ); assertEquals( entry1.hashCode(), entry2.hashCode() ); Entry entry3 = new DefaultEntry( exampleDn ); entry3.add( attrOC, attrSN, attrCN, attrPWD ); assertEquals( entry1.hashCode(), entry3.hashCode() ); } /** * Test method for hasObjectClass( String ) */ @Test public void testHasObjectClass() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); assertFalse( entry.containsAttribute( "objectClass" ) ); assertFalse( entry.hasObjectClass( "top" ) ); entry.add( new DefaultAttribute( "objectClass", "top", "person" ) ); assertTrue( entry.hasObjectClass( "top" ) ); assertTrue( entry.hasObjectClass( "person" ) ); assertFalse( entry.hasObjectClass( "inetorgperson" ) ); assertFalse( entry.hasObjectClass( ( String ) null ) ); assertFalse( entry.hasObjectClass( "" ) ); } /** * Test method for Iterator() */ @Test public void testIterator() throws LdapException { Entry entry = createEntry(); Iterator iterator = entry.iterator(); assertTrue( iterator.hasNext() ); Set expectedIds = new HashSet(); expectedIds.add( "objectclass" ); expectedIds.add( "cn" ); expectedIds.add( "sn" ); expectedIds.add( "userpassword" ); while ( iterator.hasNext() ) { Attribute attribute = iterator.next(); String id = attribute.getId(); assertTrue( expectedIds.contains( id ) ); expectedIds.remove( id ); } assertEquals( 0, expectedIds.size() ); } /** * Test method for put( EntryAttribute... ) */ @Test public void testPutEntryAttributeArray() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" ); Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); List removed = entry.put( attrOC, attrCN, attrSN, attrPWD ); assertEquals( 4, entry.size() ); assertEquals( 0, removed.size() ); assertTrue( entry.containsAttribute( "ObjectClass" ) ); assertTrue( entry.containsAttribute( "CN" ) ); assertTrue( entry.containsAttribute( " sn " ) ); assertTrue( entry.containsAttribute( "userPassword" ) ); Attribute attrCN2 = new DefaultAttribute( "cn", "test3", "test4" ); removed = entry.put( attrCN2 ); assertEquals( 4, entry.size() ); assertEquals( 1, removed.size() ); assertTrue( entry.containsAttribute( "CN" ) ); assertTrue( entry.contains( "cn", "test3", "test4" ) ); } /** * Test method for put( String, byte[]... ) */ @Test public void testPutStringByteArrayArray() { Entry entry = new DefaultEntry( exampleDn ); try { entry.put( ( String ) null, BYTES1 ); fail(); } catch ( IllegalArgumentException iae ) { assertTrue( true ); } try { entry.put( " ", BYTES1 ); fail(); } catch ( IllegalArgumentException iae ) { assertTrue( true ); } entry.put( "userPassword", ( byte[] ) null ); assertEquals( 1, entry.size() ); assertNotNull( entry.get( "userPassword" ) ); assertEquals( 1, entry.get( "userPassword" ).size() ); assertNull( entry.get( "userPassword" ).get().getValue() ); entry.put( "jpegPhoto", BYTES1, BYTES2, BYTES1 ); assertEquals( 2, entry.size() ); assertNotNull( entry.get( "jpegPhoto" ) ); assertEquals( 2, entry.get( "JPEGPhoto" ).size() ); Attribute attribute = entry.get( "jpegPhoto" ); assertTrue( attribute.contains( BYTES1 ) ); assertTrue( attribute.contains( BYTES2 ) ); assertEquals( "jpegphoto", attribute.getId() ); assertEquals( "jpegPhoto", attribute.getUpId() ); } /** * Test method for put( String, String... ) */ @Test public void testPutStringStringArray() { Entry entry = new DefaultEntry( exampleDn ); try { entry.put( ( String ) null, "a" ); fail(); } catch ( IllegalArgumentException iae ) { assertTrue( true ); } try { entry.put( " ", "a" ); fail(); } catch ( IllegalArgumentException iae ) { assertTrue( true ); } entry.put( "sn", ( String ) null ); assertEquals( 1, entry.size() ); assertNotNull( "sn", entry.get( "sn" ) ); assertEquals( 1, entry.get( "sn" ).size() ); assertNull( entry.get( "sn" ).get().getValue() ); entry.put( "ObjectClass", "top", "person", "top" ); assertEquals( 2, entry.size() ); assertNotNull( "objectclass", entry.get( "sn" ) ); assertEquals( 2, entry.get( "OBJECTCLASS" ).size() ); Attribute attribute = entry.get( "objectClass" ); assertTrue( attribute.contains( "top" ) ); assertTrue( attribute.contains( "person" ) ); assertEquals( "objectclass", attribute.getId() ); assertEquals( "ObjectClass", attribute.getUpId() ); } /** * Test method for pu( String, Value... ) */ @Test public void testPutStringValueArray() { Entry entry = new DefaultEntry( exampleDn ); Value strValueTop = new StringValue( "top" ); Value strValuePerson = new StringValue( "person" ); Value strValueTop2 = new StringValue( "top" ); Value strNullValue = new StringValue( ( String ) null ); Value binValue1 = new BinaryValue( BYTES1 ); Value binValue2 = new BinaryValue( BYTES2 ); Value binValue3 = new BinaryValue( BYTES1 ); Value binNullValue = new BinaryValue( ( byte[] ) null ); try { entry.put( ( String ) null, strValueTop ); fail(); } catch ( IllegalArgumentException iae ) { assertTrue( true ); } try { entry.put( " ", strValueTop ); fail(); } catch ( IllegalArgumentException iae ) { assertTrue( true ); } entry.put( "sn", strNullValue ); assertEquals( 1, entry.size() ); assertNotNull( "sn", entry.get( "sn" ) ); assertEquals( 1, entry.get( "sn" ).size() ); assertNull( entry.get( "sn" ).get().getValue() ); entry.clear(); entry.put( "ObjectClass", strValueTop, strValuePerson, strValueTop2, strNullValue ); assertEquals( 1, entry.size() ); assertNotNull( "objectclass", entry.get( "objectclass" ) ); assertEquals( 3, entry.get( "OBJECTCLASS" ).size() ); Attribute attribute = entry.get( "objectClass" ); assertTrue( attribute.contains( "top" ) ); assertTrue( attribute.contains( "person" ) ); assertTrue( attribute.contains( ( String ) null ) ); assertEquals( "objectclass", attribute.getId() ); assertEquals( "ObjectClass", attribute.getUpId() ); entry.clear(); entry.put( "userpassword", strNullValue ); assertEquals( 1, entry.size() ); assertNotNull( "userpassword", entry.get( "userpassword" ) ); assertEquals( 1, entry.get( "userpassword" ).size() ); assertNull( entry.get( "userpassword" ).get().getValue() ); entry.clear(); entry.put( "userPassword", binValue1, binValue2, binValue3, binNullValue ); assertEquals( 1, entry.size() ); assertNotNull( "userpassword", entry.get( "userpassword" ) ); assertEquals( 3, entry.get( "userpassword" ).size() ); attribute = entry.get( "userpassword" ); assertTrue( attribute.contains( BYTES1 ) ); assertTrue( attribute.contains( BYTES2 ) ); assertTrue( attribute.contains( ( byte[] ) null ) ); assertEquals( "userpassword", attribute.getId() ); assertEquals( "userPassword", attribute.getUpId() ); } /** * Test method for removeAttributes( String... ) */ @Test public void testRemoveAttributesStringArray() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" ); Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); entry.put( attrOC, attrCN, attrSN, attrPWD ); entry.removeAttributes( "CN", "SN" ); assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( ( String ) null ); } /** * Test method for remove( EntryAttribute... ) */ @Test public void testRemoveEntryAttributeArray() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" ); Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 ); entry.put( attrOC, attrCN, attrSN, attrPWD ); List removed = entry.remove( attrSN, attrPWD ); assertEquals( 2, removed.size() ); assertEquals( 2, entry.size() ); assertTrue( removed.contains( attrSN ) ); assertTrue( removed.contains( attrPWD ) ); assertTrue( entry.contains( "objectClass", "top", "person" ) ); assertTrue( entry.contains( "cn", "test1", "test2" ) ); assertFalse( entry.containsAttribute( "sn" ) ); assertFalse( entry.containsAttribute( "userPassword" ) ); removed = entry.remove( attrSN, attrPWD ); assertEquals( 0, removed.size() ); } /** * Test method for remove(String, byte[]... ) */ @Test public void testRemoveStringByteArrayArray() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, ( byte[] ) null, BYTES2 ); entry.put( attrPWD ); assertTrue( entry.remove( "userPassword", ( byte[] ) null ) ); assertTrue( entry.remove( "userPassword", BYTES1, BYTES2 ) ); assertFalse( entry.containsAttribute( "userPassword" ) ); entry.add( "userPassword", BYTES1, ( byte[] ) null, BYTES2 ); assertTrue( entry.remove( "userPassword", ( byte[] ) null ) ); assertEquals( 2, entry.get( "userPassword" ).size() ); assertTrue( entry.remove( "userPassword", BYTES1, BYTES3 ) ); assertEquals( 1, entry.get( "userPassword" ).size() ); assertTrue( Arrays.equals( BYTES2, entry.get( "userPassword" ).getBytes() ) ); assertFalse( entry.remove( "userPassword", BYTES3 ) ); assertFalse( entry.remove( "void", "whatever" ) ); } /** * Test method for remove( String, String... ) */ @Test public void testRemoveStringStringArray() throws LdapException { Entry entry = createEntry(); assertTrue( entry.remove( "cn", "test1" ) ); assertTrue( entry.remove( "cn", "test2" ) ); assertFalse( entry.containsAttribute( "cn" ) ); entry.add( "cn", "test1", ( String ) null, "test2" ); assertTrue( entry.remove( "cn", ( String ) null ) ); assertEquals( 2, entry.get( "cn" ).size() ); assertTrue( entry.remove( "cn", "test1", "test3" ) ); assertEquals( 1, entry.get( "cn" ).size() ); assertEquals( "test2", entry.get( "cn" ).get().getString() ); assertFalse( entry.remove( "cn", "test3" ) ); assertFalse( entry.remove( "void", "whatever" ) ); } /** * Test method for remove(String, Value... ) */ @Test public void testRemoveStringValueArray() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2", ( String ) null ); Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2, ( byte[] ) null ); entry.add( attrCN, attrPWD ); Value strValue1 = new StringValue( "test1" ); Value strValue2 = new StringValue( "test2" ); Value strValue3 = new StringValue( "test3" ); Value strNullValue = new StringValue( ( String ) null ); Value binValue1 = new BinaryValue( BYTES1 ); Value binValue2 = new BinaryValue( BYTES2 ); Value binValue3 = new BinaryValue( BYTES3 ); Value binNullValue = new BinaryValue( ( byte[] ) null ); assertTrue( entry.remove( "cn", strValue1, strNullValue ) ); assertTrue( entry.contains( "cn", strValue2 ) ); assertFalse( entry.remove( "cn", strValue3 ) ); assertTrue( entry.remove( "cn", strValue2 ) ); assertFalse( entry.containsAttribute( "cn" ) ); entry.add( attrCN, attrPWD ); assertTrue( entry.remove( "userpassword", binValue1, binNullValue ) ); assertTrue( entry.contains( "userpassword", binValue2 ) ); assertFalse( entry.remove( "userpassword", binValue3 ) ); assertTrue( entry.remove( "userpassword", binValue2 ) ); assertFalse( entry.containsAttribute( "userpassword" ) ); } /** * Test method for setDN( Dn ) */ @Test public void testSetDn() { Entry entry = new DefaultEntry(); assertEquals( Dn.EMPTY_DN, entry.getDn() ); entry.setDn( exampleDn ); assertEquals( exampleDn, entry.getDn() ); } /** * Test method for size() */ @Test public void testSize() throws LdapException { Entry entry = new DefaultEntry( exampleDn ); assertEquals( 0, entry.size() ); entry.add( "ObjectClass", "top", "person" ); entry.add( "cn", "test" ); entry.add( "sn", "Test" ); assertEquals( 3, entry.size() ); entry.clear(); assertEquals( 0, entry.size() ); } /** * Test method for for {@link org.apache.directory.api.ldap.model.entry.DefaultEntry#toString()}. */ @Test public void testToString() { Entry entry = new DefaultEntry( exampleDn ); assertEquals( "Entry\n dn: dc=example,dc=com\n\n", entry.toString() ); Value strValueTop = new StringValue( "top" ); Value strValuePerson = new StringValue( "person" ); Value strNullValue = new StringValue( ( String ) null ); Value binValue1 = new BinaryValue( BYTES1 ); Value binValue2 = new BinaryValue( BYTES2 ); Value binNullValue = new BinaryValue( ( byte[] ) null ); entry.put( "ObjectClass", strValueTop, strValuePerson, strNullValue ); entry.put( "UserPassword", binValue1, binValue2, binNullValue ); String expected = "Entry\n" + " dn: dc=example,dc=com\n" + " ObjectClass: top\n" + " ObjectClass: person\n" + " ObjectClass: ''\n" + " UserPassword: 0x61 0x62 \n" + " UserPassword: 0x62 \n" + " UserPassword: ''\n"; assertEquals( expected, entry.toString() ); } /** * Test the serialization of a complete entry */ @Test public void testSerializeCompleteEntry() throws LdapException, IOException, ClassNotFoundException { Dn dn = new Dn( "ou=system" ); dn.apply( schemaManager ); byte[] password = Strings.getBytesUtf8( "secret" ); Entry entry = new DefaultEntry( dn ); entry.add( "ObjectClass", "top", "person" ); entry.add( "cn", "test1" ); entry.add( "userPassword", password ); Entry entrySer = deserializeValue( serializeValue( entry ) ); assertEquals( entry, entrySer ); } /** * Test the serialization of an entry with no Dn */ @Test public void testSerializeEntryWithNoDN() throws LdapException, IOException, ClassNotFoundException { byte[] password = Strings.getBytesUtf8( "secret" ); Entry entry = new DefaultEntry(); entry.add( "ObjectClass", "top", "person" ); entry.add( "cn", "test1" ); entry.add( "userPassword", password ); Entry entrySer = deserializeValue( serializeValue( entry ) ); assertEquals( entry, entrySer ); } /** * Test the serialization of an entry with no attribute and no Dn */ @Test public void testSerializeEntryWithNoDNNoAttribute() throws LdapException, IOException, ClassNotFoundException { Entry entry = new DefaultEntry(); Entry entrySer = deserializeValue( serializeValue( entry ) ); assertEquals( entry, entrySer ); } /** * Test the serialization of an entry with no attribute */ @Test public void testSerializeEntryWithNoAttribute() throws LdapException, IOException, ClassNotFoundException { Dn dn = new Dn( "ou=system" ); dn.apply( schemaManager ); Entry entry = new DefaultEntry( dn ); Entry entrySer = deserializeValue( serializeValue( entry ) ); assertEquals( entry, entrySer ); } /** * Test method for userCertificate;binary AT */ @Test public void testUserCertificateBinary() throws LdapException { Entry entry = new DefaultEntry( schemaManager ); entry.add( "objectClass", "top", "person", "inetorgPerson" ); entry.add( "cn", "test1", "test2" ); entry.add( "sn", "Test1", "Test2" ); entry.add( "userPassword", BYTES1, BYTES2 ); entry.add( "userCertificate;binary", Strings.getBytesUtf8( "secret" ) ); assertTrue( entry.containsAttribute( "userCertificate;binary" ) ); assertTrue( entry.containsAttribute( "userCertificate" ) ); entry.removeAttributes( "userCertificate;binary" ); assertFalse( entry.containsAttribute( "userCertificate;binary" ) ); assertFalse( entry.containsAttribute( "userCertificate" ) ); entry.add( "userCertificate", Strings.getBytesUtf8( "secret" ) ); assertTrue( entry.containsAttribute( "userCertificate;binary" ) ); assertTrue( entry.containsAttribute( "userCertificate" ) ); } } ././@LongLink0100644 0000000 0000000 00000000200 13114114302 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareModificationSerializationTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareModific0100644 0000767 0000024 00000016220 13114114302 034733 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.entry; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; 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.exception.LdapException; import org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException; import org.apache.directory.api.ldap.model.schema.AttributeType; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Test the DefaultModification class * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class SchemaAwareModificationSerializationTest { private static SchemaManager schemaManager; private static AttributeType cnAT; /** * Initialize OIDs maps for normalization */ @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); cnAT = schemaManager.getAttributeType( "cn" ); } /** * Serialize a DefaultModification */ private ByteArrayOutputStream serializeValue( Modification modification ) throws IOException { ObjectOutputStream oOut = null; ByteArrayOutputStream out = new ByteArrayOutputStream(); try { oOut = new ObjectOutputStream( out ); modification.writeExternal( oOut ); } catch ( IOException ioe ) { throw ioe; } finally { try { if ( oOut != null ) { oOut.flush(); oOut.close(); } } catch ( IOException ioe ) { throw ioe; } } return out; } /** * Deserialize a DefaultModification */ private Modification deserializeValue( ByteArrayOutputStream out ) throws IOException, ClassNotFoundException, LdapInvalidAttributeValueException { ObjectInputStream oIn = null; ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() ); try { oIn = new ObjectInputStream( in ); Modification modification = new DefaultModification(); modification.readExternal( oIn ); Attribute attribute = modification.getAttribute(); if ( ( attribute != null ) && ( schemaManager != null ) ) { AttributeType attributeType = schemaManager.getAttributeType( attribute.getId() ); modification.apply( attributeType ); } return modification; } catch ( IOException ioe ) { throw ioe; } finally { try { if ( oIn != null ) { oIn.close(); } } catch ( IOException ioe ) { throw ioe; } } } @Test public void testCreateServerModification() throws LdapException { Attribute attribute = new DefaultAttribute( "cn", cnAT ); attribute.add( "test1", "test2" ); Modification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute ); Modification clone = mod.clone(); attribute.remove( "test2" ); Attribute clonedAttribute = clone.getAttribute(); assertEquals( 1, mod.getAttribute().size() ); assertTrue( mod.getAttribute().contains( "TEST1" ) ); assertEquals( 2, clonedAttribute.size() ); assertTrue( clone.getAttribute().contains( "test1" ) ); assertTrue( clone.getAttribute().contains( "test2" ) ); } @Test public void testSerializationModificationADD() throws ClassNotFoundException, IOException, LdapInvalidAttributeValueException { Attribute attribute = new DefaultAttribute( "cn", cnAT ); attribute.add( "test1", "test2" ); DefaultModification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute ); Modification modSer = deserializeValue( serializeValue( mod ) ); assertEquals( mod, modSer ); } @Test public void testSerializationModificationREPLACE() throws ClassNotFoundException, IOException, LdapInvalidAttributeValueException { Attribute attribute = new DefaultAttribute( "cn", cnAT ); attribute.add( "test1", "test2" ); DefaultModification mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute ); Modification modSer = deserializeValue( serializeValue( mod ) ); assertEquals( mod, modSer ); } @Test public void testSerializationModificationREMOVE() throws ClassNotFoundException, IOException, LdapInvalidAttributeValueException { Attribute attribute = new DefaultAttribute( "cn", cnAT ); attribute.add( "test1", "test2" ); DefaultModification mod = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attribute ); Modification modSer = deserializeValue( serializeValue( mod ) ); assertEquals( mod, modSer ); } @Test public void testSerializationModificationNoAttribute() throws ClassNotFoundException, IOException, LdapInvalidAttributeValueException { DefaultModification mod = new DefaultModification(); mod.setOperation( ModificationOperation.ADD_ATTRIBUTE ); Modification modSer = deserializeValue( serializeValue( mod ) ); assertEquals( mod, modSer ); } } ././@LongLink0100644 0000000 0000000 00000000171 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareValueSerializationTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareValueSe0100644 0000767 0000024 00000025326 13114114302 034734 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.entry; import static org.junit.Assert.assertEquals; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.apache.directory.api.ldap.model.entry.BinaryValue; import org.apache.directory.api.ldap.model.entry.StringValue; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.schema.AttributeType; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.apache.directory.api.util.Strings; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Test the Value Serialization * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class SchemaAwareValueSerializationTest { private static final byte[] DATA = new byte[] { 0x01, 0x02, 0x03, 0x04 }; private static BinaryValue bv1; private static BinaryValue bv2; private static BinaryValue bv3; private static BinaryValue bv1n; private static BinaryValue bv2n; private static BinaryValue bv3n; private static StringValue sv1; private static StringValue sv2; private static StringValue sv3; private static StringValue sv1n; private static StringValue sv2n; private static StringValue sv3n; private static SchemaManager schemaManager; private static AttributeType cn = null; private static AttributeType dc = null; private static AttributeType userCertificate = null; /** * Initialize OIDs maps for normalization */ @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); cn = schemaManager.getAttributeType( "cn" ); dc = schemaManager.getAttributeType( "dc" ); userCertificate = schemaManager.getAttributeType( "userCertificate" ); bv1 = new BinaryValue( userCertificate, DATA ); bv2 = new BinaryValue( userCertificate, Strings.EMPTY_BYTES ); bv3 = new BinaryValue( userCertificate, null ); bv1n = new BinaryValue( userCertificate, DATA ); bv2n = new BinaryValue( userCertificate, Strings.EMPTY_BYTES ); bv3n = new BinaryValue( userCertificate, null ); sv1 = new StringValue( cn, "test" ); sv2 = new StringValue( dc, "" ); sv3 = new StringValue( dc, ( String ) null ); sv1n = new StringValue( cn, "test" ); sv2n = new StringValue( dc, "" ); sv3n = new StringValue( dc, ( String ) null ); } @Test public void testBinaryValueWithDataSerialization() throws IOException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); bv1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); BinaryValue bvDeser = BinaryValue.deserialize( in ); assertEquals( bv1, bvDeser ); } @Test public void testBinaryValueWithEmptyDataSerialization() throws IOException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); bv2.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); BinaryValue bvDeser = BinaryValue.deserialize( in ); assertEquals( bv2, bvDeser ); } @Test public void testBinaryValueNoDataSerialization() throws IOException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); bv3.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); BinaryValue bvDeser = BinaryValue.deserialize( in ); assertEquals( bv3, bvDeser ); } @Test public void testStringValueWithDataSerialization() throws IOException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); sv1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); StringValue svDeser = StringValue.deserialize( in ); assertEquals( sv1, svDeser ); } @Test public void testStringValueWithEmptyDataSerialization() throws IOException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); sv2.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); StringValue svDeser = StringValue.deserialize( in ); assertEquals( sv2, svDeser ); } @Test public void testStringValueNoDataSerialization() throws IOException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); sv3.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); StringValue svDeser = StringValue.deserialize( in ); assertEquals( sv3, svDeser ); } @Test public void testBinaryValueWithDataNormalizedSerialization() throws IOException, LdapException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); BinaryValue value = new BinaryValue( userCertificate, bv1n.getBytes() ); value.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); BinaryValue bvDeser = BinaryValue.deserialize( userCertificate, in ); assertEquals( value, bvDeser ); } @Test public void testBinaryValueWithEmptyDataNormalizedSerialization() throws IOException, LdapException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); BinaryValue value = new BinaryValue( userCertificate, bv2n.getBytes() ); value.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); BinaryValue bvDeser = BinaryValue.deserialize( userCertificate, in ); assertEquals( value, bvDeser ); } @Test public void testBinaryValueNoDataNormalizedSerialization() throws IOException, LdapException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); BinaryValue value = new BinaryValue( userCertificate, bv3n.getBytes() ); value.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); BinaryValue bvDeser = BinaryValue.deserialize( userCertificate, in ); assertEquals( value, bvDeser ); } @Test public void testStringValueWithDataNormalizedSerialization() throws IOException, LdapException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); StringValue value = new StringValue( cn, sv1n.getString() ); value.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); StringValue svDeser = StringValue.deserialize( cn, in ); assertEquals( value, svDeser ); } @Test public void testStringValueWithEmptyDataNormalizedSerialization() throws IOException, LdapException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); StringValue value = new StringValue( dc, sv2n.getString() ); value.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); StringValue svDeser = StringValue.deserialize( dc, in ); assertEquals( value, svDeser ); } @Test public void testStringValueNoDataNormalizedSerialization() throws IOException, LdapException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); StringValue value = new StringValue( dc, sv3n.getString() ); value.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); StringValue svDeser = StringValue.deserialize( dc, in ); assertEquals( value, svDeser ); } } ././@LongLink0100644 0000000 0000000 00000000146 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/TestEntryUtils.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/entry/TestEntryUtils.jav0100644 0000767 0000024 00000021653 13114114302 035027 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.entry; import org.apache.directory.api.ldap.model.entry.BinaryValue; import org.apache.directory.api.ldap.model.entry.StringValue; 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.schema.AttributeType; import org.apache.directory.api.ldap.model.schema.LdapComparator; import org.apache.directory.api.ldap.model.schema.LdapSyntax; import org.apache.directory.api.ldap.model.schema.MatchingRule; import org.apache.directory.api.ldap.model.schema.MutableAttributeType; import org.apache.directory.api.ldap.model.schema.MutableMatchingRule; import org.apache.directory.api.ldap.model.schema.Normalizer; import org.apache.directory.api.ldap.model.schema.SyntaxChecker; import org.apache.directory.api.ldap.model.schema.comparators.ByteArrayComparator; import org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer; import org.apache.directory.api.util.Strings; /** * Some common declaration used by the serverEntry tests. * * @author Apache Directory Project */ public final class TestEntryUtils { /** * A local Syntax class for tests */ static class AT extends AttributeType { private static final long serialVersionUID = 0L; protected AT( String oid ) { super( oid ); } } public static MatchingRule matchingRuleFactory( String oid ) { MatchingRule matchingRule = new MatchingRule( oid ); return matchingRule; } /** * A local MatchingRule class for tests */ static class MR extends MatchingRule { /** The mandatory serialVersionUID field */ public static final long serialVersionUID = 1L; protected MR( String oid ) { super( oid ); } } /** * A local Syntax class used for the tests */ public static LdapSyntax syntaxFactory( String oid, boolean humanReadable ) { LdapSyntax ldapSyntax = new LdapSyntax( oid ); ldapSyntax.setHumanReadable( humanReadable ); return ldapSyntax; } static class S extends LdapSyntax { private static final long serialVersionUID = 0L; public S( String oid, boolean humanReadible ) { super( oid, "", humanReadible ); } } /* no protection*/ static AttributeType getCaseIgnoringAttributeNoNumbersType() { MutableAttributeType attributeType = new MutableAttributeType( "1.1.3.1" ); LdapSyntax syntax = new LdapSyntax( "1.1.1.1", "", true ); syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2.1" ) { /** The mandatory serialVersionUID field */ public static final long serialVersionUID = 1L; public boolean isValidSyntax( Object value ) { if ( !( value instanceof String ) ) { return false; } String strval = ( String ) value; for ( char c : strval.toCharArray() ) { if ( Character.isDigit( c ) ) { return false; } } return true; } } ); MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.2.1" ); matchingRule.setSyntax( syntax ); matchingRule.setLdapComparator( new LdapComparator( matchingRule.getOid() ) { /** The mandatory serialVersionUID field */ public static final long serialVersionUID = 1L; public int compare( String o1, String o2 ) { return ( o1 == null ? ( o2 == null ? 0 : -1 ) : ( o2 == null ? 1 : o1.compareTo( o2 ) ) ); } } ); Normalizer normalizer = new Normalizer( "1.1.1" ) { /** The mandatory serialVersionUID field */ public static final long serialVersionUID = 1L; public Value normalize( Value value ) throws LdapException { if ( value.isHumanReadable() ) { return new StringValue( Strings.toLowerCaseAscii( value.getString() ) ); } throw new IllegalStateException(); } public String normalize( String value ) throws LdapException { return Strings.toLowerCaseAscii( value ); } }; matchingRule.setNormalizer( normalizer ); attributeType.setEquality( matchingRule ); attributeType.setSyntax( syntax ); return attributeType; } /* no protection*/static AttributeType getIA5StringAttributeType() { MutableAttributeType attributeType = new MutableAttributeType( "1.1" ); attributeType.addName( "1.1" ); LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true ); syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2" ) { /** The mandatory serialVersionUID field */ public static final long serialVersionUID = 1L; public boolean isValidSyntax( Object value ) { return ( ( String ) value == null ) || ( ( ( String ) value ).length() < 7 ); } } ); MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.2" ); matchingRule.setSyntax( syntax ); matchingRule.setLdapComparator( new LdapComparator( matchingRule.getOid() ) { /** The mandatory serialVersionUID field */ public static final long serialVersionUID = 1L; public int compare( String o1, String o2 ) { return ( ( o1 == null ) ? ( o2 == null ? 0 : -1 ) : ( o2 == null ? 1 : o1.compareTo( o2 ) ) ); } } ); matchingRule.setNormalizer( new DeepTrimToLowerNormalizer( matchingRule.getOid() ) ); attributeType.setEquality( matchingRule ); attributeType.setSyntax( syntax ); return attributeType; } /* No protection */static AttributeType getBytesAttributeType() { MutableAttributeType attributeType = new MutableAttributeType( "1.2" ); LdapSyntax syntax = new LdapSyntax( "1.2.1", "", true ); syntax.setSyntaxChecker( new SyntaxChecker( "1.2.1" ) { /** The mandatory serialVersionUID field */ public static final long serialVersionUID = 1L; public boolean isValidSyntax( Object value ) { return ( value == null ) || ( ( ( byte[] ) value ).length < 5 ); } } ); MutableMatchingRule matchingRule = new MutableMatchingRule( "1.2.2" ); matchingRule.setSyntax( syntax ); matchingRule.setLdapComparator( new ByteArrayComparator( "1.2.2" ) ); matchingRule.setNormalizer( new Normalizer( "1.1.1" ) { /** The mandatory serialVersionUID field */ public static final long serialVersionUID = 1L; public Value normalize( Value value ) throws LdapException { if ( !value.isHumanReadable() ) { byte[] val = value.getBytes(); // each byte will be changed to be > 0, and spaces will be trimmed byte[] newVal = new byte[val.length]; int i = 0; for ( byte b : val ) { newVal[i++] = ( byte ) ( b & 0x007F ); } return new BinaryValue( Strings.trim( newVal ) ); } throw new IllegalStateException(); } public String normalize( String value ) throws LdapException { throw new IllegalStateException(); } } ); attributeType.setEquality( matchingRule ); attributeType.setSyntax( syntax ); return attributeType; } private TestEntryUtils() { } } apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/AvaTest.java0100644 0000767 0000024 00000030234 13114114302 034427 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.model.name; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.Arrays; 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.schema.SchemaManager; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Test the class AttributeTypeAndValue * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class AvaTest { private static SchemaManager schemaManager; @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); } /** * Test a null AttributeTypeAndValue */ @Test public void testAttributeTypeAndValueNull() { Ava atav = new Ava( schemaManager ); assertEquals( "", atav.toString() ); assertEquals( "", atav.getName() ); } /** * Test a null type for an AttributeTypeAndValue */ @Test public void testAttributeTypeAndValueNullType() throws LdapException { try { new Ava( schemaManager, null, ( String ) null ); fail(); } catch ( LdapException ine ) { assertTrue( true ); } } /** * Test an invalid type for an AttributeTypeAndValue */ @Test public void testAttributeTypeAndValueInvalidType() throws LdapException { try { new Ava( schemaManager, " ", ( String ) null ); fail(); } catch ( LdapException ine ) { assertTrue( true ); } } /** * Test a valid type for an AttributeTypeAndValue */ @Test public void testAttributeTypeAndValueValidType() throws LdapException { Ava ava = new Ava( schemaManager, "CN", " " ); assertEquals( "CN=\\ ", ava.toString() ); assertEquals( "2.5.4.3=\\ ", ava.getNormName() ); assertEquals( "CN=\\ ", ava.getName() ); ava = new Ava( schemaManager, " CN ", " " ); assertEquals( " CN =\\ ", ava.toString() ); assertEquals( "2.5.4.3=\\ ", ava.getNormName() ); assertEquals( " CN =\\ ", ava.getName() ); ava = new Ava( schemaManager, "cn", " " ); assertEquals( "cn=\\ ", ava.toString() ); assertEquals( "2.5.4.3=\\ ", ava.getNormName() ); assertEquals( "cn=\\ ", ava.getName() ); ava = new Ava( schemaManager, " cn ", " " ); assertEquals( " cn =\\ ", ava.toString() ); assertEquals( "2.5.4.3=\\ ", ava.getNormName() ); assertEquals( " cn =\\ ", ava.getName() ); } /** * test an empty AttributeTypeAndValue */ @Test public void testAvaEmpty() { try { new Ava( schemaManager, "", "" ); fail( "Should not occurs ... " ); } catch ( LdapException ine ) { assertTrue( true ); } } /** * test a simple AttributeTypeAndValue : a = b */ @Test public void testAvaSimple() throws LdapException { Ava atav = new Ava( schemaManager, "cn", "b" ); assertEquals( "cn=b", atav.toString() ); assertEquals( "2.5.4.3=b", atav.getNormName() ); assertEquals( "cn=b", atav.getName() ); } /** * test a simple AttributeTypeAndValue : a = b */ @Test public void testAvaSimpleNorm() throws LdapException { Ava atav = new Ava( schemaManager, " CommonName ", " This is a TEST " ); assertEquals( " CommonName =\\ This is a TEST\\ ", atav.toString() ); assertEquals( "2.5.4.3=this is a test", atav.getNormName() ); assertEquals( " CommonName =\\ This is a TEST\\ ", atav.getName() ); } /** * Compares two equals atavs */ @Test public void testEqualsSameAva() throws LdapException { Ava atav1 = new Ava( schemaManager, "cn", "b" ); Ava atav2 = new Ava( schemaManager, "cn", "b" ); assertTrue( atav1.equals( atav2 ) ); } /** * Compares two equals atavs but with a type in different case */ @Test public void testEqualsUpperCaseAT() throws LdapException { Ava atav1 = new Ava( schemaManager, "cn", "b" ); Ava atav2 = new Ava( schemaManager, "CN", "b" ); assertTrue( atav1.equals( atav2 ) ); } /** * Compares two equals atavs but with a type in different case */ @Test public void testEqualsSameValues() throws LdapException { Ava atav1 = new Ava( schemaManager, "cn", " B a" ); Ava atav2 = new Ava( schemaManager, "CN", "b a" ); assertTrue( atav1.equals( atav2 ) ); } /** * Test the returned values for Ava. \u00E4 is the unicode char for "ä", encoded * \C3\A4 in UTF8 */ @Test public void testAvaValuesNoSchema() throws LdapException { String errors = null; Ava ava = new Ava( "OU", "Exemple + Rdn\u00E4 " ); if ( !"ou=Exemple \\+ Rdn\u00E4\\ ".equals( ava.getNormName() ) ) { errors = "\nAva.getNormName fails '" + ava.getNormName() + "'"; } if ( !"ou".equals( ava.getNormType() ) ) { errors += "\nAva.getNormType fails '" + ava.getNormType() + "'"; } if ( !"Exemple + Rdn\u00E4 ".equals( ava.getValue().getNormValue().toString() ) ) { errors += "\nAva.getNormValue fails '" + ava.getValue().getNormValue().toString() + "'"; } if ( !"OU=Exemple \\+ Rdn\u00E4\\ ".equals( ava.getName() ) ) { errors += "\nAva.getUpName fails '" + ava.getName() + "'"; } if ( !"OU".equals( ava.getType() ) ) { errors += "\nAva.getUpType fails '" + ava.getType() + "'"; } if ( !"Exemple + Rdn\u00E4 ".equals( ava.getValue().getString() ) ) { errors += "\nAva.getUpValue fails '" + ava.getValue() .getString() + "'"; } if ( !"ou=Exemple \\+ Rdn\u00E4\\ ".equals( ava.normalize() ) ) { errors += "\nAva.normalize fails '" + ava.normalize() + "'"; } if ( !"OU=Exemple \\+ Rdn\u00E4\\ ".equals( ava.toString() ) ) { errors += "\nAva.toString fails '" + ava.toString() + "'"; } assertEquals( null, errors ); } /** * Test the returned values for a schema aware Ava. * \u00E4 is the unicode char for "ä", encoded \C3\A4 in UTF8 */ @Test public void testAvaValuesSchemaAware() throws LdapException { String errors = null; Ava ava = new Ava( schemaManager, "OU", "Exemple + Rdn\u002B " ); if ( !"2.5.4.11=exemple \\+ rdn\\+".equals( ava.getNormName() ) ) { errors = "\nAva.getNormName fails '" + ava.getNormName() + "'"; } if ( !"2.5.4.11".equals( ava.getNormType() ) ) { errors += "\nAva.getNormType fails '" + ava.getNormType() + "'"; } if ( !"exemple + rdn\u002B".equals( ava.getValue().getNormValue().toString() ) ) { errors += "\nAva.getNormValue fails '" + ava.getValue().getNormValue().toString() + "'"; } if ( !"OU=Exemple \\+ Rdn\\+\\ ".equals( ava.getName() ) ) { errors += "\nAva.getUpName fails '" + ava.getName() + "'"; } if ( !"OU".equals( ava.getType() ) ) { errors += "\nAva.getUpType fails '" + ava.getType() + "'"; } if ( !"Exemple + Rdn\u002B ".equals( ava.getValue().getString() ) ) { errors += "\nAva.getUpValue fails '" + ava.getValue().getString() + "'"; } if ( !"2.5.4.11=exemple \\+ rdn\\+".equals( ava.normalize() ) ) { errors += "\nAva.normalize fails '" + ava.normalize() + "'"; } if ( !"OU=Exemple \\+ Rdn\\+\\ ".equals( ava.toString() ) ) { errors += "\nAva.toString fails '" + ava.toString() + "'"; } assertEquals( null, errors ); } @Test public void testCompareToSameAva() throws LdapInvalidDnException { Ava atav1 = new Ava( schemaManager, "cn", "b" ); Ava atav2 = new Ava( schemaManager, "cn", "b" ); Ava atav3 = new Ava( schemaManager, "commonName", "b" ); Ava atav4 = new Ava( schemaManager, "2.5.4.3", " B " ); // 1 with others assertEquals( 0, atav1.compareTo( atav1 ) ); assertEquals( 0, atav1.compareTo( atav2 ) ); assertEquals( 0, atav1.compareTo( atav3 ) ); assertEquals( 0, atav1.compareTo( atav4 ) ); // 2 with others assertEquals( 0, atav2.compareTo( atav1 ) ); assertEquals( 0, atav2.compareTo( atav2 ) ); assertEquals( 0, atav2.compareTo( atav3 ) ); assertEquals( 0, atav2.compareTo( atav4 ) ); // 3 with others assertEquals( 0, atav3.compareTo( atav1 ) ); assertEquals( 0, atav3.compareTo( atav2 ) ); assertEquals( 0, atav3.compareTo( atav3 ) ); assertEquals( 0, atav3.compareTo( atav4 ) ); // 4 with others assertEquals( 0, atav4.compareTo( atav1 ) ); assertEquals( 0, atav4.compareTo( atav2 ) ); assertEquals( 0, atav4.compareTo( atav3 ) ); assertEquals( 0, atav4.compareTo( atav4 ) ); } @Test public void testCompareAvaOrder() throws LdapInvalidDnException { Ava atav1 = new Ava( schemaManager, "cn", " B " ); Ava atav2 = new Ava( schemaManager, "sn", " c" ); // atav1 should be before atav2 assertEquals( -1, atav1.compareTo( atav2 ) ); assertEquals( 1, atav2.compareTo( atav1 ) ); Ava atav3 = new Ava( schemaManager, "2.5.4.3", "A " ); // Atav1 shoud be after atav3 assertEquals( 1, atav1.compareTo( atav3 ) ); assertEquals( -1, atav3.compareTo( atav1 ) ); } @Test public void testSortAva() throws LdapInvalidDnException { Ava atav1 = new Ava( schemaManager, "cn", " B " ); Ava atav2 = new Ava( schemaManager, "sn", " c" ); Ava atav3 = new Ava( schemaManager, "2.5.4.3", "A " ); Ava atav4 = new Ava( schemaManager, "2.5.4.11", " C " ); Ava atav5 = new Ava( schemaManager, "ou", "B " ); Ava atav6 = new Ava( schemaManager, "ou", "D " ); Ava atav7 = new Ava( schemaManager, "CN", " " ); Ava[] avas = new Ava[] { atav1, atav2, atav3, atav4, atav5, atav6, atav7 }; Arrays.sort( avas ); assertEquals( atav5, avas[0] ); assertEquals( atav4, avas[1] ); assertEquals( atav6, avas[2] ); assertEquals( atav7, avas[3] ); assertEquals( atav3, avas[4] ); assertEquals( atav1, avas[5] ); assertEquals( atav2, avas[6] ); } } apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/DnTest.java0100644 0000767 0000024 00000263142 13114114302 034267 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.model.name; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.Arrays; import java.util.List; import javax.naming.InvalidNameException; import javax.naming.ldap.LdapName; 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.schema.SchemaManager; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.apache.directory.api.util.Strings; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Test the class Dn * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class DnTest { private static SchemaManager schemaManager; /** * Initialize OIDs maps for normalization */ @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); } // ------------------------------------------------------------------------------------ // CONSTRUCTOR functions -------------------------------------------------- /** * Test a null Dn */ @Test public void testDnNull() { Dn dn = new Dn(); assertEquals( "", dn.getName() ); assertEquals( "", dn.getNormName() ); assertTrue( dn.isEmpty() ); } /** * test an empty Dn */ @Test public void testDnEmpty() throws LdapException { Dn dn = new Dn( "" ); assertEquals( "", dn.getName() ); assertTrue( dn.isEmpty() ); } /** * test a simple Dn : a = b */ @Test public void testDnSimple() throws LdapException { Dn dn = new Dn( "a = b" ); assertTrue( Dn.isValid( "a = b" ) ); assertEquals( "a = b", dn.getName() ); assertEquals( "a=b", dn.getNormName() ); } /** * test a simple Dn with some spaces : "a = b " */ @Test public void testDnSimpleWithSpaces() throws LdapException { Dn dn = new Dn( "a = b " ); assertTrue( Dn.isValid( "a = b " ) ); assertEquals( "a = b ", dn.getName() ); assertEquals( "a=b", dn.getNormName() ); } /** * test a composite Dn : a = b, d = e */ @Test public void testDnComposite() throws LdapException { Dn dn = new Dn( "a = b, c = d" ); assertTrue( Dn.isValid( "a = b, c = d" ) ); assertEquals( "a=b,c=d", dn.getNormName() ); assertEquals( "a = b, c = d", dn.getName() ); } /** * test a composite Dn with spaces : a = b , d = e */ @Test public void testDnCompositeWithSpaces() throws LdapException { Dn dn = new Dn( "a = b , c = d" ); assertTrue( Dn.isValid( "a = b , c = d" ) ); assertEquals( "a=b,c=d", dn.getNormName() ); assertEquals( "a = b , c = d", dn.getName() ); } /** * test a composite Dn with or without spaces: a=b, a =b, a= b, a = b, a = b */ @Test public void testDnCompositeWithSpace() throws LdapException { Dn dn = new Dn( "a=b, a =b, a= b, a = b, a = b" ); assertTrue( Dn.isValid( "a=b, a =b, a= b, a = b, a = b" ) ); assertEquals( "a=b,a=b,a=b,a=b,a=b", dn.getNormName() ); assertEquals( "a=b, a =b, a= b, a = b, a = b", dn.getName() ); } /** * test a composite Dn with differents separators : a=b;c=d,e=f It should * return a=b,c=d,e=f (the ';' is replaced by a ',') */ @Test public void testDnCompositeSepators() throws LdapException { Dn dn = new Dn( "a=b;c=d,e=f" ); assertTrue( Dn.isValid( "a=b;c=d,e=f" ) ); assertEquals( "a=b,c=d,e=f", dn.getNormName() ); assertEquals( "a=b;c=d,e=f", dn.getName() ); } /** * test a simple Dn with multiple NameComponents : a = b + c = d */ @Test public void testDnSimpleMultivaluedAttribute() throws LdapException { Dn dn = new Dn( "a = b + c = d" ); assertTrue( Dn.isValid( "a = b + c = d" ) ); assertEquals( "a=b+c=d", dn.getNormName() ); assertEquals( "a = b + c = d", dn.getName() ); } /** * test a composite Dn with multiple NC and separators : a=b+c=d, e=f + g=h + * i=j */ @Test public void testDnCompositeMultivaluedAttribute() throws LdapException { Dn dn = new Dn( "a=b+c=d, e=f + g=h + i=j" ); assertTrue( Dn.isValid( "a=b+c=d, e=f + g=h + i=j" ) ); assertEquals( "a=b+c=d,e=f+g=h+i=j", dn.getNormName() ); assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getName() ); } /** * Test to see if a Dn with multiRdn values is preserved after an addAll. */ @Test public void testAddAllWithMultivaluedAttribute() throws LdapException { Dn dn = new Dn( "cn=Kate Bush+sn=Bush,ou=system" ); Dn target = new Dn(); assertTrue( Dn.isValid( "cn=Kate Bush+sn=Bush,ou=system" ) ); target = target.add( dn ); assertEquals( "cn=Kate Bush+sn=Bush,ou=system", target.toString() ); assertEquals( "cn=Kate Bush+sn=Bush,ou=system", target.getName() ); } /** * test a simple Dn with an oid prefix (uppercase) : OID.12.34.56 = azerty */ @Test public void testDnOidUpper() throws LdapException { Dn dn = new Dn( "OID.12.34.56 = azerty" ); assertTrue( Dn.isValid( "OID.12.34.56 = azerty" ) ); assertEquals( "oid.12.34.56=azerty", dn.getNormName() ); assertEquals( "OID.12.34.56 = azerty", dn.getName() ); } /** * test a simple Dn with an oid prefix (lowercase) : oid.12.34.56 = azerty */ @Test public void testDnOidLower() throws LdapException { Dn dn = new Dn( "oid.12.34.56 = azerty" ); assertTrue( Dn.isValid( "oid.12.34.56 = azerty" ) ); assertEquals( "oid.12.34.56=azerty", dn.getNormName() ); assertEquals( "oid.12.34.56 = azerty", dn.getName() ); } /** * test a simple Dn with an oid attribut without oid prefix : 12.34.56 = * azerty */ @Test public void testDnOidWithoutPrefix() throws LdapException { Dn dn = new Dn( "12.34.56 = azerty" ); assertTrue( Dn.isValid( "12.34.56 = azerty" ) ); assertEquals( "12.34.56=azerty", dn.getNormName() ); assertEquals( "12.34.56 = azerty", dn.getName() ); } /** * test a composite Dn with an oid attribut wiithout oid prefix : 12.34.56 = * azerty; 7.8 = test */ @Test public void testDnCompositeOidWithoutPrefix() throws LdapException { Dn dn = new Dn( "12.34.56 = azerty; 7.8 = test" ); assertTrue( Dn.isValid( "12.34.56 = azerty; 7.8 = test" ) ); assertEquals( "12.34.56=azerty,7.8=test", dn.getNormName() ); assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getName() ); } /** * test a simple Dn with pair char attribute value : a = \,\=\+\<\>\#\;\\\"\C4\8D" */ @Test public void testDnPairCharAttributeValue() throws LdapException { Dn dn = new Dn( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C4\\8D" ); assertTrue( Dn.isValid( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C4\\8D" ) ); assertEquals( "a=\\,\\=\\+\\<\\>#\\;\\\\\\\"\u010d", dn.getNormName() ); assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C4\\8D", dn.getName() ); } /** * test a simple Dn with pair char attribute value : "SN=Lu\C4\8Di\C4\87" */ @Test public void testDnRFC253_Lucic() throws LdapException { Dn dn = new Dn( "SN=Lu\\C4\\8Di\\C4\\87" ); assertTrue( Dn.isValid( "SN=Lu\\C4\\8Di\\C4\\87" ) ); assertEquals( "sn=Lu\u010di\u0107", dn.getNormName() ); assertEquals( "SN=Lu\\C4\\8Di\\C4\\87", dn.getName() ); } /** * test a simple Dn with hexString attribute value : a = #0010A0AAFF */ @Test public void testDnHexStringAttributeValue() throws LdapException { Dn dn = new Dn( "a = #0010A0AAFF" ); assertTrue( Dn.isValid( "a = #0010A0AAFF" ) ); assertEquals( "a=#0010A0AAFF", dn.getNormName() ); assertEquals( "a = #0010A0AAFF", dn.getName() ); } /** * Test for DIRSTUDIO-589, DIRSTUDIO-591, DIRSHARED-38 * * Check escaped sharp followed by a hex sequence * (without the ESC it would be a valid hexstring). */ @Test public void testDnEscSharpNumber() throws LdapException, LdapException { Dn dn = new Dn( "a = \\#123456" ); assertTrue( Dn.isValid( "a = \\#123456" ) ); assertEquals( "a=\\#123456", dn.getNormName() ); assertEquals( "a = \\#123456", dn.getName() ); Rdn rdn = dn.getRdn(); assertEquals( "a = \\#123456", rdn.getName() ); assertTrue( Dn.isValid( "a = \\#00" ) ); assertTrue( Dn.isValid( "a = \\#11" ) ); assertTrue( Dn.isValid( "a = \\#99" ) ); assertTrue( Dn.isValid( "a = \\#AA" ) ); assertTrue( Dn.isValid( "a = \\#FF" ) ); assertTrue( Dn.isValid( "uid=\\#123456" ) ); assertTrue( Dn.isValid( "cn=\\#ACL_AD-Projects_Author,ou=Notes_Group,o=Contacts,c=DE" ) ); assertTrue( Dn.isValid( "cn=\\#Abraham" ) ); } /** * Test for DIRSTUDIO-589, DIRSTUDIO-591, DIRSHARED-38 * * Check escaped sharp followed by a hex sequence * (without the ESC it would be a valid hexstring). */ @Test public void testDnEscValue() throws LdapException, LdapException { Dn dn = new Dn( "cn = Exa\\+mple one " ); assertTrue( Dn.isValid( "cn = Exa\\+mple one " ) ); assertEquals( "cn=Exa\\+mple one", dn.getNormName() ); assertEquals( "cn = Exa\\+mple one ", dn.getName() ); Dn dn2 = new Dn( schemaManager, "cn = Exa\\+mple one " ); assertEquals( "2.5.4.3=exa\\+mple one", dn2.getNormName() ); assertEquals( "cn = Exa\\+mple one ", dn2.getName() ); } /** * test a simple Dn with a # on first position */ @Test public void testDnSharpFirst() throws LdapException, LdapException { Dn dn = new Dn( "a = \\#this is a sharp" ); assertTrue( Dn.isValid( "a = \\#this is a sharp" ) ); assertEquals( "a=\\#this is a sharp", dn.getNormName() ); assertEquals( "a = \\#this is a sharp", dn.getName() ); Rdn rdn = dn.getRdn(); assertEquals( "a = \\#this is a sharp", rdn.getName() ); } /** * Normalize a simple Dn with a # on first position */ @Test public void testNormalizeDnSharpFirst() throws LdapException, LdapException { Dn dn = new Dn( "ou = \\#this is a sharp" ); assertTrue( Dn.isValid( "ou = \\#this is a sharp" ) ); assertEquals( "ou=\\#this is a sharp", dn.getNormName() ); assertEquals( "ou = \\#this is a sharp", dn.getName() ); // Check the normalization now Dn ndn = dn.apply( schemaManager ); assertEquals( "ou = \\#this is a sharp", ndn.getName() ); assertEquals( "2.5.4.11=\\#this is a sharp", ndn.getNormName() ); } /** * Normalize a Dn with sequence ESC ESC HEX HEX (\\C3\\A4). * This is a corner case for the parser and normalizer. */ @Test public void testNormalizeDnEscEscHexHexEscSpecial() throws LdapException { Dn dn = new Dn( "ou = AC\\\\C3\\2B" ); assertTrue( Dn.isValid( "ou = AC\\\\C3\\2B" ) ); assertEquals( "ou=AC\\\\C3\\+", dn.getNormName() ); assertEquals( "ou = AC\\\\C3\\2B", dn.getName() ); // Check the normalization now Dn ndn = dn.apply( schemaManager ); assertEquals( "ou = AC\\\\C3\\2B", ndn.getName() ); assertEquals( "2.5.4.11=ac\\\\c3\\+", ndn.getNormName() ); } /** * Normalize a Dn with sequence ESC ESC HEX HEX (\\DC). * This is a corner case for the parser and normalizer. */ @Test public void testNormalizeDnEscEscHexHex() throws LdapException { Dn dn = new Dn( "ou = AC\\\\DC" ); assertTrue( Dn.isValid( "ou = AC\\\\DC" ) ); assertEquals( "ou=AC\\\\DC", dn.getNormName() ); assertEquals( "ou = AC\\\\DC", dn.getName() ); // Check the normalization now Dn ndn = dn.apply( schemaManager ); assertEquals( "ou = AC\\\\DC", ndn.getName() ); assertEquals( "2.5.4.11=ac\\\\dc", ndn.getNormName() ); } /** * test a simple Dn with a wrong hexString attribute value : a = #0010Z0AAFF */ @Test public void testDnWrongHexStringAttributeValue() { try { new Dn( "a = #0010Z0AAFF" ); fail(); } catch ( LdapException ine ) { assertFalse( Dn.isValid( "a = #0010Z0AAFF" ) ); assertTrue( true ); } } /** * test a simple Dn with a wrong hexString attribute value : a = #AABBCCDD3 */ @Test public void testDnWrongHexStringAttributeValue2() { try { new Dn( "a = #AABBCCDD3" ); fail(); } catch ( LdapException ine ) { assertFalse( Dn.isValid( "a = #AABBCCDD3" ) ); assertTrue( true ); } } /** * test a simple Dn with a quote in attribute value : a = quoted \"value\" */ @Test public void testDnQuoteInAttributeValue() throws LdapException { Dn dn = new Dn( "a = quoted \\\"value\\\"" ); assertTrue( Dn.isValid( "a = quoted \\\"value\\\"" ) ); assertEquals( "a=quoted \\\"value\\\"", dn.getNormName() ); assertEquals( "a = quoted \\\"value\\\"", dn.getName() ); } /** * test a simple Dn with quoted attribute value : a = \" quoted value \" */ @Test public void testDnQuotedAttributeValue() throws LdapException { Dn dn = new Dn( "a = \\\" quoted value \\\"" ); assertTrue( Dn.isValid( "a = \\\" quoted value \\\"" ) ); assertEquals( "a=\\\" quoted value \\\"", dn.getNormName() ); assertEquals( "a = \\\" quoted value \\\"", dn.getName() ); } /** * test a simple Dn with a comma at the end */ @Test public void testDnComaAtEnd() { assertFalse( Dn.isValid( "a = b," ) ); assertFalse( Dn.isValid( "a = b, " ) ); try { new Dn( "a = b," ); fail(); } catch ( LdapException ine ) { assertTrue( true ); } } // REMOVE operation ------------------------------------------------------- /** * test a remove from position 0 * @Test public void testDnRemove0() throws LdapException { Dn dn = new Dn( "a=b, c=d, e=f" ); assertTrue( Dn.isValid("a=b, c=d, e=f") ); // now remove method returns a modified cloned Dn dn = dn.remove( 0 ); assertEquals( "a=b,c=d", dn.getNormName() ); assertEquals( "a=b, c=d", dn.getName() ); } /** * test a remove from position 1 * @Test public void testDnRemove1() throws LdapException { Dn dn = new Dn( "a=b, c=d, e=f" ); assertTrue( Dn.isValid("a=b, c=d, e=f") ); assertEquals( "a=b, c=d, e=f", dn.getName() ); } /** * test a remove from position 2 * @Test public void testDnRemove2() throws LdapException { Dn dn = new Dn( "a=b, c=d, e=f" ); assertTrue( Dn.isValid("a=b, c=d, e=f") ); dn = dn.remove( 2 ); assertEquals( " c=d, e=f", dn.getName() ); } /** * test a remove from position 1 whith semi colon * @Test public void testDnRemove1WithSemiColon() throws LdapException { Dn dn = new Dn( "a=b, c=d; e=f" ); assertTrue( Dn.isValid("a=b, c=d; e=f") ); dn = dn.remove( 1 ); assertEquals( "a=b, e=f", dn.getName() ); } /** * test a remove out of bound * @Test public void testDnRemoveOutOfBound() throws LdapException { Dn dn = new Dn( "a=b, c=d; e=f" ); assertTrue( Dn.isValid("a=b, c=d; e=f") ); try { dn.remove( 4 ); // We whould never reach this point fail(); } catch ( ArrayIndexOutOfBoundsException aoobe ) { assertTrue( true ); } } // SIZE operations /** * test a 0 size */ @Test public void testDnSize0() { Dn dn = new Dn(); assertTrue( Dn.isValid( "" ) ); assertEquals( 0, dn.size() ); } /** * test a 1 size */ @Test public void testDnSize1() throws LdapException { Dn dn = new Dn( "a=b" ); assertTrue( Dn.isValid( "a=b" ) ); assertEquals( 1, dn.size() ); } /** * test a 3 size */ @Test public void testDnSize3() throws LdapException { Dn dn = new Dn( "a=b, c=d, e=f" ); assertTrue( Dn.isValid( "a=b, c=d, e=f" ) ); assertEquals( 3, dn.size() ); } /** * test a 3 size with NameComponents */ @Test public void testDnSize3NC() throws LdapException { Dn dn = new Dn( "a=b+c=d, c=d, e=f" ); assertTrue( Dn.isValid( "a=b+c=d, c=d, e=f" ) ); assertEquals( 3, dn.size() ); } /** * test size after operations */ @Test public void testLdapResizing() throws LdapException { Dn dn = new Dn(); assertEquals( 0, dn.size() ); dn = dn.add( "e = f" ); assertEquals( 1, dn.size() ); dn = dn.add( "c = d" ); assertEquals( 2, dn.size() ); dn = dn.getParent(); assertEquals( 1, dn.size() ); dn = dn.getParent(); assertEquals( 0, dn.size() ); } // ADD Operations /** * test Add on a new Dn */ @Test public void testLdapEmptyAdd() throws LdapException { Dn dn = new Dn(); dn = dn.add( "e = f" ); assertEquals( "e=f", dn.getNormName() ); assertEquals( "e = f", dn.getName() ); assertEquals( 1, dn.size() ); } /** * test Add to an existing Dn */ @Test public void testDnAdd() throws LdapException { Dn dn = new Dn( "a=b, c=d" ); dn = dn.add( "e = f" ); assertEquals( "e=f,a=b,c=d", dn.getNormName() ); assertEquals( "e = f,a=b, c=d", dn.getName() ); assertEquals( 3, dn.size() ); } /** * test Add a composite Rdn to an existing Dn */ @Test public void testDnAddComposite() throws LdapException { Dn dn = new Dn( "a=b, c=d" ); dn = dn.add( "e = f + g = h" ); // Warning ! The order of AVAs has changed during the parsing // This has no impact on the correctness of the Dn, but the // String used to do the comparizon should be inverted. assertEquals( "e=f+g=h,a=b,c=d", dn.getNormName() ); assertEquals( 3, dn.size() ); } /** * test Add at the end of an existing Dn */ @Test public void testDnAddEnd() throws LdapException { Dn dn = new Dn( "a=b, c=d" ); dn = dn.add( "e = f" ); assertEquals( "e = f,a=b, c=d", dn.getName() ); assertEquals( 3, dn.size() ); } // ADD ALL Operations /** * Test AddAll * * @throws LdapException */ @Test public void testDnAddAll() throws LdapException { Dn dn = new Dn( "a = b" ); Dn dn2 = new Dn( "c = d" ); dn = dn.add( dn2 ); assertEquals( "c = d,a = b", dn.getName() ); } /** * Test AddAll with an empty added name * * @throws LdapException */ @Test public void testDnAddAllAddedNameEmpty() throws LdapException { Dn dn = new Dn( "a = b" ); Dn dn2 = new Dn(); dn = dn.add( dn2 ); assertEquals( "a=b", dn.getNormName() ); assertEquals( "a = b", dn.getName() ); } /** * Test AddAll to an empty name * * @throws LdapException */ @Test public void testDnAddAllNameEmpty() throws LdapException { Dn dn = new Dn(); Dn dn2 = new Dn( "a = b" ); dn = dn.add( dn2 ); assertEquals( "a = b", dn.getName() ); } /** * Test AddAll at position 0 * * @throws LdapException */ @Test public void testDnAt0AddAll() throws LdapException { Dn dn = new Dn( "a = b" ); Dn dn2 = new Dn( "c = d" ); dn = dn2.add( dn ); assertEquals( "a = b,c = d", dn.getName() ); } /** * Test AddAll at position 1 * * @throws LdapException */ @Test public void testDnAt1AddAll() throws LdapException { Dn dn = new Dn( "a = b" ); Dn dn2 = new Dn( "c = d" ); dn = dn.add( dn2 ); assertEquals( "c = d,a = b", dn.getName() ); } /** * Test AddAll with an empty added name at position 0 * * @throws LdapException */ @Test public void testDnAddAllAt0AddedNameEmpty() throws LdapException { Dn dn = new Dn( "a = b" ); Dn dn2 = new Dn(); dn = dn.add( dn2 ); assertEquals( "a=b", dn.getNormName() ); assertEquals( "a = b", dn.getName() ); } /** * Test AddAll to an empty name at position 0 * * @throws LdapException */ @Test public void testDnAddAllAt0NameEmpty() throws LdapException { Dn dn = new Dn(); Dn dn2 = new Dn( "a = b" ); dn = dn.add( dn2 ); assertEquals( "a = b", dn.getName() ); } // GET PREFIX actions /** * Get the prefix at pos 0 */ @Test public void testDnGetPrefixPos0() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); Dn newDn = ( dn.getAncestorOf( "" ) ); assertEquals( "a=b, c=d,e = f", newDn.getName() ); } /** * Get the prefix at pos 1 */ @Test public void testDnGetPrefixPos1() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); Dn newDn = ( dn.getAncestorOf( "a=b" ) ); assertEquals( " c=d,e = f", newDn.getName() ); } /** * Get the prefix at pos 2 */ @Test public void testDnGetPrefixPos2() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); Dn newDn = ( dn.getAncestorOf( "a=b, c=d" ) ); assertEquals( "e = f", newDn.getName() ); } /** * Get the prefix at pos 3 */ @Test public void testDnGetPrefixPos3() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); Dn newDn = ( dn.getAncestorOf( "a=b, c=d,e = f" ) ); assertEquals( "", newDn.getName() ); } /** * Get the prefix out of bound */ @Test(expected = LdapInvalidDnException.class) public void testDnGetPrefixPos4() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); dn.getAncestorOf( "a=z" ); } /** * Get the prefix of an empty LdapName */ @Test public void testDnGetPrefixEmptyDN() throws LdapInvalidDnException { Dn dn = new Dn(); Dn newDn = ( dn.getAncestorOf( "" ) ); assertEquals( "", newDn.getName() ); } // GET SUFFIX operations /** * Get the suffix at pos 0 */ @Test public void testDnGetSuffixPos0() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); Dn newDn = ( dn.getDescendantOf( "" ) ); assertEquals( "a=b, c=d,e = f", newDn.getName() ); } /** * Get the suffix at pos 1 */ @Test public void testDnGetSuffixPos1() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); Dn newDn = ( dn.getDescendantOf( "e=f" ) ); assertEquals( "a=b, c=d", newDn.getName() ); } /** * Get the suffix at pos 2 */ @Test public void testDnGetSuffixPos2() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); Dn newDn = ( dn.getDescendantOf( "c=d,e=f" ) ); assertEquals( "a=b", newDn.getName() ); } /** * Get the suffix at pos 3 */ @Test public void testDnGetSuffixPos3() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); Dn newDn = ( dn.getDescendantOf( "a=b, c=d, e=f" ) ); assertEquals( "", newDn.getName() ); } /** * Get the suffix out of bound */ @Test public void testDnGetSuffixPos4() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); try { dn.getDescendantOf( "i=j, a=b, c=d, e=f" ); // We should not reach this point. fail(); } catch ( ArrayIndexOutOfBoundsException aoobe ) { assertTrue( true ); } } /** * Get the suffix of an empty LdapName * @Test public void testDnGetSuffixEmptyDN() { Dn dn = new Dn(); Dn newDn = ( dn.getSuffix( 0 ) ); assertEquals( "", newDn.getName() ); } // IS EMPTY operations /** * Test that a Dn is empty */ @Test public void testDnIsEmpty() { Dn dn = new Dn(); assertEquals( true, dn.isEmpty() ); } /** * Test that a Dn is empty */ @Test public void testDnNotEmpty() throws LdapException { Dn dn = new Dn( "a=b" ); assertEquals( false, dn.isEmpty() ); } /** * Test that a Dn is empty * @Test public void testDnRemoveIsEmpty() throws LdapException { Dn dn = new Dn( "a=b, c=d" ); Dn clonedDn = dn.remove( 0 ); assertFalse( dn == clonedDn ); clonedDn = clonedDn.remove( 0 ); assertEquals( true, clonedDn.isEmpty() ); } // STARTS WITH operations /** * Test a startsWith a null Dn */ @Test public void testDnStartsWithNull() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); assertEquals( true, dn.isDescendantOf( ( Dn ) null ) ); } /** * Test a startsWith an empty Dn */ @Test public void testDnStartsWithEmpty() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); assertEquals( true, dn.isDescendantOf( new Dn() ) ); } /** * Test a startsWith an simple Dn */ @Test public void testDnStartsWithSimple() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); assertEquals( true, dn.isDescendantOf( new Dn( "e=f" ) ) ); } /** * Test a startsWith a complex Dn */ @Test public void testDnStartsWithComplex() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); assertEquals( true, dn.isDescendantOf( new Dn( "c = d, e = f" ) ) ); } /** * Test a startsWith a complex Dn */ @Test public void testDnStartsWithComplexMixedCase() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); assertEquals( false, dn.isDescendantOf( new Dn( "c = D, E = f" ) ) ); } /** * Test a startsWith a full Dn */ @Test public void testDnStartsWithFull() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); assertEquals( true, dn.isDescendantOf( new Dn( "a= b; c = d, e = f" ) ) ); } /** * Test a startsWith which returns false */ @Test public void testDnStartsWithWrong() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); assertEquals( false, dn.isDescendantOf( new Dn( "c = t, e = f" ) ) ); } // ENDS WITH operations /** * Test a endsWith a null Dn */ @Test public void testDnEndsWithNull() throws LdapException { Dn dn = new Dn( "a=b, c=d,e = f" ); assertEquals( true, dn.isDescendantOf( ( Dn ) null ) ); } @Test public void testAttributeEqualsIsCaseInSensitive() throws Exception { Dn name1 = new Dn( "cn=HomeDir" ); Dn name2 = new Dn( "CN=HomeDir" ); assertTrue( name1.equals( name2 ) ); } @Test public void testAttributeTypeEqualsIsCaseInsensitive() throws Exception { Dn name1 = new Dn( "cn=HomeDir+Sn=WorkDir" ); Dn name2 = new Dn( "cn=HomeDir+SN=WorkDir" ); assertTrue( name1.equals( name2 ) ); } @Test public void testNameEqualsIsInsensitiveToAttributesOrder() throws Exception { Dn name1 = new Dn( "cn=HomeDir+sn=WorkDir" ); Dn name2 = new Dn( "sn=WorkDir+cn=HomeDir" ); assertTrue( name1.equals( name2 ) ); } @Test public void testAttributeComparisonIsCaseInSensitive() throws Exception { Dn name1 = new Dn( "cn=HomeDir" ); Dn name2 = new Dn( "CN=HomeDir" ); assertEquals( name1, name2 ); } @Test public void testAttributeTypeComparisonIsCaseInsensitive() throws Exception { Dn name1 = new Dn( "cn=HomeDir+sn=WorkDir" ); Dn name2 = new Dn( "cn=HomeDir+SN=WorkDir" ); assertEquals( name1, name2 ); } @Test public void testNameComparisonIsInsensitiveToAttributesOrder() throws Exception { Dn name1 = new Dn( "cn=HomeDir+sn=WorkDir" ); Dn name2 = new Dn( "sn=WorkDir+cn=HomeDir" ); assertEquals( name1, name2 ); } @Test public void testNameComparisonIsInsensitiveToAttributesOrderFailure() throws Exception { Dn name1 = new Dn( "cn= HomeDir+sn=Workdir" ); Dn name2 = new Dn( "sn = Work+cn=HomeDir" ); assertNotSame( name1, name2 ); } /** * Test the encoding of a LdanDN */ @Test public void testNameToBytes() throws Exception { Dn dn = new Dn( "cn = John, ou = People, OU = Marketing" ); byte[] bytes = Dn.getBytes( dn ); assertEquals( 30, Dn.getNbBytes( dn ) ); assertEquals( "cn=John,ou=People,ou=Marketing", new String( bytes, "UTF-8" ) ); } @Test public void testStringParser() throws Exception { String dn = Strings.utf8ToString( new byte[] { 'C', 'N', ' ', '=', ' ', 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', ' ', 'L', ( byte ) 0xc3, ( byte ) 0xa9, 'c', 'h', 'a', 'r', 'n', 'y' } ); Dn name = new Dn( dn ); assertEquals( dn, ( name ).getName() ); assertEquals( "cn=Emmanuel L\u00e9charny", ( name ).getNormName() ); } /** * Class to test for void LdapName(String) * * @throws Exception * if anything goes wrong. */ @Test public void testLdapNameString() throws Exception { Dn name = new Dn( "" ); Dn name50 = new Dn(); assertEquals( name50, name ); Dn name0 = new Dn( "ou=Marketing,ou=East" ); Dn copy = new Dn( "ou=Marketing,ou=East" ); Dn name1 = new Dn( "cn=John,ou=Marketing,ou=East" ); Dn name2 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); Dn name3 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=West" ); Dn name4 = new Dn( "cn=Website,cn=John,ou=Marketing,ou=West" ); Dn name5 = new Dn( "cn=Airline,cn=John,ou=Marketing,ou=West" ); assertEquals( name0, copy ); assertTrue( name0.isAncestorOf( name1 ) ); assertTrue( name0.isAncestorOf( name2 ) ); assertTrue( name1.isAncestorOf( name2 ) ); assertTrue( name2.isDescendantOf( name1 ) ); assertTrue( name2.isDescendantOf( name0 ) ); assertNotSame( name2, name3 ); assertNotSame( name2, name4 ); assertNotSame( name3, name4 ); assertNotSame( name3, name5 ); assertNotSame( name4, name5 ); assertNotSame( name2, name5 ); } /** * Class to test for void LdapName() */ @Test public void testLdapName() { Dn name = new Dn(); assertTrue( name.toString().equals( "" ) ); } /** * Class to test for Object clone() * * @throws Exception * if anything goes wrong. * @Test public void testClone() throws Exception { String strName = "cn=HomeDir,cn=John,ou=Marketing,ou=East"; Dn name = new Dn( strName ); assertEquals( name, name.clone() ); } /** * Class to test for size * * @throws Exception * if anything goes wrong. */ @Test public void testSize() throws Exception { Dn name0 = new Dn( "" ); Dn name1 = new Dn( "ou=East" ); Dn name2 = new Dn( "ou=Marketing,ou=East" ); Dn name3 = new Dn( "cn=John,ou=Marketing,ou=East" ); Dn name4 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); Dn name5 = new Dn( "cn=Website,cn=HomeDir,cn=John,ou=Marketing,ou=West" ); Dn name6 = new Dn( "cn=Airline,cn=Website,cn=HomeDir,cn=John,ou=Marketing,ou=West" ); assertEquals( 0, name0.size() ); assertEquals( 1, name1.size() ); assertEquals( 2, name2.size() ); assertEquals( 3, name3.size() ); assertEquals( 4, name4.size() ); assertEquals( 5, name5.size() ); assertEquals( 6, name6.size() ); } /** * Class to test for isEmpty * * @throws Exception * if anything goes wrong. */ @Test public void testIsEmpty() throws Exception { Dn name0 = new Dn( "" ); Dn name1 = new Dn( "ou=East" ); Dn name2 = new Dn( "ou=Marketing,ou=East" ); Dn name3 = new Dn( "cn=John,ou=Marketing,ou=East" ); Dn name4 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); Dn name5 = new Dn( "cn=Website,cn=HomeDir,cn=John,ou=Marketing,ou=West" ); Dn name6 = new Dn( "cn=Airline,cn=Website,cn=HomeDir,cn=John,ou=Marketing,ou=West" ); assertEquals( true, name0.isEmpty() ); assertEquals( false, name1.isEmpty() ); assertEquals( false, name2.isEmpty() ); assertEquals( false, name3.isEmpty() ); assertEquals( false, name4.isEmpty() ); assertEquals( false, name5.isEmpty() ); assertEquals( false, name6.isEmpty() ); } /** * Class to test for getAll * * @throws Exception * if anything goes wrong. * @Test public void testGetAll() throws Exception { Dn name0 = new Dn( "" ); Dn name1 = new Dn( "ou=East" ); Dn name2 = new Dn( "ou=Marketing,ou=East" ); Dn name3 = new Dn( "cn=John,ou=Marketing,ou=East" ); Dn name4 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); Dn name5 = new Dn( "cn=Website,cn=HomeDir,cn=John,ou=Marketing,ou=West" ); Dn name6 = new Dn( "cn=Airline,cn=Website,cn=HomeDir,cn=John,ou=Marketing,ou=West" ); Enumeration enum0 = name0.getAll(); assertEquals( false, enum0.hasMoreElements() ); Enumeration enum1 = name1.getAll(); assertEquals( true, enum1.hasMoreElements() ); for ( int i = 0; enum1.hasMoreElements(); i++ ) { String element = ( String ) enum1.nextElement(); if ( i == 0 ) { assertEquals( "ou=East", element ); } } Enumeration enum2 = name2.getAll(); assertEquals( true, enum2.hasMoreElements() ); for ( int i = 0; enum2.hasMoreElements(); i++ ) { String element = ( String ) enum2.nextElement(); if ( i == 0 ) { assertEquals( "ou=East", element ); } if ( i == 1 ) { assertEquals( "ou=Marketing", element ); } } Enumeration enum3 = name3.getAll(); assertEquals( true, enum3.hasMoreElements() ); for ( int i = 0; enum3.hasMoreElements(); i++ ) { String element = ( String ) enum3.nextElement(); if ( i == 0 ) { assertEquals( "ou=East", element ); } if ( i == 1 ) { assertEquals( "ou=Marketing", element ); } if ( i == 2 ) { assertEquals( "cn=John", element ); } } Enumeration enum4 = name4.getAll(); assertEquals( true, enum4.hasMoreElements() ); for ( int i = 0; enum4.hasMoreElements(); i++ ) { String element = ( String ) enum4.nextElement(); if ( i == 0 ) { assertEquals( "ou=East", element ); } if ( i == 1 ) { assertEquals( "ou=Marketing", element ); } if ( i == 2 ) { assertEquals( "cn=John", element ); } if ( i == 3 ) { assertEquals( "cn=HomeDir", element ); } } Enumeration enum5 = name5.getAll(); assertEquals( true, enum5.hasMoreElements() ); for ( int i = 0; enum5.hasMoreElements(); i++ ) { String element = ( String ) enum5.nextElement(); if ( i == 0 ) { assertEquals( "ou=West", element ); } if ( i == 1 ) { assertEquals( "ou=Marketing", element ); } if ( i == 2 ) { assertEquals( "cn=John", element ); } if ( i == 3 ) { assertEquals( "cn=HomeDir", element ); } if ( i == 4 ) { assertEquals( "cn=Website", element ); } } Enumeration enum6 = name6.getAll(); assertEquals( true, enum6.hasMoreElements() ); for ( int i = 0; enum6.hasMoreElements(); i++ ) { String element = ( String ) enum6.nextElement(); if ( i == 0 ) { assertEquals( "ou=West", element ); } if ( i == 1 ) { assertEquals( "ou=Marketing", element ); } if ( i == 2 ) { assertEquals( "cn=John", element ); } if ( i == 3 ) { assertEquals( "cn=HomeDir", element ); } if ( i == 4 ) { assertEquals( "cn=Website", element ); } if ( i == 5 ) { assertEquals( "cn=Airline", element ); } } } /** * Class to test for getAllRdn * * @throws Exception * if anything goes wrong. */ @Test public void testIterator() throws Exception { Dn dn = new Dn( "cn=Airline,cn=Website,cn=HomeDir,cn=John,ou=Marketing,ou=West" ); String[] expected = new String[] { "ou=West", "ou=Marketing", "cn=John", "cn=HomeDir", "cn=Website", "cn=Airline" }; int count = 0; for ( Rdn rdn : dn ) { assertEquals( expected[count], rdn.toString() ); count++; } } /** * Test the getRdn( int ) method */ @Test public void testGetRdn() throws Exception { Dn name = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); assertEquals( "cn=HomeDir", name.getRdn( 0 ).getName() ); assertEquals( "cn=John", name.getRdn( 1 ).getName() ); assertEquals( "ou=Marketing", name.getRdn( 2 ).getName() ); assertEquals( "ou=East", name.getRdn( 3 ).getName() ); } /** * Test the getRdns() method */ @Test public void testGetRdns() throws Exception { Dn dn = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); String[] expected = new String[] { "cn=HomeDir", "cn=John", "ou=Marketing", "ou=East" }; int i = 0; for ( Rdn rdn : dn.getRdns() ) { assertEquals( expected[i], rdn.getName() ); i++; } } /** * Class to test for getSuffix * * @throws Exception * anything goes wrong */ @Test public void testGetXSuffix() throws Exception { Dn name = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); assertEquals( "", name.getDescendantOf( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ).toString() ); assertEquals( "cn=HomeDir", name.getDescendantOf( "cn=John,ou=Marketing,ou=East" ).toString() ); assertEquals( "cn=HomeDir,cn=John", name.getDescendantOf( "ou=Marketing,ou=East" ).toString() ); assertEquals( "cn=HomeDir,cn=John,ou=Marketing", name.getDescendantOf( "ou=East" ).toString() ); assertEquals( "cn=HomeDir,cn=John,ou=Marketing,ou=East", name.getDescendantOf( "" ).toString() ); } /** * Class to test for getPrefix * * @throws Exception * anything goes wrong */ @Test public void testGetPrefix() throws Exception { Dn name = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); assertEquals( "cn=HomeDir,cn=John,ou=Marketing,ou=East", name.getAncestorOf( "" ).toString() ); assertEquals( "cn=John,ou=Marketing,ou=East", name.getAncestorOf( "cn=HomeDir" ).toString() ); assertEquals( "ou=Marketing,ou=East", name.getAncestorOf( "cn=HomeDir,cn=John" ).toString() ); assertEquals( "ou=East", name.getAncestorOf( "cn=HomeDir,cn=John,ou=Marketing" ).toString() ); assertEquals( "", name.getAncestorOf( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ).toString() ); } /** * Class to test for startsWith * * @throws Exception * anything goes wrong */ @Test public void testStartsWith() throws Exception { Dn n0 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); Dn n1 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); Dn n2 = new Dn( "cn=John,ou=Marketing,ou=East" ); Dn n3 = new Dn( "ou=Marketing,ou=East" ); Dn n4 = new Dn( "ou=East" ); Dn n5 = new Dn( "" ); Dn n6 = new Dn( "cn=HomeDir" ); Dn n7 = new Dn( "cn=HomeDir,cn=John" ); Dn n8 = new Dn( "cn=HomeDir,cn=John,ou=Marketing" ); // Check with Dn assertTrue( n0.isDescendantOf( n1 ) ); assertTrue( n0.isDescendantOf( n2 ) ); assertTrue( n0.isDescendantOf( n3 ) ); assertTrue( n0.isDescendantOf( n4 ) ); assertTrue( n0.isDescendantOf( n5 ) ); assertTrue( !n0.isDescendantOf( n6 ) ); assertTrue( !n0.isDescendantOf( n7 ) ); assertTrue( !n0.isDescendantOf( n8 ) ); Dn nn0 = new Dn( "cn=zero" ); Dn nn10 = new Dn( "cn=one,cn=zero" ); Dn nn210 = new Dn( "cn=two,cn=one,cn=zero" ); Dn nn3210 = new Dn( "cn=three,cn=two,cn=one,cn=zero" ); assertTrue( nn0.isDescendantOf( nn0 ) ); assertTrue( nn10.isDescendantOf( nn0 ) ); assertTrue( nn210.isDescendantOf( nn0 ) ); assertTrue( nn3210.isDescendantOf( nn0 ) ); assertTrue( nn10.isDescendantOf( nn10 ) ); assertTrue( nn210.isDescendantOf( nn10 ) ); assertTrue( nn3210.isDescendantOf( nn10 ) ); assertTrue( nn210.isDescendantOf( nn210 ) ); assertTrue( nn3210.isDescendantOf( nn210 ) ); assertTrue( nn3210.isDescendantOf( nn3210 ) ); assertTrue( "Starting Dn fails with ADS Dn", new Dn( "ou=foo,dc=apache,dc=org" ).isDescendantOf( new Dn( "dc=apache,dc=org" ) ) ); assertTrue( "Starting Dn fails with Java LdapName", new Dn( "ou=foo,dc=apache,dc=org" ).isDescendantOf( new Dn( "dc=apache,dc=org" ) ) ); assertTrue( "Starting Dn fails with Java LdapName", new Dn( "dc=apache,dc=org" ).isDescendantOf( new Dn( "dc=apache,dc=org" ) ) ); } /** * Class to test for Dn addAll(Dn) * * @throws Exception * when anything goes wrong */ @Test public void testAddAllName0() throws Exception { Dn name = new Dn(); Dn name0 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); assertTrue( name0.equals( name.add( name0 ) ) ); } /** * Class to test for Dn addAll(Dn) * * @throws Exception * when anything goes wrong */ @Test public void testAddAllNameExisting0() throws Exception { Dn name1 = new Dn( "ou=Marketing,ou=East" ); Dn name2 = new Dn( "cn=HomeDir,cn=John" ); Dn nameAdded = new Dn( "cn=HomeDir,cn=John, ou=Marketing,ou=East" ); assertTrue( nameAdded.equals( name1.add( name2 ) ) ); } /** * Class to test for Dn addAll(Dn) * * @throws Exception * when anything goes wrong */ @Test public void testAddAllName1() throws Exception { Dn name = new Dn(); Dn name0 = new Dn( "ou=Marketing,ou=East" ); Dn name1 = new Dn( "cn=HomeDir,cn=John" ); Dn name2 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); name = name.add( name0 ); assertTrue( name0.equals( name ) ); assertTrue( name2.equals( name.add( name1 ) ) ); } /** * Class to test for Dn addAll(int, Dn) * * @throws Exception * when something goes wrong */ @Test public void testAddAllintName0() throws Exception { Dn name = new Dn(); Dn name0 = new Dn( "ou=Marketing,ou=East" ); Dn name1 = new Dn( "cn=HomeDir,cn=John" ); Dn name2 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); name = name.add( name0 ); assertTrue( name0.equals( name ) ); assertTrue( name2.equals( name.add( name1 ) ) ); } /** * Class to test for Dn add(String) * * @throws Exception when something goes wrong */ @Test public void testAddString() throws Exception { Dn name = new Dn( schemaManager ); assertEquals( name, new Dn( "" ) ); Dn name4 = new Dn( schemaManager, "ou=East" ); assertTrue( name.isSchemaAware() ); name = name.add( "ou=East" ); assertTrue( name.isSchemaAware() ); assertEquals( name4, name ); Dn name3 = new Dn( schemaManager, "ou=Marketing,ou=East" ); name = name.add( "ou=Marketing" ); assertEquals( name3, name ); Dn name2 = new Dn( schemaManager, "cn=John,ou=Marketing,ou=East" ); name = name.add( "cn=John" ); assertEquals( name2, name ); Dn name0 = new Dn( schemaManager, "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); name = name.add( "cn=HomeDir" ); assertEquals( name0, name ); } /** * Class to test for Name add(int, String) * * @throws Exception * if anything goes wrong */ @Test public void testAddintString() throws Exception { Dn name = new Dn(); assertEquals( name, new Dn( "" ) ); Dn name4 = new Dn( "ou=East" ); name = name.add( "ou=East" ); assertEquals( name4, name ); Dn name3 = new Dn( "ou=Marketing,ou=East" ); name = name.add( "ou=Marketing" ); assertEquals( name3, name ); Dn name2 = new Dn( "cn=John,ou=Marketing,ou=East" ); name = name.add( "cn=John" ); assertEquals( name2, name ); Dn name0 = new Dn( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ); name = name.add( "cn=HomeDir" ); assertEquals( name0, name ); } /** * Class to test for String toString() * * @throws Exception if anything goes wrong */ @Test public void testToString() throws Exception { Dn name = new Dn(); assertEquals( "", name.toString() ); name = name.add( "ou=East" ); assertEquals( "ou=East", name.toString() ); name = name.add( "ou=Marketing" ); assertEquals( "ou=Marketing,ou=East", name.toString() ); name = name.add( "cn=John" ); assertEquals( "cn=John,ou=Marketing,ou=East", name.toString() ); name = name.add( "cn=HomeDir" ); assertEquals( "cn=HomeDir,cn=John,ou=Marketing,ou=East", name.toString() ); } /** * Tests getParent(). */ @Test public void testGetParent() throws Exception { Dn empty = new Dn(); assertEquals( Dn.EMPTY_DN, empty.getParent() ); Dn one = new Dn( "cn=test" ); assertNotNull( one.getParent() ); assertTrue( one.getParent().isEmpty() ); Dn two = new Dn( "cn=test,o=acme" ); assertNotNull( two.getParent() ); assertFalse( two.getParent().isSchemaAware() ); assertFalse( two.getParent().isEmpty() ); assertEquals( "o=acme", two.getParent().getName() ); Dn three = new Dn( "cn=test,dc=example,dc=com" ); three.apply( schemaManager ); Dn threeParent = three.getParent(); assertNotNull( threeParent ); assertTrue( threeParent.isSchemaAware() ); assertFalse( threeParent.isEmpty() ); assertEquals( "dc=example,dc=com", threeParent.getName() ); assertEquals( 2, threeParent.getRdns().size() ); Dn five = new Dn( "uid=user1,ou=sales,ou=users,dc=example,dc=com" ); Dn fiveParent = five.getParent(); assertNotNull( fiveParent ); assertFalse( fiveParent.isSchemaAware() ); assertFalse( fiveParent.isEmpty() ); assertEquals( "ou=sales,ou=users,dc=example,dc=com", fiveParent.getName() ); assertEquals( 4, fiveParent.getRdns().size() ); } /** * Class to test for boolean equals(Object) * * @throws Exception * if anything goes wrong */ @Test public void testEqualsObject() throws Exception { assertTrue( new Dn( "ou=People" ).equals( new Dn( "ou=People" ) ) ); assertTrue( !new Dn( "ou=People,dc=example,dc=com" ).equals( new Dn( "ou=People" ) ) ); assertTrue( !new Dn( "ou=people" ).equals( new Dn( "ou=People" ) ) ); assertTrue( !new Dn( "ou=Groups" ).equals( new Dn( "ou=People" ) ) ); } @Test public void testNameFrenchChars() throws Exception { String cn = new String( new byte[] { 'c', 'n', '=', 0x4A, ( byte ) 0xC3, ( byte ) 0xA9, 0x72, ( byte ) 0xC3, ( byte ) 0xB4, 0x6D, 0x65 }, "UTF-8" ); Dn name = new Dn( cn ); assertEquals( "cn=J\u00e9r\u00f4me", name.toString() ); } @Test public void testNameGermanChars() throws Exception { String cn = new String( new byte[] { 'c', 'n', '=', ( byte ) 0xC3, ( byte ) 0x84, ( byte ) 0xC3, ( byte ) 0x96, ( byte ) 0xC3, ( byte ) 0x9C, ( byte ) 0xC3, ( byte ) 0x9F, ( byte ) 0xC3, ( byte ) 0xA4, ( byte ) 0xC3, ( byte ) 0xB6, ( byte ) 0xC3, ( byte ) 0xBC }, "UTF-8" ); Dn name = new Dn( cn ); assertEquals( "cn=\u00C4\u00D6\u00DC\u00DF\u00E4\u00F6\u00FC", name.toString() ); } @Test public void testNameTurkishChars() throws Exception { String cn = new String( new byte[] { 'c', 'n', '=', ( byte ) 0xC4, ( byte ) 0xB0, ( byte ) 0xC4, ( byte ) 0xB1, ( byte ) 0xC5, ( byte ) 0x9E, ( byte ) 0xC5, ( byte ) 0x9F, ( byte ) 0xC3, ( byte ) 0x96, ( byte ) 0xC3, ( byte ) 0xB6, ( byte ) 0xC3, ( byte ) 0x9C, ( byte ) 0xC3, ( byte ) 0xBC, ( byte ) 0xC4, ( byte ) 0x9E, ( byte ) 0xC4, ( byte ) 0x9F }, "UTF-8" ); Dn name = new Dn( cn ); assertEquals( "cn=\u0130\u0131\u015E\u015F\u00D6\u00F6\u00DC\u00FC\u011E\u011F", name.toString() ); } /** * Class to test for toOid( Dn, Map) */ @Test public void testLdapNameToName() throws Exception { Dn name = new Dn( "ou= Some People ", "dc = eXample", "dc= cOm" ); assertTrue( name.getName().equals( "ou= Some People ,dc = eXample,dc= cOm" ) ); Dn result = name.apply( schemaManager ); assertEquals( "2.5.4.11=some people,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com", result.getNormName() ); } @Test public void testRdnGetTypeUpName() throws Exception { Dn name = new Dn( "ou= Some People ", "dc = eXample", "dc= cOm" ); assertTrue( name.getName().equals( "ou= Some People ,dc = eXample,dc= cOm" ) ); Rdn rdn = name.getRdn(); assertEquals( "ou= Some People ", rdn.getName() ); assertEquals( "ou", rdn.getNormType() ); assertEquals( "ou", rdn.getType() ); Dn result = name.apply( schemaManager ); assertTrue( result.getNormName().equals( "2.5.4.11=some people,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com" ) ); assertTrue( name.getName().equals( "ou= Some People ,dc = eXample,dc= cOm" ) ); Rdn rdn2 = result.getRdn(); assertEquals( "ou= Some People ", rdn2.getName() ); assertEquals( "2.5.4.11", rdn2.getNormType() ); assertEquals( "ou", rdn2.getType() ); } /** * Class to test for toOid( Dn, Map) with a NULL dn */ @Test public void testLdapNameToNameEmpty() throws Exception { Dn name = new Dn(); Dn result = name.apply( schemaManager ); assertTrue( result.toString().equals( "" ) ); } /** * Class to test for toOid( Dn, Map) with a multiple NameComponent */ @Test public void testLdapNameToNameMultiNC() throws Exception { Dn name = new Dn( "2.5.4.11= Some People + 0.9.2342.19200300.100.1.25= And Some anImAls,0.9.2342.19200300.100.1.25 = eXample,dc= cOm" ); Dn result = name.apply( schemaManager ); assertEquals( ( result ).getNormName(), "0.9.2342.19200300.100.1.25=and some animals+2.5.4.11=some people,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com" ); assertTrue( ( result ) .getName() .equals( "2.5.4.11= Some People + 0.9.2342.19200300.100.1.25= And Some anImAls,0.9.2342.19200300.100.1.25 = eXample,dc= cOm" ) ); } /** * Class to test for toOid( Dn, Map) with a multiple NameComponent */ @Test public void testLdapNameToNameAliasMultiNC() throws Exception { Dn name = new Dn( "2.5.4.11= Some People + domainComponent= And Some anImAls,DomainComponent = eXample,0.9.2342.19200300.100.1.25= cOm" ); Dn result = name.apply( schemaManager ); assertTrue( result .getNormName() .equals( "0.9.2342.19200300.100.1.25=and some animals+2.5.4.11=some people,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com" ) ); assertTrue( result .getName() .equals( "2.5.4.11= Some People + domainComponent= And Some anImAls,DomainComponent = eXample,0.9.2342.19200300.100.1.25= cOm" ) ); } /** * Class to test for hashCode(). */ @Test public void testLdapNameHashCode() throws Exception { Dn name1 = new Dn( schemaManager, "2.5.4.11= Some People + domainComponent= And Some anImAls,DomainComponent = eXample,0.9.2342.19200300.100.1.25= cOm" ); Dn name2 = new Dn( schemaManager, "2.5.4.11=some people+domainComponent=and some animals,DomainComponent=example,0.9.2342.19200300.100.1.25=com" ); assertEquals( name1.hashCode(), name2.hashCode() ); } /** * Test for DIRSERVER-191 */ @Test public void testName() throws LdapException, InvalidNameException { LdapName jName = new javax.naming.ldap.LdapName( "cn=four,cn=three,cn=two,cn=one" ); Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" ); assertEquals( jName.toString(), "cn=four,cn=three,cn=two,cn=one" ); assertEquals( aName.toString(), "cn=four,cn=three,cn=two,cn=one" ); assertEquals( jName.toString(), aName.toString() ); } /** * Test for DIRSERVER-191 */ @Test public void testGetPrefixName() throws LdapException, InvalidNameException { LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" ); Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" ); assertEquals( jName.getPrefix( 0 ).toString(), aName.getAncestorOf( "cn=four,cn=three,cn=two,cn=one" ) .toString() ); assertEquals( jName.getPrefix( 1 ).toString(), aName.getAncestorOf( "cn=four,cn=three,cn=two" ).toString() ); assertEquals( jName.getPrefix( 2 ).toString(), aName.getAncestorOf( "cn=four,cn=three" ).toString() ); assertEquals( jName.getPrefix( 3 ).toString(), aName.getAncestorOf( "cn=four" ).toString() ); assertEquals( jName.getPrefix( 4 ).toString(), aName.getAncestorOf( "" ).toString() ); } /** * Test for DIRSERVER-191 */ @Test public void testGetSuffix() throws LdapException, InvalidNameException { LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" ); Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" ); assertEquals( jName.getSuffix( 0 ).toString(), aName.getDescendantOf( "" ).toString() ); assertEquals( jName.getSuffix( 1 ).toString(), aName.getDescendantOf( "cn=one" ).toString() ); assertEquals( jName.getSuffix( 2 ).toString(), aName.getDescendantOf( "cn=two,cn=one" ).toString() ); assertEquals( jName.getSuffix( 3 ).toString(), aName.getDescendantOf( "cn=three,cn=two,cn=one" ).toString() ); assertEquals( jName.getSuffix( 4 ).toString(), aName.getDescendantOf( "cn=four,cn=three,cn=two,cn=one" ) .toString() ); } /** * Test for DIRSERVER-191. The Dn is immutable, thus we can't add a new Rdn * to a Dn, it simply creates a new one. */ @Test public void testAddStringName() throws LdapException, InvalidNameException { LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" ); Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" ); assertSame( jName, jName.add( "cn=five" ) ); assertNotSame( aName, aName.add( "cn=five" ) ); assertNotSame( jName.toString(), aName.toString() ); } /** * Test for DIRSERVER-191 */ @Test public void testAddAllName() throws LdapException, InvalidNameException { LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" ); Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" ); assertSame( jName, jName.addAll( new LdapName( "cn=seven,cn=six" ) ) ); assertNotSame( aName, aName.add( new Dn( "cn=seven,cn=six" ) ) ); assertNotSame( jName.toString(), aName.toString() ); } /** * Test for DIRSERVER-191 */ @Test public void testAddAllIntName() throws LdapException, InvalidNameException { LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" ); Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" ); assertSame( jName, jName.addAll( 0, new LdapName( "cn=zero,cn=zero.5" ) ) ); assertNotSame( aName, aName.add( new Dn( "cn=zero,cn=zero.5" ) ) ); assertNotSame( jName.toString(), aName.toString() ); assertSame( jName, jName.addAll( 2, new LdapName( "cn=zero,cn=zero.5" ) ) ); assertNotSame( aName, aName.add( new Dn( "cn=zero,cn=zero.5" ) ) ); assertNotSame( jName.toString(), aName.toString() ); assertSame( jName, jName.addAll( jName.size(), new LdapName( "cn=zero,cn=zero.5" ) ) ); assertNotSame( aName, aName.add( new Dn( "cn=zero,cn=zero.5" ) ) ); assertNotSame( jName.toString(), aName.toString() ); } /** * Test for DIRSERVER-191 */ @Test public void testStartsWithName() throws LdapException, InvalidNameException { LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" ); Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" ); assertEquals( jName.startsWith( new LdapName( "cn=seven,cn=six,cn=five" ) ), aName.isDescendantOf( new Dn( "cn=seven,cn=six,cn=five" ) ) ); assertEquals( jName.startsWith( new LdapName( "cn=three,cn=two,cn=one" ) ), aName.isDescendantOf( new Dn( "cn=three,cn=two,cn=one" ) ) ); } /** * Test for DIRSERVER-191 * @Test public void testRemoveName() throws LdapException, InvalidNameException { LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" ); Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" ); jName.remove( 0 ); assertEquals( jName.toString(), aName.remove( 0 ).toString() ); assertNotSame( jName.toString(), aName.toString() ); jName.remove( jName.size() - 1 ); assertEquals( jName.toString(), aName.getParent().remove( 0 ).toString() ); assertNotSame( jName.toString(), aName.toString() ); } /** * Test for DIRSERVER-642 * @throws LdapException */ @Test public void testDoubleQuoteInNameDIRSERVER_642() throws LdapException, LdapException { Dn name1 = new Dn( "cn=\"Kylie Minogue\",dc=example,dc=com" ); String[] expected = new String[] { "cn=\"Kylie Minogue\"", "dc=example", "dc=com" }; List j = name1.getRdns(); int count = 0; for ( Rdn rdn : j ) { assertEquals( expected[count], rdn.getName() ); count++; } } /** * Test for DIRSERVER-642 * @throws LdapException */ @Test public void testDoubleQuoteInNameDIRSERVER_642_1() throws LdapException { Dn dn = new Dn( "cn=\" Kylie Minogue \",dc=example,dc=com" ); assertEquals( "cn=\" Kylie Minogue \",dc=example,dc=com", dn.getName() ); assertEquals( "cn=\\ Kylie Minogue\\ ,dc=example,dc=com", dn.getNormName() ); } /** * Test for DIRSTUDIO-250 * @throws LdapException */ @Test public void testDoubleQuoteWithSpecialCharsInNameDIRSERVER_250() throws LdapException { Dn dn = new Dn( "a=\"b,c\"" ); assertEquals( "a=\"b,c\"", dn.getName() ); assertEquals( "a=b\\,c", dn.getNormName() ); } /** * Test for DIRSERVER-184 * @throws LdapException */ @Test public void testLeadingAndTrailingSpacesDIRSERVER_184() throws LdapException { Dn name = new Dn( "dn= \\ four spaces leading and 3 trailing \\ " ); assertEquals( "dn=\\ four spaces leading and 3 trailing \\ ", name.getNormName() ); assertEquals( "dn= \\ four spaces leading and 3 trailing \\ ", name.getName() ); } /** * Test for DIRSERVER-184 * @throws LdapException */ @Test public void testDIRSERVER_184_1() { try { new Dn( "dn=middle\\ spaces" ); } catch ( LdapException ine ) { assertTrue( true ); } } /** * Test for DIRSERVER-184 * @throws LdapException */ @Test public void testDIRSERVER_184_2() { try { new Dn( "dn=# a leading pound" ); } catch ( LdapException ine ) { assertTrue( true ); } } /** * Test for DIRSERVER-184 * @throws LdapException */ @Test public void testDIRSERVER_184_3() throws LdapException { Dn name = new Dn( "dn=\\# a leading pound" ); assertEquals( "dn=\\# a leading pound", name.toString() ); assertEquals( "dn=\\# a leading pound", name.getName() ); } /** * Test for DIRSERVER-184 * @throws LdapException */ @Test public void testDIRSERVER_184_4() throws LdapException { Dn name = new Dn( "dn=a middle \\# pound" ); assertEquals( "dn=a middle # pound", name.getNormName() ); assertEquals( "dn=a middle \\# pound", name.getName() ); } /** * Test for DIRSERVER-184 * @throws LdapException */ @Test public void testDIRSERVER_184_5() throws LdapException { Dn name = new Dn( "dn=a trailing pound \\#" ); assertEquals( "dn=a trailing pound #", name.getNormName() ); assertEquals( "dn=a trailing pound \\#", name.getName() ); } /** * Test for DIRSERVER-184 * @throws LdapException */ @Test public void testDIRSERVER_184_6() { try { new Dn( "dn=a middle # pound" ); } catch ( LdapException ine ) { assertTrue( true ); } } /** * Test for DIRSERVER-184 * @throws LdapException */ @Test public void testDIRSERVER_184_7() { try { new Dn( "dn=a trailing pound #" ); } catch ( LdapException ine ) { assertTrue( true ); } } @Test public void testDIRSERVER_631_1() throws LdapException { Dn name = new Dn( "cn=Bush\\, Kate,dc=example,dc=com" ); assertEquals( "cn=Bush\\, Kate,dc=example,dc=com", name.toString() ); assertEquals( "cn=Bush\\, Kate,dc=example,dc=com", name.getName() ); } /** * Added a test to check the parsing of a Dn with more than one Rdn * which are OIDs, and with one Rdn which has more than one atav. * @throws LdapException */ @Test public void testDNWithMultiOidsRDN() throws LdapException { Dn name = new Dn( "0.9.2342.19200300.100.1.1=00123456789+2.5.4.3=pablo picasso,2.5.4.11=search,2.5.4.10=imc,2.5.4.6=us" ); assertEquals( "0.9.2342.19200300.100.1.1=00123456789+2.5.4.3=pablo picasso,2.5.4.11=search,2.5.4.10=imc,2.5.4.6=us", name.toString() ); assertEquals( "0.9.2342.19200300.100.1.1=00123456789+2.5.4.3=pablo picasso,2.5.4.11=search,2.5.4.10=imc,2.5.4.6=us", name.getName() ); } @Test public void testDNEquals() throws LdapException { Dn dn1 = new Dn( "a=b,c=d,e=f" ); Dn dn2 = new Dn( "a=b\\,c\\=d,e=f" ); assertFalse( dn1.getNormName().equals( dn2.getNormName() ) ); } @Test public void testDNAddEmptyString() throws LdapException { Dn dn = new Dn(); assertTrue( dn.size() == 0 ); assertTrue( dn.add( "" ).size() == 0 ); } /** * This leads to the bug in DIRSERVER-832. */ @Test public void testPreserveAttributeIdCase() throws LdapException { Dn dn = new Dn( "uID=kevin" ); assertEquals( "uID", dn.getRdn().getType() ); } /** * Tests the Dn.isValid() method. */ @Test public void testIsValid() { assertTrue( Dn.isValid( "" ) ); assertFalse( Dn.isValid( "a" ) ); assertFalse( Dn.isValid( "a " ) ); assertTrue( Dn.isValid( "a=" ) ); assertTrue( Dn.isValid( "a= " ) ); assertFalse( Dn.isValid( "=" ) ); assertFalse( Dn.isValid( " = " ) ); assertFalse( Dn.isValid( " = a" ) ); } @Test public void testCompositeRDN() throws LdapException { assertTrue( Dn.isValid( "a=b+c=d+e=f,g=h" ) ); Dn dn = new Dn( "a=b+c=d+e=f,g=h" ); assertEquals( "a=b+c=d+e=f,g=h", dn.toString() ); } @Test public void testCompositeRDNOids() throws LdapException { assertTrue( Dn .isValid( "1.2.3.4.5=0+1.2.3.4.6=0+1.2.3.4.7=omnischmomni,2.5.4.3=subtree,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com" ) ); Dn dn = new Dn( "1.2.3.4.5=0+1.2.3.4.6=0+1.2.3.4.7=omnischmomni,2.5.4.3=subtree,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com" ); assertEquals( "1.2.3.4.5=0+1.2.3.4.6=0+1.2.3.4.7=omnischmomni,2.5.4.3=subtree,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com", dn.toString() ); } /** * Tests that AttributeTypeAndValues are correctly trimmed. */ @Test public void testTrimAtavs() throws LdapException { // antlr parser: string value with trailing spaces Dn dn1 = new Dn( " cn = Amos\\,Tori , ou=system " ); assertEquals( " cn = Amos\\,Tori ", dn1.getRdn().getName() ); Ava atav1 = dn1.getRdn().getAva(); assertEquals( "cn", atav1.getType() ); assertEquals( "Amos\\,Tori", atav1.getValue().getValue() ); // antlr parser: hexstring with trailing spaces Dn dn3 = new Dn( " cn = #414243 , ou=system " ); assertEquals( " cn = #414243 ", dn3.getRdn().getName() ); Ava atav3 = dn3.getRdn().getAva(); assertEquals( "cn", atav3.getType() ); assertTrue( Arrays.equals( Strings.getBytesUtf8( "ABC" ), (byte[])atav3.getValue().getValue() ) ); assertTrue( Arrays.equals( Strings.getBytesUtf8( "ABC" ), atav3.getValue().getBytes() ) ); // antlr parser: Dn dn4 = new Dn( " cn = \\41\\42\\43 , ou=system " ); assertEquals( " cn = \\41\\42\\43 ", dn4.getRdn().getName() ); Ava atav4 = dn4.getRdn().getAva(); assertEquals( "cn", atav4.getType() ); assertEquals( "\\41\\42\\43", atav4.getValue().getValue() ); assertEquals( "ABC", atav4.getValue().getNormValue() ); // antlr parser: quotestring with trailing spaces Dn dn5 = new Dn( " cn = \"ABC\" , ou=system " ); assertEquals( " cn = \"ABC\" ", dn5.getRdn().getName() ); Ava atav5 = dn5.getRdn().getAva(); assertEquals( "cn", atav5.getType() ); assertEquals( "\"ABC\"", atav5.getValue() .getValue()); assertEquals( "ABC", atav5.getValue().getNormValue() ); // fast parser: string value with trailing spaces Dn dn2 = new Dn( " cn = Amos Tori , ou=system " ); assertEquals( " cn = Amos Tori ", dn2.getRdn().getName() ); Ava atav2 = dn2.getRdn().getAva(); assertEquals( "cn", atav2.getType() ); assertEquals( "Amos Tori", atav2.getValue().getValue() ); } /** * Test for DIRSHARED-39. * (Trailing escaped space not parsed correctly by the Dn parser( */ @Test public void testTrailingEscapedSpace() throws Exception { Dn dn1 = new Dn( "ou=A\\ ,ou=system" ); dn1.apply( schemaManager ); assertEquals( "ou=A\\ ,ou=system", dn1.getName() ); assertEquals( "2.5.4.11=a\\ ,2.5.4.11=system", dn1.getNormName() ); assertEquals( "ou=A\\ ", dn1.getRdn().getName() ); assertEquals( "2.5.4.11=a\\ ", dn1.getRdn().getNormName() ); Dn dn2 = new Dn( "ou=A\\20,ou=system" ); dn2.apply( schemaManager ); assertEquals( "ou=A\\20,ou=system", dn2.getName() ); assertEquals( "2.5.4.11=a\\ ,2.5.4.11=system", dn2.getNormName() ); assertEquals( "ou=A\\20", dn2.getRdn().getName() ); assertEquals( "2.5.4.11=a\\ ", dn2.getRdn().getNormName() ); Dn dn3 = new Dn( "ou=\\ ,ou=system" ); dn3.apply( schemaManager ); assertEquals( "ou=\\ ,ou=system", dn3.getName() ); assertEquals( "2.5.4.11=\\ ,2.5.4.11=system", dn3.getNormName() ); assertEquals( "ou=\\ ", dn3.getRdn().getName() ); assertEquals( "2.5.4.11=\\ ", dn3.getRdn().getNormName() ); Dn dn4 = new Dn( "ou=\\20,ou=system" ); dn4.apply( schemaManager ); assertEquals( "ou=\\20,ou=system", dn4.getName() ); assertEquals( "2.5.4.11=\\ ,2.5.4.11=system", dn4.getNormName() ); assertEquals( "ou=\\20", dn4.getRdn().getName() ); assertEquals( "2.5.4.11=\\ ", dn4.getRdn().getNormName() ); } /** * Test for DIRSHARED-41, DIRSTUDIO-603. * (Dn parser fails to parse names containing an numeric OID value) */ @Test public void testNumericOid() throws Exception { // numeric OID only Dn dn1 = new Dn( "cn=loopback+ipHostNumber=127.0.0.1,ou=Hosts,dc=mygfs,dc=com" ); assertEquals( "cn=loopback+ipHostNumber=127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn1.getName() ); assertEquals( "cn=loopback+iphostnumber=127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn1.getNormName() ); assertEquals( "cn=loopback+ipHostNumber=127.0.0.1", dn1.getRdn().getName() ); assertEquals( "cn=loopback+iphostnumber=127.0.0.1", dn1.getRdn().getNormName() ); assertEquals( "127.0.0.1", dn1.getRdn().getAva( "ipHostNumber" ).getValue().getValue() ); // numeric OID with suffix Dn dn2 = new Dn( "cn=loopback+ipHostNumber=X127.0.0.1,ou=Hosts,dc=mygfs,dc=com" ); assertEquals( "cn=loopback+ipHostNumber=X127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn2.getName() ); assertEquals( "cn=loopback+iphostnumber=X127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn2.getNormName() ); assertEquals( "cn=loopback+ipHostNumber=X127.0.0.1", dn2.getRdn().getName() ); assertEquals( "cn=loopback+iphostnumber=X127.0.0.1", dn2.getRdn().getNormName() ); // numeric OID with prefix Dn dn3 = new Dn( "cn=loopback+ipHostNumber=127.0.0.1Y,ou=Hosts,dc=mygfs,dc=com" ); assertEquals( "cn=loopback+ipHostNumber=127.0.0.1Y,ou=Hosts,dc=mygfs,dc=com", dn3.getName() ); assertEquals( "cn=loopback+iphostnumber=127.0.0.1Y,ou=Hosts,dc=mygfs,dc=com", dn3.getNormName() ); assertEquals( "cn=loopback+ipHostNumber=127.0.0.1Y", dn3.getRdn().getName() ); assertEquals( "cn=loopback+iphostnumber=127.0.0.1Y", dn3.getRdn().getNormName() ); // numeric OID with special characters Dn dn4 = new Dn( "cn=loopback+ipHostNumber=\\#127.0.0.1 Z,ou=Hosts,dc=mygfs,dc=com" ); assertEquals( "cn=loopback+ipHostNumber=\\#127.0.0.1 Z,ou=Hosts,dc=mygfs,dc=com", dn4.getName() ); assertEquals( "cn=loopback+iphostnumber=\\#127.0.0.1 Z,ou=Hosts,dc=mygfs,dc=com", dn4.getNormName() ); assertEquals( "cn=loopback+ipHostNumber=\\#127.0.0.1 Z", dn4.getRdn().getName() ); assertEquals( "cn=loopback+iphostnumber=\\#127.0.0.1 Z", dn4.getRdn().getNormName() ); } @Test public void testNormalizeAscii() throws Exception { Dn dn = new Dn( " ou = Example , ou = COM " ); dn.apply( schemaManager ); assertEquals( "2.5.4.11=example,2.5.4.11=com", dn.getNormName() ); assertEquals( " ou = Example , ou = COM ", dn.getName() ); Rdn rdn = dn.getRdn(); assertEquals( "2.5.4.11", rdn.getNormType() ); assertEquals( "example", rdn.getNormValue() ); assertEquals( "2.5.4.11=example", rdn.getNormName() ); assertEquals( "ou", rdn.getType() ); assertEquals( "Example", rdn.getValue() ); assertEquals( " ou = Example ", rdn.getName() ); Ava atav = rdn.getAva(); assertEquals( "2.5.4.11=example", atav.getNormName() ); assertEquals( "2.5.4.11", atav.getNormType() ); assertEquals( "example", atav.getValue().getNormValue().toString() ); assertEquals( "ou", atav.getType() ); assertEquals( "Example", atav.getValue().getValue() ); assertEquals( " ou = Example ", atav.getName() ); } @Test public void testNormalizeAsciiComposite() throws Exception { Dn dn = new Dn( " ou = Example + cn = TEST , ou = COM " ); dn.apply( schemaManager ); assertEquals( "2.5.4.11=example+2.5.4.3=test,2.5.4.11=com", dn.getNormName() ); assertEquals( " ou = Example + cn = TEST , ou = COM ", dn.getName() ); Rdn rdn = dn.getRdn(); assertEquals( "2.5.4.11", rdn.getNormType() ); assertEquals( "example", rdn.getNormValue() ); assertEquals( "2.5.4.11=example+2.5.4.3=test", rdn.getNormName() ); assertEquals( "ou", rdn.getType() ); assertEquals( "Example", rdn.getValue() ); assertEquals( " ou = Example + cn = TEST ", rdn.getName() ); // The first ATAV Ava atav = rdn.getAva(); assertEquals( "2.5.4.11=example", atav.getNormName() ); assertEquals( "2.5.4.11", atav.getNormType() ); assertEquals( "example", atav.getValue().getNormValue().toString() ); assertEquals( "ou", atav.getType() ); assertEquals( "Example", atav.getValue().getValue() ); assertEquals( " ou = Example ", atav.getName() ); assertEquals( 2, rdn.size() ); // The second ATAV for ( Ava ava : rdn ) { if ( "example".equals( ava.getValue().getNormValue().toString() ) ) { // Skip the first one continue; } assertEquals( "2.5.4.3=test", ava.getNormName() ); assertEquals( "2.5.4.3", ava.getNormType() ); assertEquals( "test", ava.getValue().getNormValue().toString() ); assertEquals( "cn", ava.getType() ); assertEquals( "TEST", ava.getValue().getValue() ); assertEquals( " cn = TEST ", ava.getName() ); } } @Test public void testNormalizeAsciiWithEscaped() throws Exception { Dn dn = new Dn( " ou = Ex\\+mple " ); dn.apply( schemaManager ); assertEquals( "2.5.4.11=ex\\+mple", dn.getNormName() ); assertEquals( " ou = Ex\\+mple ", dn.getName() ); Rdn rdn = dn.getRdn(); assertEquals( "2.5.4.11", rdn.getNormType() ); assertEquals( "ex+mple", rdn.getNormValue() ); assertEquals( "2.5.4.11=ex\\+mple", rdn.getNormName() ); assertEquals( "ou", rdn.getType() ); assertEquals( "Ex\\+mple", rdn.getValue() ); assertEquals( " ou = Ex\\+mple ", rdn.getName() ); Ava atav = rdn.getAva(); assertEquals( "2.5.4.11=ex\\+mple", atav.getNormName() ); assertEquals( "2.5.4.11", atav.getNormType() ); assertEquals( "ex+mple", atav.getValue().getNormValue().toString() ); assertEquals( "ou", atav.getType() ); assertEquals( "Ex\\+mple", atav.getValue().getValue() ); assertEquals( " ou = Ex\\+mple ", atav.getName() ); } @Test public void testNormalizeBackSlash() throws Exception { Dn dn = new Dn( "cn=A\\,b,dc=com" ); dn.apply( schemaManager ); System.out.println( dn.toString() ); System.out.println( dn ); System.out.println( dn.getName() ); System.out.println( dn.getNormName() ); System.out.println( dn.getRdn().getAva().getValue().getString() ); } @Test public void testNormalizeCompositeWithEscaped() throws Exception { Dn dn = new Dn( " OU = Ex\\+mple + cn = T\\+ST\\ , ou = COM " ); // ------------------------------------------------------------------ // Before normalization assertEquals( " OU = Ex\\+mple + cn = T\\+ST\\ , ou = COM ", dn.getName() ); assertEquals( "ou=Ex\\+mple+cn=T\\+ST\\ ,ou=COM", dn.getNormName() ); // Check the first Rdn Rdn rdn = dn.getRdn(); assertEquals( " OU = Ex\\+mple + cn = T\\+ST\\ ", rdn.getName() ); assertEquals( "ou=Ex\\+mple+cn=T\\+ST\\ ", rdn.getNormName() ); assertEquals( "OU", rdn.getType() ); assertEquals( "ou", rdn.getNormType() ); assertEquals( "Ex\\+mple", rdn.getValue() ); assertEquals( "Ex+mple", rdn.getNormValue() ); // The first ATAV Ava atav = rdn.getAva(); assertEquals( " OU = Ex\\+mple ", atav.getName() ); assertEquals( "ou=Ex\\+mple", atav.getNormName() ); assertEquals( "ou", atav.getNormType() ); assertEquals( "OU", atav.getType() ); assertEquals( "Ex\\+mple", atav.getValue().getValue() ); assertEquals( "Ex+mple", atav.getValue().getNormValue().toString() ); assertEquals( 2, rdn.size() ); // The second ATAV for ( Ava ava : rdn ) { if ( "Ex+mple".equals( ava.getValue().getNormValue().toString() ) ) { // Skip the first one continue; } assertEquals( " cn = T\\+ST\\ ", ava.getName() ); assertEquals( "cn=T\\+ST\\ ", ava.getNormName() ); assertEquals( "cn", ava.getType() ); assertEquals( "cn", ava.getNormType() ); assertEquals( "T\\+ST\\ ", ava.getValue().getValue() ); assertEquals( "T+ST ", ava.getValue().getNormValue().toString() ); } // ------------------------------------------------------------------ // Now normalize the Dn dn.apply( schemaManager ); assertEquals( " OU = Ex\\+mple + cn = T\\+ST\\ , ou = COM ", dn.getName() ); assertEquals( "2.5.4.11=ex\\+mple+2.5.4.3=t\\+st\\ ,2.5.4.11=com", dn.getNormName() ); // Check the first Rdn rdn = dn.getRdn(); assertEquals( " OU = Ex\\+mple + cn = T\\+ST\\ ", rdn.getName() ); assertEquals( "2.5.4.11=ex\\+mple+2.5.4.3=t\\+st\\ ", rdn.getNormName() ); assertEquals( "OU", rdn.getType() ); assertEquals( "2.5.4.11", rdn.getNormType() ); assertEquals( "Ex\\+mple", rdn.getValue() ); assertEquals( "ex+mple", rdn.getNormValue() ); // The first ATAV atav = rdn.getAva(); assertEquals( " OU = Ex\\+mple ", atav.getName() ); assertEquals( "2.5.4.11=ex\\+mple", atav.getNormName() ); assertEquals( "2.5.4.11", atav.getNormType() ); assertEquals( "OU", atav.getType() ); assertEquals( "Ex\\+mple", atav.getValue().getValue() ); assertEquals( "ex+mple", atav.getValue().getNormValue().toString() ); assertEquals( 2, rdn.size() ); // The second ATAV for ( Ava ava : rdn ) { if ( "ex+mple".equals( ava.getValue().getNormValue().toString() ) ) { // Skip the first one continue; } assertEquals( " cn = T\\+ST\\ ", ava.getName() ); assertEquals( "2.5.4.3=t\\+st\\ ", ava.getNormName() ); assertEquals( "cn", ava.getType() ); assertEquals( "2.5.4.3", ava.getNormType() ); assertEquals( "T\\+ST\\ ", ava.getValue().getValue() ); assertEquals( "t+st ", ava.getValue().getNormValue().toString() ); } } //------------------------------------------------------------------------- // test the iterator //------------------------------------------------------------------------- @Test public void testIteratorNullDN() { Dn dn = Dn.EMPTY_DN; for ( Rdn rdn : dn ) { fail( "Should not be there: rdn = " + rdn ); } assertTrue( true ); } @Test public void testIteratorOneRDN() throws Exception { Dn dn = new Dn( "ou=example" ); int count = 0; for ( Rdn rdn : dn ) { count++; assertEquals( "ou=example", rdn.getName() ); } assertEquals( 1, count ); } @Test public void testIteratorMultipleRDN() throws Exception { Dn dn = new Dn( "sn=joe+cn=doe,dc=apache,dc=org" ); int count = 0; String[] expected = new String[] { "sn=joe+cn=doe", "dc=apache", "dc=org" }; for ( Rdn rdn : dn.getRdns() ) { assertEquals( expected[count], rdn.getName() ); count++; } assertEquals( 3, count ); } @Test public void testIsParentOfTrue() throws Exception { Dn dn = new Dn( "ou=example, dc=apache, dc=org" ); Dn parent1 = new Dn( "ou=example,dc=apache, dc=org" ); Dn parent2 = new Dn( "dc=apache, dc=org" ); Dn parent3 = new Dn( "dc=org" ); Dn notParent = new Dn( "ou=example,dc=apache, dc=com" ); assertTrue( parent1.isAncestorOf( dn ) ); assertTrue( parent2.isAncestorOf( dn ) ); assertTrue( parent3.isAncestorOf( dn ) ); assertFalse( notParent.isAncestorOf( dn ) ); } @Test public void testIsDescendantOfTrue() throws Exception { Dn dn = new Dn( "ou=example, dc=apache, dc=org" ); Dn parent1 = new Dn( "ou=example,dc=apache, dc=org" ); Dn parent2 = new Dn( "dc=apache, dc=org" ); Dn parent3 = new Dn( "dc=org" ); Dn notParent = new Dn( "dc=apache, dc=com" ); assertTrue( dn.isDescendantOf( parent1 ) ); assertTrue( dn.isDescendantOf( parent2 ) ); assertTrue( dn.isDescendantOf( parent3 ) ); assertFalse( notParent.isDescendantOf( dn ) ); } @Test public void testNormalize() throws Exception { Dn dn = new Dn( "ou=system" ); assertFalse( dn.isSchemaAware() ); dn = dn.add( "ou=users" ); assertFalse( dn.isSchemaAware() ); dn.apply( schemaManager ); assertTrue( dn.isSchemaAware() ); dn = dn.add( "ou=x" ); assertTrue( dn.isSchemaAware() ); assertEquals( "2.5.4.11=x,2.5.4.11=users,2.5.4.11=system", dn.getNormName() ); assertEquals( "ou=x,ou=users,ou=system", dn.getName() ); dn.apply( schemaManager ); assertEquals( "2.5.4.11=x,2.5.4.11=users,2.5.4.11=system", dn.getNormName() ); assertEquals( "ou=x,ou=users,ou=system", dn.getName() ); Rdn rdn = new Rdn( "ou=system" ); dn = new Dn(); assertFalse( dn.isSchemaAware() ); dn = dn.add( rdn ); assertFalse( dn.isSchemaAware() ); dn.apply( schemaManager ); assertTrue( dn.isSchemaAware() ); Dn anotherDn = new Dn( "ou=x,ou=users" ); dn = dn.add( anotherDn ); assertTrue( dn.isSchemaAware() ); dn.apply( schemaManager ); assertTrue( dn.isSchemaAware() ); } @Test public void testParseDnWithSlash() throws Exception { String dnStr = "dc=/vehicles/v1/"; Dn dn = new Dn( dnStr ); dn.apply( schemaManager ); assertEquals( dnStr, dn.toString() ); } @Test public void testCreateDnFromRdnParent() throws Exception { String rdn = "cn=test"; String parentDn = "ou=apache,ou=org"; Dn dn = new Dn( rdn, parentDn ); assertEquals( "cn=test,ou=apache,ou=org", dn.getName() ); } @Test public void testRdnStudio() throws LdapInvalidDnException { new Dn( schemaManager, "cn=\\#\\\\\\+\\, \\\"\u00f6\u00e9\\\",ou=users,ou=system" ); } @Test @Ignore public void testDnParsing() throws LdapInvalidDnException { long[] deltas = new long[10]; for ( int j = 0; j < 10; j++ ) { long t0 = System.currentTimeMillis(); for ( int i = 0; i < 10000000; i++ ) { new Dn( schemaManager, "dc=example" + i ); } long t1 = System.currentTimeMillis(); deltas[j] = t1 - t0; System.out.println( "Iteration[" + j + "] : " + deltas[j] ); } long allDeltas = 0L; for ( int i = 0; i < 10; i++ ) { allDeltas += deltas[i]; } System.out.println( "delta new 1 RDN : " + ( allDeltas / 10 ) ); for ( int j = 0; j < 10; j++ ) { long t0 = System.currentTimeMillis(); for ( int i = 0; i < 10000000; i++ ) { new Dn( schemaManager, "dc=example" + i + ",dc=com" ); } long t1 = System.currentTimeMillis(); deltas[j] = t1 - t0; System.out.println( "Iteration[" + j + "] : " + deltas[j] ); } allDeltas = 0L; for ( int i = 0; i < 10; i++ ) { allDeltas += deltas[i]; } System.out.println( "delta new 2 RDNs : " + ( allDeltas / 10 ) ); for ( int j = 0; j < 10; j++ ) { long t0 = System.currentTimeMillis(); for ( int i = 0; i < 10000000; i++ ) { new Dn( schemaManager, "uid=" + i + ",dc=example,dc=com" ); } long t1 = System.currentTimeMillis(); deltas[j] = t1 - t0; System.out.println( "Iteration[" + j + "] : " + deltas[j] ); } allDeltas = 0L; for ( int i = 0; i < 10; i++ ) { allDeltas += deltas[i]; } System.out.println( "delta new 3 RDNs : " + ( allDeltas / 10 ) ); for ( int j = 0; j < 10; j++ ) { long t0 = System.currentTimeMillis(); for ( int i = 0; i < 10000000; i++ ) { new Dn( schemaManager, "uid=" + i + ",ou=people,dc=example,dc=com" ); } long t1 = System.currentTimeMillis(); deltas[j] = t1 - t0; System.out.println( "Iteration[" + j + "] : " + deltas[j] ); } allDeltas = 0L; for ( int i = 0; i < 10; i++ ) { allDeltas += deltas[i]; } System.out.println( "delta new 4 RDNs : " + ( allDeltas / 10 ) ); } @Test @Ignore public void testDnParsingOneRdn() throws LdapInvalidDnException { long t0 = System.currentTimeMillis(); for ( int i = 0; i < 1000000; i++ ) { new Dn( "dc=example" + i ); } long t1 = System.currentTimeMillis(); System.out.println( "delta new 1 RDN : " + ( t1 - t0 ) ); } } ././@LongLink0100644 0000000 0000000 00000000156 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/FastParserRdnTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/FastParserRdn0100644 0000767 0000024 00000006320 13114114302 034655 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.model.name; 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.manager.impl.DefaultSchemaManager; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.assertEquals; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the schemaAware Rdn class when using teh FastParser * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class FastParserRdnTest { private static SchemaManager schemaManager; @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); } @Test public void testSimpleRdnValueSchemaAware() throws LdapException { String errors = null; Rdn rdn = new Rdn( schemaManager, "CommonName = TEST " ); if ( !"CommonName = TEST ".equals( rdn.getName() ) ) { errors += "\nRdn.getName fails '" + rdn.getName() + "'"; } if ( !"2.5.4.3=test".equals( rdn.getNormName() ) ) { errors = "\nRdn.getNormName fails '" + rdn.getNormName() + "'"; } if ( !"test".equals( rdn.getNormValue( "cn" ) ) ) { errors += "\nRdn.getNormValue( 'cn' ) fails '" + ( String ) rdn.getNormValue( "cn" ) + "'"; } assertEquals( null, errors ); } @Test public void testSimpleRdnValueNullSchemaManager() throws LdapException { String errors = null; Rdn rdn = new Rdn( (SchemaManager)null, "Cn= TEST " ); if ( !"Cn= TEST ".equals( rdn.getName() ) ) { errors += "\nRdn.getName fails '" + rdn.getName() + "'"; } if ( !"cn=TEST".equals( rdn.getNormName() ) ) { errors = "\nRdn.getNormName fails '" + rdn.getNormName() + "'"; } if ( !"TEST".equals( rdn.getNormValue( "cn" ) ) ) { errors += "\nRdn.getNormValue( 'cn' ) fails '" + ( String ) rdn.getNormValue( "cn" ) + "'"; } assertEquals( null, errors ); } } ././@LongLink0100644 0000000 0000000 00000000156 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/MultiThreadedTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/MultiThreaded0100644 0000767 0000024 00000010271 13114114302 034672 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.model.name; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.apache.directory.junit.tools.MultiThreadedMultiInvoker; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Multi-threaded * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class MultiThreadedTest { @Rule public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( 100, 1000 ); private static Dn referenceDn; private static Dn sharedDn; private static Rdn referenceRdn; private static Rdn sharedRdn; private static Ava referenceAva; private static Ava sharedAva; private static SchemaManager schemaManager; @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); referenceDn = new Dn( "dc=example,dc=com" ); referenceDn.apply( schemaManager ); sharedDn = new Dn( "dc=example,dc=com" ); sharedDn.apply( schemaManager ); referenceRdn = new Rdn( "ou=system" ); referenceRdn.apply( schemaManager ); sharedRdn = new Rdn( "ou=system" ); sharedRdn.apply( schemaManager ); referenceAva = new Ava( schemaManager, "ou", "System" ); sharedAva = new Ava( schemaManager, "ou", "System" ); } @Test public void testNormalize() throws Exception { sharedAva.normalize(); sharedRdn.apply( schemaManager ); assertTrue( sharedRdn.isSchemaAware() ); sharedDn.apply( schemaManager ); assertTrue( sharedDn.isSchemaAware() ); } @Test public void testNormalizeHashCode() throws Exception { assertEquals( referenceAva.hashCode(), sharedAva.hashCode() ); sharedRdn.apply( schemaManager ); assertEquals( referenceRdn.hashCode(), sharedRdn.hashCode() ); sharedDn.apply( schemaManager ); assertEquals( referenceDn.hashCode(), sharedDn.hashCode() ); } @Test public void testNormalizeEquals() throws Exception { assertEquals( referenceAva, sharedAva ); assertTrue( referenceAva.equals( sharedAva ) ); assertTrue( sharedAva.equals( referenceAva ) ); sharedRdn.apply( schemaManager ); assertEquals( referenceRdn, sharedRdn ); assertTrue( referenceRdn.equals( sharedRdn ) ); assertTrue( sharedRdn.equals( referenceRdn ) ); sharedDn.apply( schemaManager ); assertEquals( referenceDn, sharedDn ); assertTrue( referenceDn.equals( sharedDn ) ); assertTrue( sharedDn.equals( referenceDn ) ); } @Test public void testNormalizeCompare() throws Exception { assertTrue( sharedAva.equals( referenceAva ) ); assertTrue( referenceAva.equals( sharedAva ) ); assertTrue( referenceRdn.equals( sharedRdn ) ); assertTrue( sharedRdn.equals( referenceRdn ) ); assertEquals( referenceDn, sharedDn ); assertEquals( sharedDn, referenceDn ); } } apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/RdnTest.java0100644 0000767 0000024 00000016420 13114114302 034444 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.model.name; 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.schema.SchemaManager; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.assertEquals; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Tests for the schemaAware Rdn class * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class RdnTest { private static SchemaManager schemaManager; @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); } @Test public void testRdnValueSchemaAware() throws LdapException { String errors = null; Rdn rdn = new Rdn( schemaManager, "cn= TEST\\ " ); if ( !"cn= TEST\\ ".equals( rdn.getName() ) ) { errors += "\nRdn.getName fails '" + rdn.getName() + "'"; } if ( !"2.5.4.3=test\\ ".equals( rdn.getNormName() ) ) { errors = "\nRdn.getNormName fails '" + rdn.getNormName() + "'"; } if ( !"test ".equals( rdn.getNormValue( "cn" ) ) ) { errors += "\nRdn.getNormValue( 'cn' ) fails '" + ( String ) rdn.getNormValue( "cn" ) + "'"; } assertEquals( null, errors ); } @Test public void testRdnValuesNoSchema() throws LdapException { String errors = null; Rdn rdn = new Rdn( "OU = Exemple \\+ Rdn\\C3\\A4\\ +cn= TEST" ); if ( !"OU = Exemple \\+ Rdn\\C3\\A4\\ +cn= TEST".equals( rdn.getName() ) ) { errors += "\nRdn.getName fails '" + rdn.getName() + "'"; } if ( !"ou=Exemple \\+ Rdn\u00E4\\ +cn=TEST" .equals( rdn.getNormName() ) ) { errors = "\nRdn.getNormName fails '" + rdn.getNormName() + "'"; } if ( !"ou".equals( rdn.getNormType() ) ) { errors += "\nRdn.getNormType fails '" + rdn.getNormType() + "'"; } if ( !"Exemple + Rdn\u00E4 ".equals( rdn.getNormValue() ) ) { errors += "\nRdn.getNormValue fails '" + rdn.getNormValue() + "'"; } if ( !"OU".equals( rdn.getType() ) ) { errors += "\nRdn.getUpType fails '" + rdn.getType() + "'"; } if ( !"Exemple + Rdn\u00E4 ".equals( rdn.getNormValue() ) ) { errors += "\nRdn.getNormValue fails '" + rdn.getNormValue() + "'"; } if ( !"Exemple + Rdn\u00E4 ".equals( rdn.getNormValue( "ou" ) ) ) { errors += "\nRdn.getNormValue( 'ou' ) fails '" + rdn.getNormValue( "ou" ) + "'"; } if ( !"TEST".equals( rdn.getValue( "cn" ) ) ) { errors += "\nRdn.getValue( 'test' ) fails '" + rdn.getValue( "cn" ) + "'"; } if ( !"OU = Exemple \\+ Rdn\\C3\\A4\\ +cn= TEST".equals( rdn.toString() ) ) { errors += "\nRdn.toString fails '" + rdn.toString() + "'"; } assertEquals( null, errors ); } @Test public void testRdnValuesSchemaAware() throws LdapException { String errors = null; Rdn rdn = new Rdn( schemaManager, "OU = Exemple \\+ Rdn\\C3\\A4\\ +cn= TEST" ); if ( !"OU = Exemple \\+ Rdn\\C3\\A4\\ +cn= TEST".equals( rdn.getName() ) ) { errors += "\nRdn.getName fails '" + rdn.getName() + "'"; } if ( !"2.5.4.11=exemple \\+ rdn\u00E4\\ +2.5.4.3=test" .equals( rdn.getNormName() ) ) { errors = "\nRdn.getNormName fails '" + rdn.getNormName() + "'"; } if ( !"2.5.4.11".equals( rdn.getNormType() ) ) { errors += "\nRdn.getNormType fails '" + rdn.getNormType() + "'"; } if ( !"exemple + rdn\u00E4 ".equals( rdn.getNormValue() ) ) { errors += "\nRdn.getNormValue fails '" + rdn.getNormValue() + "'"; } if ( !"OU".equals( rdn.getType() ) ) { errors += "\nRdn.getUpType fails '" + rdn.getType() + "'"; } if ( !"Exemple \\+ Rdn\\C3\\A4\\ ".equals( rdn.getValue() ) ) { errors += "\nRdn.getUpValue fails '" + rdn.getValue() + "'"; } if ( !"exemple + rdn\u00E4 ".equals( rdn.getNormValue( "ou" ) ) ) { errors += "\nRdn.getNormValue( 'ou' ) fails '" + ( String ) rdn.getNormValue( "ou" ) + "'"; } if ( !"test".equals( rdn.getNormValue( "cn" ) ) ) { errors += "\nRdn.getNormValue( 'cn' ) fails '" + ( String ) rdn.getNormValue( "cn" ) + "'"; } if ( !"OU = Exemple \\+ Rdn\\C3\\A4\\ +cn= TEST".equals( rdn.toString() ) ) { errors += "\nRdn.toString fails '" + rdn.toString() + "'"; } assertEquals( null, errors ); } @Test public void testRdnMultipleAvas() throws Exception { Rdn rdn1 = new Rdn( schemaManager, "cn=doe+gn=john" ); Rdn rdn2 = new Rdn( schemaManager, "gn=john+cn=doe" ); assertEquals( rdn1, rdn2 ); assertEquals( rdn1.getNormName(), rdn2.getNormName() ); } /** * test that a RDN with an attributeType used twice with the same value * throws an exception */ @Test( expected=LdapInvalidDnException.class ) public void testWrongRdnAtUsedTwiceSameValue() throws LdapException { new Rdn( schemaManager, " cn = b + cn = b " ); } /** * test that a RDN with an attributeType used twice but with different value * is accepted */ @Test public void testRdnAtUsedTwiceDifferentValue() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = c + cn = b " ); Rdn rdn2 = new Rdn( schemaManager, " cn = b + cn = c " ); //assertEquals( rdn1, rdn2 ); } @Test public void testRdnEscapedValue() throws Exception { new Rdn( schemaManager, "sn=\\46\\65\\72\\72\\79" ); } } ././@LongLink0100644 0000000 0000000 00000000174 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareAvaSerializationTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareAv0100644 0000767 0000024 00000034007 13114114302 034611 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.model.name; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; 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.manager.impl.DefaultSchemaManager; import org.apache.directory.api.util.Strings; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; /** * Test the class AttributeTypeAndValue * * @author Apache Directory Project */ public class SchemaAwareAvaSerializationTest { private static SchemaManager schemaManager; @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); } /** * Test serialization of a simple ATAV */ @Test public void testStringAtavSerialization() throws LdapException, IOException, ClassNotFoundException { Ava atav = new Ava( schemaManager, "CN", "Test" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); atav.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Ava atav2 = new Ava( schemaManager ); atav2.readExternal( in ); assertEquals( atav, atav2 ); } /** * Test serialization of a simple ATAV */ @Test public void testStringAtavSerializationBytes() throws LdapException, IOException, ClassNotFoundException { byte[] buffer = new byte[128]; Ava atav = new Ava( schemaManager, "CN", "Test" ); int pos1 = atav.serialize( buffer, 0 ); Ava atav2 = new Ava( schemaManager ); int pos2 = atav2.deserialize( buffer, 0 ); assertEquals( pos1, pos2 ); assertEquals( atav, atav2 ); } @Test public void testBinaryAtavSerialization() throws LdapException, IOException, ClassNotFoundException { byte[] normValue = Strings.getBytesUtf8( "Test" ); Ava atav = new Ava( schemaManager, "userPKCS12", normValue ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); atav.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Ava atav2 = new Ava( schemaManager ); atav2.readExternal( in ); assertEquals( atav, atav2 ); } @Ignore @Test public void testBinaryAtavSerializationBytes() throws LdapException, IOException, ClassNotFoundException { byte[] buffer = new byte[128]; byte[] normValue = Strings.getBytesUtf8( "Test" ); Ava atav = new Ava( schemaManager, "userPKCS12", normValue ); int pos1 = atav.serialize( buffer, 0 ); Ava atav2 = new Ava( schemaManager ); int pos2 = atav2.deserialize( buffer, 0 ); assertEquals( pos1, pos2 ); assertEquals( atav, atav2 ); } /** * Test serialization of a simple ATAV */ @Test public void testNullAtavSerialization() throws LdapException, IOException, ClassNotFoundException { Ava atav = new Ava( schemaManager ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); try { atav.writeExternal( out ); fail(); } catch ( IOException ioe ) { assertTrue( true ); } } /** * Test serialization of a simple ATAV */ @Test public void testNullAtavSerializationBytes() throws LdapException, IOException, ClassNotFoundException { byte[] buffer = new byte[128]; Ava atav = new Ava( schemaManager ); try { atav.serialize( buffer, 0 ); fail(); } catch ( IOException ioe ) { assertTrue( true ); } } @Test public void testNullUpValueSerialization() throws LdapException, IOException, ClassNotFoundException { Ava atav = new Ava( schemaManager, "dc", ( String ) null ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); try { atav.writeExternal( out ); fail(); } catch ( IOException ioe ) { String message = ioe.getMessage(); assertEquals( "Cannot serialize a wrong ATAV, the value should not be null", message ); } } @Test public void testNullUpValueSerializationBytes() throws LdapException, IOException, ClassNotFoundException { byte[] buffer = new byte[128]; Ava atav = new Ava( schemaManager, "dc", ( String ) null ); try { atav.serialize( buffer, 0 ); fail(); } catch ( IOException ioe ) { String message = ioe.getMessage(); assertEquals( "Cannot serialize an wrong ATAV, the value should not be null", message ); } } @Test public void testEmptyNormValueSerialization() throws LdapException, IOException, ClassNotFoundException { Ava atav = new Ava( schemaManager, "DC", "" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); atav.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Ava atav2 = new Ava( schemaManager ); atav2.readExternal( in ); assertEquals( atav, atav2 ); } @Test public void testEmptyNormValueSerializationBytes() throws LdapException, IOException, ClassNotFoundException { byte[] buffer = new byte[128]; Ava atav = new Ava( schemaManager, "DC", "" ); int pos1 = atav.serialize( buffer, 0 ); Ava atav2 = new Ava( schemaManager ); int pos2 = atav2.deserialize( buffer, 0 ); assertEquals( pos1, pos2 ); assertEquals( atav, atav2 ); } /** * Test serialization of a simple ATAV */ @Test public void testStringAtavStaticSerialization() throws LdapException, IOException, ClassNotFoundException { Ava atav = new Ava( schemaManager, "CN", "Test" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); atav.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Ava atav2 = new Ava( schemaManager ); atav2.readExternal( in ); assertEquals( atav, atav2 ); } /** * Test serialization of a simple ATAV */ @Test public void testStringAtavStaticSerializationBytes() throws LdapException, IOException, ClassNotFoundException { byte[] buffer = new byte[128]; Ava atav = new Ava( schemaManager, "CN", "Test" ); int pos1 = atav.serialize( buffer, 0 ); Ava atav2 = new Ava( schemaManager ); int pos2 = atav2.deserialize( buffer, 0 ); assertEquals( pos1, pos2 ); assertEquals( atav, atav2 ); } @Test public void testBinaryAtavStaticSerialization() throws LdapException, IOException, ClassNotFoundException { byte[] upValue = Strings.getBytesUtf8( " Test " ); Ava atav = new Ava( schemaManager, "userPKCS12", upValue ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); atav.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Ava atav2 = new Ava( schemaManager ); atav2.readExternal( in ); assertEquals( atav, atav2 ); } @Ignore @Test public void testBinaryAtavStaticSerializationBytes() throws LdapException, IOException, ClassNotFoundException { byte[] buffer = new byte[128]; byte[] upValue = Strings.getBytesUtf8( " Test " ); Ava atav = new Ava( schemaManager, "userPKCS12", upValue ); int pos1 = atav.serialize( buffer, 0 ); Ava atav2 = new Ava( schemaManager ); int pos2 = atav2.deserialize( buffer, 0 ); assertEquals( pos1, pos2 ); assertEquals( atav, atav2 ); } /** * Test static serialization of a simple ATAV */ @Test public void testNullAtavStaticSerialization() throws LdapException, IOException, ClassNotFoundException { Ava atav = new Ava( schemaManager ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); try { atav.writeExternal( out ); fail(); } catch ( IOException ioe ) { assertTrue( true ); } } /** * Test static serialization of a simple ATAV */ @Test public void testNullAtavStaticSerializationBytes() throws LdapException, IOException, ClassNotFoundException { byte[] buffer = new byte[128]; Ava atav = new Ava( schemaManager ); try { atav.serialize( buffer, 0 ); fail(); } catch ( IOException ioe ) { assertTrue( true ); } } @Test(expected = IOException.class) public void testNullNormValueStaticSerialization() throws LdapException, IOException, ClassNotFoundException { byte[] buffer = new byte[128]; Ava atav = new Ava( schemaManager, "DC", ( String ) null ); atav.serialize( buffer, 0 ); fail(); } @Test(expected = IOException.class) public void testNullNormValueStaticSerializationBytes() throws LdapException, IOException, ClassNotFoundException { Ava atav = new Ava( schemaManager, "DC", ( String ) null ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); atav.writeExternal( out ); fail(); } @Test public void testEmptyNormValueStaticSerialization() throws LdapException, IOException, ClassNotFoundException { Ava atav = new Ava( schemaManager, "DC", "" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); atav.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Ava atav2 = new Ava( schemaManager ); atav2.readExternal( in ); assertEquals( atav, atav2 ); } @Test public void testEmptyNormValueStaticSerializationBytes() throws LdapException, IOException, ClassNotFoundException { byte[] buffer = new byte[128]; Ava atav = new Ava( schemaManager, "DC", "" ); int pos1 = atav.serialize( buffer, 0 ); Ava atav2 = new Ava( schemaManager ); int pos2 = atav2.deserialize( buffer, 0 ); assertEquals( pos1, pos2 ); assertEquals( atav, atav2 ); } @Ignore @Test public void testStringAtavSerializationPerf() throws IOException, LdapException, ClassNotFoundException { Ava atav = new Ava( schemaManager, "CN", "Test" ); Ava atav2 = new Ava( schemaManager ); long t0 = System.currentTimeMillis(); for ( int i = 0; i < 10000000; i++ ) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); atav.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); atav2.readExternal( in ); } long t1 = System.currentTimeMillis(); System.out.println( "Delta ser slow = " + ( t1 - t0 ) ); } @Ignore @Test public void testStringAtavSerializationBytesPerf() throws IOException, LdapException, ClassNotFoundException { Ava atav = new Ava( schemaManager, "CN", "Test" ); Ava atav2 = new Ava( schemaManager ); long t0 = System.currentTimeMillis(); for ( int i = 0; i < 10000000; i++ ) { byte[] buffer = new byte[128]; atav.serialize( buffer, 0 ); atav2.deserialize( buffer, 0 ); } long t1 = System.currentTimeMillis(); System.out.println( "Delta ser fast = " + ( t1 - t0 ) ); } } ././@LongLink0100644 0000000 0000000 00000000173 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareDnSerializationTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareDn0100644 0000767 0000024 00000017136 13114114302 034610 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.model.name; import static org.junit.Assert.assertEquals; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; 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.manager.impl.DefaultSchemaManager; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; /** * Test the Dn Serialization * * @author Apache Directory Project */ public class SchemaAwareDnSerializationTest { private static SchemaManager schemaManager; /** * Initialize OIDs maps for normalization */ @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); } @Test public void testDnFullSerialization() throws IOException, LdapException, ClassNotFoundException { Dn dn1 = new Dn( schemaManager, "gn=john + cn=doe, dc=example, dc=com" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); dn1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Dn dn2 = new Dn( schemaManager ); dn2.readExternal( in ); assertEquals( dn1, dn2 ); } @Test public void testDnEmptySerialization() throws IOException, LdapException, ClassNotFoundException { Dn dn1 = new Dn( schemaManager ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); dn1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Dn dn2 = new Dn( schemaManager ); dn2.readExternal( in ); assertEquals( dn1, dn2 ); } @Test public void testDnSimpleSerialization() throws IOException, LdapException, ClassNotFoundException { Dn dn1 = new Dn( schemaManager, "Cn = Doe" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); dn1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Dn dn2 = new Dn( schemaManager ); dn2.readExternal( in ); assertEquals( dn1, dn2 ); assertEquals( "Cn = Doe", dn2.getName() ); assertEquals( "2.5.4.3=doe", dn2.getNormName() ); } /** * Test the serialization of a Dn * * @throws Exception */ @Test public void testNameSerialization() throws Exception { Dn dn = new Dn( "ou= Some People + dc= And Some anImAls,dc = eXample,dc= cOm" ); dn.apply( schemaManager ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); dn.writeExternal( out ); byte[] data = baos.toByteArray(); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Dn dn2 = new Dn( schemaManager ); dn2.readExternal( in ); assertEquals( dn, dn2 ); } @Test public void testSerializeEmptyDN() throws Exception { Dn dn = Dn.EMPTY_DN; ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); dn.writeExternal( out ); byte[] data = baos.toByteArray(); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Dn dn2 = new Dn( schemaManager ); dn2.readExternal( in ); assertEquals( dn, dn2 ); } /** * Test the serialization of a Dn * * @throws Exception */ @Test public void testNameStaticSerialization() throws Exception { Dn dn = new Dn( "ou= Some People + dc= And Some anImAls,dc = eXample,dc= cOm" ); dn.apply( schemaManager ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); dn.writeExternal( out ); byte[] data = baos.toByteArray(); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Dn dn2 = new Dn( schemaManager ); dn2.readExternal( in ); assertEquals( dn, dn2 ); } @Ignore @Test public void testSerializationPerfs() throws Exception { Dn dn = new Dn( "ou= Some People + dc= And Some anImAls,dc = eXample,dc= cOm" ); dn.apply( schemaManager ); long t0 = System.currentTimeMillis(); for ( int i = 0; i < 1000; i++ ) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); dn.writeExternal( out ); byte[] data = baos.toByteArray(); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Dn dn1 = new Dn( schemaManager ); dn1.readExternal( in ); } long t1 = System.currentTimeMillis(); System.out.println( "delta :" + ( t1 - t0 ) ); long t2 = System.currentTimeMillis(); for ( int i = 0; i < 1000000; i++ ) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); dn.writeExternal( out ); byte[] data = baos.toByteArray(); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Dn dn1 = new Dn( schemaManager ); dn1.readExternal( in ); dn.apply( schemaManager ); } long t3 = System.currentTimeMillis(); System.out.println( "delta :" + ( t3 - t2 ) ); //assertEquals( dn, DnSerializer.deserialize( in ) ); } @Test public void testStaticSerializeEmptyDN() throws Exception { Dn dn = Dn.EMPTY_DN; ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); dn.writeExternal( out ); byte[] data = baos.toByteArray(); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Dn dn2 = new Dn( schemaManager ); dn2.readExternal( in ); assertEquals( dn, dn2 ); } } ././@LongLink0100644 0000000 0000000 00000000174 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareRdnSerializationTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareRd0100644 0000767 0000024 00000015473 13114114302 034616 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.model.name; import static org.junit.Assert.assertEquals; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; 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.manager.impl.DefaultSchemaManager; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Test the Rdn Serialization * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class SchemaAwareRdnSerializationTest { private static SchemaManager schemaManager; /** * Initialize OIDs maps for normalization */ @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); } @Test public void testRdnFullSerialization() throws IOException, LdapException, ClassNotFoundException { Rdn rdn1 = new Rdn( schemaManager, "gn=john + cn=doe" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = new Rdn( schemaManager ); rdn2.readExternal( in ); assertEquals( rdn1, rdn2 ); } @Test public void testRdnFullSerializationBytes() throws IOException, LdapException, ClassNotFoundException { byte[] buffer = new byte[256]; Rdn rdn1 = new Rdn( schemaManager, "gn=john + cn=doe" ); int pos1 = rdn1.serialize( buffer, 0 ); Rdn rdn2 = new Rdn( schemaManager ); int pos2 = rdn2.deserialize( buffer, 0 ); assertEquals( pos1, pos2 ); assertEquals( rdn1, rdn2 ); } @Test public void testRdnEmptySerialization() throws IOException, LdapException, ClassNotFoundException { Rdn rdn1 = new Rdn( schemaManager ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = new Rdn( schemaManager ); rdn2.readExternal( in ); assertEquals( rdn1, rdn2 ); } @Test public void testRdnEmptySerializationBytes() throws IOException, LdapException, ClassNotFoundException { byte[] buffer = new byte[256]; Rdn rdn1 = new Rdn( schemaManager ); int pos1 = rdn1.serialize( buffer, 0 ); Rdn rdn2 = new Rdn( schemaManager ); int pos2 = rdn2.deserialize( buffer, 0 ); assertEquals( pos1, pos2 ); assertEquals( rdn1, rdn2 ); } @Test public void testRdnSimpleSerialization() throws IOException, LdapException, ClassNotFoundException { Rdn rdn1 = new Rdn( schemaManager, "cn=Doe" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = new Rdn( schemaManager ); rdn2.readExternal( in ); assertEquals( rdn1, rdn2 ); assertEquals( "Doe", rdn2.getValue( "cn" ) ); assertEquals( "doe", rdn2.getNormValue( "cn" ) ); assertEquals( "Doe", rdn2.getValue() ); } @Test public void testRdnSimpleSerializationBytes() throws IOException, LdapException, ClassNotFoundException { byte[] buffer = new byte[256]; Rdn rdn1 = new Rdn( schemaManager, "cn=Doe" ); int pos1 = rdn1.serialize( buffer, 0 ); Rdn rdn2 = new Rdn( schemaManager ); int pos2 = rdn2.deserialize( buffer, 0 ); assertEquals( pos1, pos2 ); assertEquals( rdn1, rdn2 ); assertEquals( "Doe", rdn2.getValue( "cn" ) ); assertEquals( "doe", rdn2.getNormValue( "cn" ) ); assertEquals( "Doe", rdn2.getValue() ); } @Ignore @Test public void testRdnFullSerializationPerf() throws IOException, LdapException, ClassNotFoundException { Rdn rdn1 = new Rdn( schemaManager, "gn=john + cn=doe" ); Rdn rdn2 = new Rdn( schemaManager ); long t0 = System.currentTimeMillis(); for ( int i = 0; i < 5000000; i++ ) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn1.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); rdn2.readExternal( in ); } long t1 = System.currentTimeMillis(); System.out.println( "Delta ser slow = " + ( t1 - t0 ) ); } @Ignore @Test public void testRdnFullSerializationBytesPerf() throws IOException, LdapException, ClassNotFoundException { Rdn rdn1 = new Rdn( schemaManager, "gn=john + cn=doe" ); Rdn rdn2 = new Rdn( schemaManager ); long t0 = System.currentTimeMillis(); for ( int i = 0; i < 5000000; i++ ) { byte[] buffer = new byte[256]; rdn1.serialize( buffer, 0 ); rdn2.deserialize( buffer, 0 ); } long t1 = System.currentTimeMillis(); System.out.println( "Delta ser fast = " + ( t1 - t0 ) ); } } ././@LongLink0100644 0000000 0000000 00000000157 13114114302 011624 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareRdnTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareRd0100644 0000767 0000024 00000111744 13114114302 034614 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.model.name; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Iterator; 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.manager.impl.DefaultSchemaManager; import org.apache.directory.api.util.Strings; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Test the Schema aware Rdn class * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class SchemaAwareRdnTest { /** A null schemaManager used in tests */ private static SchemaManager schemaManager; @BeforeClass public static void setup() throws Exception { schemaManager = new DefaultSchemaManager(); } /** * Test a null Rdn */ @Test public void testRdnNull() { assertEquals( "", new Rdn( schemaManager ).toString() ); } /** * test an empty Rdn * * @throws LdapException */ @Test public void testRdnEmpty() throws LdapException { assertEquals( "", new Rdn( schemaManager, "" ).toString() ); } /** * test a simple Rdn : cn = b * * @throws LdapException */ @Test public void testRdnSimple() throws LdapException { assertEquals( "2.5.4.3=b", new Rdn( schemaManager, "cn = b" ).getNormName() ); } /** * test a composite Rdn : cn = b, sn = e * * @throws LdapException */ @Test public void testRdnComposite() throws LdapException { assertEquals( "2.5.4.3=b+2.5.4.4=d", new Rdn( schemaManager, "cn = b + sn = d" ).getNormName() ); } /** * test a composite Rdn with or without spaces: cn=b, cn =b, cn= b, cn = b, cn = * b * * @throws LdapException */ @Test public void testRdnCompositeWithSpace() throws LdapException { assertEquals( "2.5.4.3=b", new Rdn( schemaManager, "cn=b" ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, " cn=b" ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, "cn =b" ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, "cn= b" ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, "cn=b " ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, " cn =b" ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, " cn= b" ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, " cn=b " ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, "cn = b" ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, "cn =b " ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, "cn= b " ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, " cn = b" ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, " cn =b " ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, " cn= b " ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, "cn = b " ).getNormName() ); assertEquals( "2.5.4.3=b", new Rdn( schemaManager, " cn = b " ).getNormName() ); } /** * test a simple Rdn with differents separators : cn = b + sn = d * * @throws LdapException */ @Test public void testRdnSimpleMultivaluedAttribute() throws LdapException { String result = new Rdn( schemaManager, "cn = b + sn = d" ).getNormName(); assertEquals( "2.5.4.3=b+2.5.4.4=d", result ); } /** * test a composite Rdn with differents separators : cn=b+sn=d, gn=f + l=h + * c=j * * @throws LdapException */ @Test public void testRdnCompositeMultivaluedAttribute() throws LdapException { Rdn rdn = new Rdn( schemaManager, "cn =b+sn=d + gn=f + l =h + c =j " ); // NameComponent are not ordered assertEquals( "b", rdn.getValue( "CommonName" ) ); assertEquals( "d", rdn.getValue( "2.5.4.4" ) ); assertEquals( "f", rdn.getValue( " gn " ) ); assertEquals( "h", rdn.getValue( "L" ) ); assertEquals( "j", rdn.getValue( "c" ) ); } /** * test a simple Rdn with an oid prefix (uppercase) : OID.2.5.4.3 = azerty * * @throws LdapException */ @Test public void testRdnOidUpper() throws LdapException { assertEquals( "2.5.4.3=azerty", new Rdn( schemaManager, "OID.2.5.4.3 = azerty" ).getNormName() ); } /** * test a simple Rdn with an oid prefix (lowercase) : oid.12.34.56 = azerty * * @throws LdapException */ @Test public void testRdnOidLower() throws LdapException { assertEquals( "2.5.4.3=azerty", new Rdn( schemaManager, "oid.2.5.4.3 = azerty" ).getNormName() ); } /** * test a simple Rdn with an oid attribut wiithout oid prefix : 2.5.4.3 = * azerty * * @throws LdapException */ @Test public void testRdnOidWithoutPrefix() throws LdapException { assertEquals( "2.5.4.3=azerty", new Rdn( schemaManager, "2.5.4.3 = azerty" ).getNormName() ); } /** * test a composite Rdn with an oid attribut wiithout oid prefix : 2.5.4.3 = * azerty; 2.5.4.4 = test * * @throws LdapException */ @Test public void testRdnCompositeOidWithoutPrefix() throws LdapException { String result = new Rdn( schemaManager, "2.5.4.3 = azerty + 2.5.4.4 = test" ).getNormName(); assertEquals( "2.5.4.3=azerty+2.5.4.4=test", result ); } /** * test a simple Rdn with pair char attribute value : l = \,\=\+\<\>\#\;\\\"\C3\A9" * * @throws LdapException */ @Test public void testRdnPairCharAttributeValue() throws LdapException { String rdn = Strings.utf8ToString( new byte[] { 'l', '=', '\\', ',', '\\', '=', '\\', '+', '\\', '<', '\\', '>', '#', '\\', ';', '\\', '\\', '\\', '"', '\\', 'C', '3', '\\', 'A', '9' } ); assertEquals( "2.5.4.7=\\,\\=\\+\\<\\>#\\;\\\\\\\"\u00e9", new Rdn( schemaManager, rdn ).getNormName() ); } /** * test a simple Rdn with hexString attribute value : userCertificate = #0010A0AAFF */ @Test public void testRdnHexStringAttributeValue() throws LdapException { assertEquals( "2.5.4.36=#0010A0AAFF", new Rdn( schemaManager, "userCertificate = #0010A0AAFF" ).getNormName() ); } /** * test exception from illegal hexString attribute value : cn=#zz. */ @Test public void testBadRdnHexStringAttributeValue() throws LdapException { try { new Rdn( schemaManager, "cn=#zz" ); fail(); } catch ( LdapException ine ) { assertTrue( true ); } } /** * test a simple Rdn with quoted attribute value : cn = "quoted \"value" * * @throws LdapException */ @Test public void testRdnQuotedAttributeValue() throws LdapException { assertEquals( "2.5.4.3=quoted \\\"value", new Rdn( schemaManager, "cn = quoted \\\"value" ).getNormName() ); } /** * Test the clone method for a Rdn. * * @throws LdapException */ @Test public void testRDNCloningOneNameComponent() throws LdapException { Rdn rdn = new Rdn( schemaManager, "CN", "B" ); Rdn rdnClone = rdn.clone(); rdn = new Rdn( schemaManager, "cn=d" ); assertEquals( "b", rdnClone.getNormValue( "Cn" ) ); } /** * Test the creation of a new Rdn * * @throws org.apache.directory.api.ldap.model.exception.LdapException */ @Test public void testRDNCreation() throws LdapException { Rdn rdn = new Rdn( schemaManager, "CN", " b " ); assertEquals( "2.5.4.3=b", rdn.getNormName() ); assertEquals( "CN= b ", rdn.getName() ); } /** * Test the clone method for a Rdn. * * @throws LdapException */ @Test public void testRDNCloningTwoNameComponent() throws LdapException { Rdn rdn = new Rdn( schemaManager, "cn = b + sn = bb" ); Rdn rdnClone = rdn.clone(); rdn.clear(); rdn = new Rdn( schemaManager, "l=d" ); assertEquals( "b", rdnClone.getValue( "2.5.4.3" ) ); assertEquals( "bb", rdnClone.getValue( "SN" ) ); assertEquals( "", rdnClone.getValue( "l" ) ); } /** * Test the equals method for a Rdn. * * @throws LdapException */ @Test public void testRDNCompareToNull() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b + sn = d + l = f + gn = h " ); Rdn rdn2 = null; assertFalse( rdn1.equals( rdn2 ) ); } /** * Compares a composite NC to a single NC. * * @throws LdapException */ @Test public void testRDNCompareToNCS2NC() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b + sn = d + l = f + gn = h " ); Rdn rdn2 = new Rdn( schemaManager, " cn = b " ); assertFalse( rdn1.equals( rdn2 ) ); } /** * Compares a single NC to a composite NC. * * @throws LdapException */ @Test public void testRDNCompareToNC2NCS() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " sn = b " ); Rdn rdn2 = new Rdn( schemaManager, " cn = b + sn = d + l = f + gn = h " ); assertFalse( rdn1.equals( rdn2 ) ); } /** * Compares a composite NCS to a composite NCS in the same order. * * @throws LdapException */ @Test public void testRDNCompareToNCS2NCSOrdered() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b + sn = d + gn = f + l = h " ); Rdn rdn2 = new Rdn( schemaManager, " cn = b + sn = d + gn = f + l = h " ); assertTrue( rdn1.equals( rdn2 ) ); } /** * Compares a composite NCS to a composite NCS in a different order. * * @throws LdapException */ @Test public void testRDNCompareToNCS2NCSUnordered() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b + gn = f + l = h + sn = d " ); Rdn rdn2 = new Rdn( schemaManager, " cn = b + sn = d + gn = f + l = h " ); assertTrue( rdn1.equals( rdn2 ) ); } /** * Compares a composite NCS to a different composite NCS. * * @throws LdapException */ @Test public void testRDNCompareToNCS2NCSNotEquals() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = f + sn = h + l = d " ); Rdn rdn2 = new Rdn( schemaManager, " l = d + cn = h + sn = h " ); assertFalse( rdn1.equals( rdn2 ) ); assertFalse( rdn2.equals( rdn1 ) ); } /** * Test for DIRSHARED-2. * The first ATAV is equal, the second or following ATAV differs. * * @throws LdapException */ @Test public void testCompareSecondAtav() throws LdapException { // the second ATAV differs Rdn rdn1 = new Rdn( schemaManager, " cn = b + sn = d " ); Rdn rdn2 = new Rdn( schemaManager, " cn = b + sn = y " ); assertFalse( rdn1.equals( rdn2 ) ); assertFalse( rdn2.equals( rdn1 ) ); // the third ATAV differs Rdn rdn3 = new Rdn( schemaManager, " cn = b + sn = d + l = f " ); Rdn rdn4 = new Rdn( schemaManager, " cn = b + sn = d + l = y " ); assertFalse( rdn3.equals( rdn4 ) ); assertFalse( rdn4.equals( rdn3 ) ); // the second ATAV differs in value only Rdn rdn5 = new Rdn( schemaManager, " cn = b + sn = c " ); Rdn rdn6 = new Rdn( schemaManager, " cn = b + sn = y " ); assertFalse( rdn5.equals( rdn6 ) ); assertFalse( rdn6.equals( rdn5 ) ); } /** * Test for DIRSHARED-2. * The compare operation should return a correct value (1 or -1) * depending on the ATAVs, not on their position. * * @throws LdapException */ @Test public void testCompareIndependentFromOrder() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b + sn = d " ); Rdn rdn2 = new Rdn( schemaManager, " sn = d + cn = b " ); assertTrue( rdn1.equals( rdn2 ) ); rdn1 = new Rdn( schemaManager, " cn = b + sn = e " ); rdn2 = new Rdn( schemaManager, " sn = d + cn = b " ); assertFalse( rdn1.equals( rdn2 ) ); assertFalse( rdn2.equals( rdn1 ) ); rdn1 = new Rdn( schemaManager, " cn = b + sn = d " ); rdn2 = new Rdn( schemaManager, " l = f + gn = h " ); assertFalse( rdn1.equals( rdn2 ) ); assertFalse( rdn2.equals( rdn1 ) ); } /** * Test for DIRSHARED-3. * Tests that equals() is invertable for single-valued RDNs. * * @throws LdapException */ @Test public void testCompareInvertableNC2NC() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b " ); Rdn rdn2 = new Rdn( schemaManager, " cn = c " ); assertFalse( rdn1.equals( rdn2 ) ); assertFalse( rdn2.equals( rdn1 ) ); } /** * Test for DIRSHARED-3. * Tests that equals() is invertable for multi-valued RDNs with different values. * * @throws LdapException */ @Test public void testCompareInvertableNCS2NCSDifferentValues() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b + sn = c " ); Rdn rdn2 = new Rdn( schemaManager, " cn = b + sn = y " ); assertFalse( rdn1.equals( rdn2 ) ); assertFalse( rdn2.equals( rdn1 ) ); } /** * Test for DIRSHARED-3. * Tests that equals() is invertable for multi-valued RDNs with different types. * * @throws org.apache.directory.api.ldap.model.exception.LdapException */ @Test public void testCompareInvertableNCS2NCSDifferentTypes() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b + sn = d " ); Rdn rdn2 = new Rdn( schemaManager, " l = f + gn = h " ); assertFalse( rdn1.equals( rdn2 ) ); assertFalse( rdn2.equals( rdn1 ) ); } /** * Test for DIRSHARED-3. * Tests that equals() is invertable for multi-valued RDNs with different order. * * @throws LdapException */ @Test public void testCompareInvertableNCS2NCSUnordered() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " sn = d + cn = b " ); Rdn rdn2 = new Rdn( schemaManager, " cn = b + l = f " ); assertFalse( rdn1.equals( rdn2 ) ); assertFalse( rdn2.equals( rdn1 ) ); } /** * Compares with a null Rdn. * * @throws LdapException */ @Test public void testRDNCompareToNullRdn() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b " ); assertFalse( rdn1.equals( null ) ); } /** * Compares a simple NC to a simple NC. * * @throws LdapException */ @Test public void testRDNCompareToNC2NC() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b " ); Rdn rdn2 = new Rdn( schemaManager, " cn = b " ); assertTrue( rdn1.equals( rdn2 ) ); } /** * Compares a simple NC to a simple NC in UperCase. * * @throws LdapException */ @Test public void testRDNCompareToNC2NCUperCase() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b " ); Rdn rdn2 = new Rdn( schemaManager, " CN = b " ); assertTrue( rdn1.equals( rdn2 ) ); } /** * Compares a simple NC to a different simple NC. * * @throws LdapException */ @Test public void testRDNCompareToNC2NCNotEquals() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, " cn = b " ); Rdn rdn2 = new Rdn( schemaManager, " CN = d " ); assertFalse( rdn1.equals( rdn2 ) ); } /** * * Test the getValue method. * * @throws LdapException */ @Test public void testGetValue() throws LdapException { Rdn rdn = new Rdn( schemaManager, " cn = b + sn = f + gn = h + l = d " ); assertEquals( "b", rdn.getNormValue() ); } /** * * Test the getType method. * * @throws LdapException */ @Test public void testGetType() throws LdapException { Rdn rdn = new Rdn( schemaManager, " cn = b + sn = f + gn = h + l = d " ); assertEquals( "2.5.4.3", rdn.getNormType() ); } /** * Test the getSize method. * * @throws LdapException */ @Test public void testGetSize() throws LdapException { Rdn rdn = new Rdn( schemaManager, " cn = b + sn = f + gn = h + l = d " ); assertEquals( 4, rdn.size() ); } /** * Test the getSize method. * */ @Test public void testGetSize0() { Rdn rdn = new Rdn( schemaManager ); assertEquals( 0, rdn.size() ); } /** * Test the equals method * * @throws LdapException */ @Test public void testEquals() throws LdapException { Rdn rdn = new Rdn( schemaManager, "cn=b + sn=d + gn=f" ); assertFalse( rdn.equals( null ) ); assertFalse( rdn.equals( "test" ) ); assertFalse( rdn.equals( new Rdn( schemaManager, "cn=c + sn=d + gn=f" ) ) ); assertFalse( rdn.equals( new Rdn( schemaManager, "cn=b" ) ) ); assertTrue( rdn.equals( new Rdn( schemaManager, "cn=b + sn=d + gn=f" ) ) ); assertTrue( rdn.equals( new Rdn( schemaManager, "cn=b + SN=d + GN=f" ) ) ); assertTrue( rdn.equals( new Rdn( schemaManager, "sn=d + gn=f + CN=b" ) ) ); } @Test public void testUnescapeValueHexa() { byte[] res = ( byte[] ) Rdn.unescapeValue( "#fF" ); assertEquals( "0xFF ", Strings.dumpBytes( res ) ); res = ( byte[] ) Rdn.unescapeValue( "#0123456789aBCDEF" ); assertEquals( "0x01 0x23 0x45 0x67 0x89 0xAB 0xCD 0xEF ", Strings.dumpBytes( res ) ); } @Test public void testUnescapeValueHexaWrong() { try { Rdn.unescapeValue( "#fF1" ); fail(); // Should not happen } catch ( IllegalArgumentException iae ) { assertTrue( true ); } } @Test public void testUnescapeValueString() { String res = ( String ) Rdn.unescapeValue( "azerty" ); assertEquals( "azerty", res ); } @Test public void testUnescapeValueStringSpecial() { String res = ( String ) Rdn.unescapeValue( "\\\\\\#\\,\\+\\;\\<\\>\\=\\\"\\ " ); assertEquals( "\\#,+;<>=\" ", res ); } @Test public void testUnescapeValueStringWithSpaceInTheMiddle() { String res = ( String ) Rdn.unescapeValue( "a b" ); assertEquals( "a b", res ); } @Test public void testUnescapeValueStringWithSpaceInAtTheBeginning() { String res = ( String ) Rdn.unescapeValue( "\\ a b" ); assertEquals( " a b", res ); } @Test public void testUnescapeValueStringWithSpaceInAtTheEnd() { String res = ( String ) Rdn.unescapeValue( "a b\\ " ); assertEquals( "a b ", res ); } @Test public void testUnescapeValueStringWithPoundInTheMiddle() { String res = ( String ) Rdn.unescapeValue( "a#b" ); assertEquals( "a#b", res ); } @Test public void testUnescapeValueStringWithPoundAtTheEnd() { String res = ( String ) Rdn.unescapeValue( "ab#" ); assertEquals( "ab#", res ); } @Test public void testEscapeValueString() { String res = Rdn.escapeValue( Strings.getBytesUtf8( "azerty" ) ); assertEquals( "azerty", res ); } @Test public void testEscapeValueStringSpecial() { String res = Rdn.escapeValue( Strings.getBytesUtf8( "\\#,+;<>=\" " ) ); assertEquals( "\\\\#\\,\\+\\;\\<\\>\\=\\\"\\ ", res ); } @Test public void testEscapeValueNumeric() { String res = Rdn.escapeValue( new byte[] { '-', 0x00, '-', 0x1F, '-', 0x7F, '-' } ); assertEquals( "-\\00-\\1F-\\7F-", res ); } @Test public void testEscapeValueMix() { String res = Rdn.escapeValue( new byte[] { '\\', 0x00, '-', '+', '#', 0x7F, '-' } ); assertEquals( "\\\\\\00-\\+#\\7F-", res ); } @Test public void testDIRSERVER_703() throws LdapException { Rdn rdn = new Rdn( schemaManager, "cn=Kate Bush+sn=Bush" ); assertEquals( "cn=Kate Bush+sn=Bush", rdn.getName() ); } @Test public void testMultiValuedIterator() throws LdapException { Rdn rdn = new Rdn( schemaManager, "cn=Kate Bush+sn=Bush" ); Iterator iterator = rdn.iterator(); assertNotNull( iterator ); assertTrue( iterator.hasNext() ); assertNotNull( iterator.next() ); assertTrue( iterator.hasNext() ); assertNotNull( iterator.next() ); assertFalse( iterator.hasNext() ); } @Test public void testSingleValuedIterator() throws LdapException { Rdn rdn = new Rdn( schemaManager, "cn=Kate Bush" ); Iterator iterator = rdn.iterator(); assertNotNull( iterator ); assertTrue( iterator.hasNext() ); assertNotNull( iterator.next() ); assertFalse( iterator.hasNext() ); } @Test public void testEmptyIterator() { Rdn rdn = new Rdn( schemaManager ); Iterator iterator = rdn.iterator(); assertNotNull( iterator ); assertFalse( iterator.hasNext() ); } @Test public void testRdnWithSpaces() throws LdapException { Rdn rdn = new Rdn( schemaManager, "cn=a\\ b\\ c" ); assertEquals( "2.5.4.3=a b c", rdn.getNormName() ); } /* @Test public void testEscapedSpaceInValue() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, "cn=a b c" ); Rdn rdn2 = new Rdn( schemaManager, "cn=a\\ b\\ c" ); assertEquals( "2.5.4.3=a b c", rdn1.getNormName() ); assertEquals( "2.5.4.3=a b c", rdn2.getNormName() ); assertTrue( rdn1.equals( rdn2 ) ); Rdn rdn3 = new Rdn( schemaManager, "cn=\\ a b c\\ " ); Rdn rdn4 = new Rdn( schemaManager, "cn=\\ a\\ b\\ c\\ " ); assertEquals( "2.5.4.3= a b c ", rdn3.getNormName() ); assertEquals( "cn=\\ a b c\\ ", rdn3.getName() ); assertEquals( "2.5.4.3=\\ a b c\\ ", rdn4.getNormName() ); assertEquals( "cn=\\ a\\ b\\ c\\ ", rdn4.getName() ); assertTrue( rdn3.equals( rdn4 ) ); } */ /* public void testEscapedSpaceInValue2() throws LdapException { Rdn rdn = new Rdn( schemaManager, "cn=\\ a\\ " ); assertEquals( "cn=\\ a\\ ", rdn.getName() ); assertEquals( "2.5.4.3=\\ a\\ ", rdn.getNormName() ); } */ @Test public void testEscapedSpaceInValue() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, "cn=a b c" ); assertEquals( "2.5.4.3=a b c", rdn1.getNormName() ); Rdn rdn2 = new Rdn( schemaManager, "cn=a\\ b\\ c" ); assertEquals( "2.5.4.3=a b c", rdn2.getNormName() ); assertTrue( rdn1.equals( rdn2 ) ); Rdn rdn3 = new Rdn( schemaManager, "cn=\\ a b c\\ " ); assertEquals( "2.5.4.3=\\ a b c\\ ", rdn3.getNormName() ); assertEquals( "cn=\\ a b c\\ ", rdn3.getName() ); Rdn rdn4 = new Rdn( schemaManager, "cn=\\ a\\ b\\ c\\ " ); assertEquals( "2.5.4.3=\\ a b c\\ ", rdn4.getNormName() ); assertEquals( "cn=\\ a\\ b\\ c\\ ", rdn4.getName() ); assertTrue( rdn3.equals( rdn4 ) ); } /** * attributeValue = string / hexstring * string = [ ( leadchar / pair ) [ *( stringchar / pair ) * ( trailchar / pair ) ] ] * leadchar = LUTF1 / UTFMB * pair = ESC ( ESC / special / hexpair ) * special = escaped / SPACE / SHARP / EQUALS * * --> replace with * * '\#' will be replaced by '#' */ @Test public void testEscapedHashInValue2() throws LdapException { Rdn rdn = new Rdn( schemaManager, "cn=a\\#b" ); assertEquals( "2.5.4.3=a#b", rdn.getNormName() ); assertEquals( "cn=a\\#b", rdn.getName() ); // Check the AVA assertEquals( "2.5.4.3=a#b", rdn.getAva().getNormName() ); assertEquals( "cn=a\\#b", rdn.getAva().getName() ); // Check the value assertEquals( "a#b", rdn.getAva().getValue().getNormValue() ); assertEquals( "a\\#b", rdn.getAva().getValue().getString() ); } @Test public void testEscapedHashInValue() throws LdapException { Rdn rdn1 = new Rdn( schemaManager, "cn=a#b#c" ); Rdn rdn2 = new Rdn( schemaManager, "cn=a\\#b\\#c" ); assertEquals( "2.5.4.3=a#b#c", rdn1.getNormName() ); assertEquals( "2.5.4.3=a#b#c", rdn2.getNormName() ); assertTrue( rdn1.equals( rdn2 ) ); Rdn rdn3 = new Rdn( schemaManager, "cn=\\#a#b#c\\#" ); Rdn rdn4 = new Rdn( schemaManager, "cn=\\#a\\#b\\#c\\#" ); assertEquals( "2.5.4.3=\\#a#b#c#", rdn3.getNormName() ); assertEquals( "2.5.4.3=\\#a#b#c#", rdn4.getNormName() ); assertTrue( rdn3.equals( rdn4 ) ); } @Test public void testEscapedAttributeValue() { // space doesn't need to be escaped in the middle of a string assertEquals( "a b", Rdn.escapeValue( "a b" ) ); assertEquals( "\u00e4 b c", Rdn.escapeValue( "\u00e4 b c" ) ); assertEquals( "a b c d", Rdn.escapeValue( "a b c d" ) ); // space must be escaped at the beginning and the end of a string assertEquals( "\\ a b", Rdn.escapeValue( " a b" ) ); assertEquals( "a b\\ ", Rdn.escapeValue( "a b " ) ); assertEquals( "\\ a b\\ ", Rdn.escapeValue( " a b " ) ); assertEquals( "\\ a b \\ ", Rdn.escapeValue( " a b " ) ); // hash doesn't need to be escaped in the middle and the end of a string assertEquals( "a#b", Rdn.escapeValue( "a#b" ) ); assertEquals( "a#b#", Rdn.escapeValue( "a#b#" ) ); assertEquals( "a#b#c", Rdn.escapeValue( "a#b#c" ) ); assertEquals( "a#b#c#", Rdn.escapeValue( "a#b#c#" ) ); assertEquals( "a#b#c#d", Rdn.escapeValue( "a#b#c#d" ) ); assertEquals( "a#b#c#d#", Rdn.escapeValue( "a#b#c#d#" ) ); // hash must be escaped at the beginning of a string assertEquals( "\\#a#b", Rdn.escapeValue( "#a#b" ) ); assertEquals( "\\##a#b", Rdn.escapeValue( "##a#b" ) ); // other characters that need to be escaped // '"', '+', ',', ';', '<', '>', '\', the null (U+0000) character assertEquals( "\\\"\\+\\,\\;\\<\\>\\\\\\00", Rdn.escapeValue( "\"+,;<>\\\u0000" ) ); // unicode characters don't need to be escaped // \u00e9 - e with acute - 2 bytes in UTF-8 // \u20ac - Euro character - 3 bytes in UTF-8 // \uD83D\uDE08 - Smiley - 4 bytes in UTF-8 assertEquals( "\u00e9\u20AC\uD83D\uDE08", Rdn.escapeValue( "\u00e9\u20AC\uD83D\uDE08" ) ); } /** Serialization tests ------------------------------------------------- */ /** * Test serialization of an empty Rdn */ @Test public void testEmptyRDNSerialization() throws LdapException, IOException, ClassNotFoundException { Rdn rdn = new Rdn( schemaManager, "" ); rdn.normalize(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); out.writeObject( rdn ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = ( Rdn ) in.readObject(); assertEquals( rdn, rdn2 ); } @Test public void testNullRdnSerialization() throws IOException, ClassNotFoundException { Rdn rdn = new Rdn( schemaManager ); rdn.normalize(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); out.writeObject( rdn ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = ( Rdn ) in.readObject(); assertEquals( rdn, rdn2 ); } /** * Test serialization of a simple Rdn */ @Test public void testSimpleRdnSerialization() throws LdapException, IOException, ClassNotFoundException { Rdn rdn = new Rdn( schemaManager, "cn=b" ); rdn.normalize(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = new Rdn( schemaManager ); rdn2.readExternal( in ); assertEquals( rdn, rdn2 ); } /** * Test serialization of a simple Rdn */ @Test public void testSimpleRdn2Serialization() throws LdapException, IOException, ClassNotFoundException { Rdn rdn = new Rdn( schemaManager, " CN = DEF " ); rdn.normalize(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = new Rdn( schemaManager ); rdn2.readExternal( in ); assertEquals( rdn, rdn2 ); } /** * Test serialization of a simple Rdn with no value */ @Test public void testSimpleRdnNoValueSerialization() throws LdapException, IOException, ClassNotFoundException { Rdn rdn = new Rdn( schemaManager, " DC =" ); rdn.normalize(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = new Rdn( schemaManager ); rdn2.readExternal( in ); assertEquals( rdn, rdn2 ); } /** * Test serialization of a simple Rdn with one value */ @Test public void testSimpleRdnOneValueSerialization() throws LdapException, IOException, ClassNotFoundException { Rdn rdn = new Rdn( schemaManager, " CN = def " ); rdn.normalize(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = new Rdn( schemaManager ); rdn2.readExternal( in ); assertEquals( rdn, rdn2 ); } /** * Test serialization of a simple Rdn with three values */ @Test public void testSimpleRdnThreeValuesSerialization() throws LdapException, IOException, ClassNotFoundException { Rdn rdn = new Rdn( schemaManager, " CN = a + SN = b + GN = c " ); rdn.normalize(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = new Rdn( schemaManager ); rdn2.readExternal( in ); assertEquals( rdn, rdn2 ); } /** * Test serialization of a simple Rdn with three unordered values */ @Test public void testSimpleRdnThreeValuesUnorderedSerialization() throws LdapException, IOException, ClassNotFoundException { Rdn rdn = new Rdn( schemaManager, " CN = b + SN = a + GN = c " ); rdn.normalize(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(); in = new ObjectInputStream( new ByteArrayInputStream( data ) ); Rdn rdn2 = new Rdn( schemaManager ); rdn2.readExternal( in ); assertEquals( rdn, rdn2 ); } /** * test an Rdn with empty value */ @Test public void testRdnWithEmptyValue() throws LdapException { assertTrue( Rdn.isValid( "dc=" ) ); assertTrue( Rdn.isValid( "dc=\"\"" ) ); assertEquals( "0.9.2342.19200300.100.1.25=", new Rdn( schemaManager, "dc=" ).getNormName() ); assertEquals( "0.9.2342.19200300.100.1.25=", new Rdn( schemaManager, "dc=\"\"" ).getNormName() ); } /** * test an Rdn with escaped comma */ @Test public void testRdnWithEscapedComa() throws LdapException { assertTrue( Rdn.isValid( "cn=b\\,c" ) ); assertEquals( "2.5.4.3=b\\,c", new Rdn( schemaManager, "cn=b\\,c" ).getNormName() ); assertTrue( Rdn.isValid( "cn=\"b,c\"" ) ); assertEquals( "2.5.4.3=b\\,c", new Rdn( schemaManager, "cn=\"b,c\"" ).getNormName() ); assertEquals( "cn=\"b,c\"", new Rdn( schemaManager, "cn=\"b,c\"" ).getName() ); assertTrue( Rdn.isValid( "cn=\"b\\,c\"" ) ); Rdn rdn = new Rdn( schemaManager, "cn=\"b\\,c\"" ); assertEquals( "cn=\"b\\,c\"", rdn.getName() ); assertEquals( "2.5.4.3=b\\,c", rdn.getNormName() ); } /** * Tests the equals and equals results of cloned multi-valued RDNs. * Test for DIRSHARED-9. * * @throws LdapException */ @Test public void testComparingOfClonedMultiValuedRDNs() throws LdapException { // Use upper case attribute types to test if normalized types are used // for comparison Rdn rdn = new Rdn( schemaManager, " CN = b + SN = d" ); Rdn clonedRdn = rdn.clone(); assertTrue( rdn.equals( clonedRdn ) ); } /** * Tests the equals and equals results of copy constructed multi-valued RDNs. * Test for DIRSHARED-9. * * @throws LdapException */ @Test public void testComparingOfCopyConstructedMultiValuedRDNs() throws LdapException { // Use upper case attribute types to test if normalized types are used // for comparison Rdn rdn = new Rdn( schemaManager, " CN = b + SN = d" ); Rdn copiedRdn = new Rdn( rdn ); assertTrue( rdn.equals( copiedRdn ) ); } /** * test the UpName method on a Rdn with more than one atav */ @Test public void testGetUpNameMultipleAtav() throws LdapException { Rdn rdn = new Rdn( schemaManager, " CN = b + SN = d " ); assertEquals( " CN = b + SN = d ", rdn.getName() ); } @Test public void testSchemaAware() throws LdapException { Rdn rdn = new Rdn( "cn=John" ); assertFalse( rdn.isSchemaAware() ); rdn.apply( schemaManager ); assertTrue( rdn.isSchemaAware() ); } } ././@LongLink0100644 0000000 0000000 00000000200 13114114302 011611 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/AC0100644 0000767 0000024 00000030414 13114114302 034641 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.schema.syntaxCheckers; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.apache.directory.api.ldap.aci.ACIItemSyntaxChecker; 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; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Test cases for ACIItemSyntaxChecker. * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class ACIItemSyntaxCheckerTest { private static ACIItemSyntaxChecker checker; @BeforeClass public static void init() throws Exception { JarLdifSchemaLoader loader = new JarLdifSchemaLoader(); SchemaManager schemaManager = new DefaultSchemaManager( loader ); schemaManager.loadAllEnabled(); checker = ACIItemSyntaxChecker.INSTANCE; checker.setSchemaManager( schemaManager ); } @Test public void testNullString() { assertFalse( checker.isValidSyntax( null ) ); } @Test public void testEmptyString() { assertFalse( checker.isValidSyntax( "" ) ); } @Test public void testOid() { assertEquals( "1.3.6.1.4.1.1466.115.121.1.1", checker.getOid() ); } @Test public void testCorrectCase() { } /** * Tests the checker with an ACIItem of ItemFirst main component. */ @Test public void testItemFirst() { String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , " + "itemOrUserFirst itemFirst :{ protectedItems { entry , attributeType { 1.2.3 , ou } , " + " attributeValue { ou=people , cn=Ersin } , rangeOfValues (cn=ErsinEr) , " + "classes and : { item: xyz , or:{item:X,item:Y} }} , " + "itemPermissions { { userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } }," + "{ precedence 10, userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}"; assertTrue( checker.isValidSyntax( spec ) ); } /** * Tests the checker with an ACIItem of UserFirst main component. */ @Test public void testUserFirst() { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {cn=y,sn=n,dc=l} , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } } } "; assertTrue( checker.isValidSyntax( spec ) ); } @Test public void testAllowAddAllUsers() { String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, " + "itemOrUserFirst userFirst: { " + "userClasses { allUsers }, " + "userPermissions { { protectedItems {entry}, " + "grantsAndDenials { grantAdd } } } } }"; assertTrue( checker.isValidSyntax( spec ) ); } @Test public void testCombo() { String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, " + "itemOrUserFirst userFirst: { " + "userClasses { allUsers, name { \"ou=blah\" } }, " + "userPermissions { { protectedItems {entry}, " + "grantsAndDenials { grantAdd } } } } }"; assertTrue( checker.isValidSyntax( spec ) ); } @Test public void testOrderOfProtectedItemsDoesNotMatter() { String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , " + "itemOrUserFirst itemFirst :{ protectedItems { attributeType { 1.2.3 , ou }, entry , " + " rangeOfValues (cn=ErsinEr) , attributeValue { ou=people , cn=Ersin }," + "classes and : { item: xyz , or:{item:X,item:Y} }} , " + "itemPermissions { { userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } }," + "{ precedence 10, userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}"; assertTrue( checker.isValidSyntax( spec ) ); } @Test public void testOrderOfUserClassesDoesNotMatter() { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { name { \"ou=people,cn=ersin\" }, allUsers, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {cn=y,sn=n,dc=l} , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } } } "; assertTrue( checker.isValidSyntax( spec ) ); } @Test public void testItemPermissionComponentsOrderDoesNotMatter() { String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , " + "itemOrUserFirst itemFirst :{ protectedItems { attributeType { 1.2.3 , ou }, entry , " + " rangeOfValues (cn=ErsinEr) , attributeValue { ou=people , cn=Ersin }," + "classes and : { item: xyz , or:{item:X,item:Y} }} , " + "itemPermissions { { grantsAndDenials { denyCompare , grantModify }, userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } } }," + "{ precedence 10, userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}"; assertTrue( checker.isValidSyntax( spec ) ); } @Test public void testUserPermissionComponentsOrderDoesNotMatter() { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { grantsAndDenials { grantBrowse }, protectedItems{ entry , attributeType { cn , ou } , attributeValue {cn=y,sn=n,dc=l} , " + "rangeOfValues (cn=ErsinEr) } } } } } "; assertTrue( checker.isValidSyntax( spec ) ); } @Test public void testOrderOfMainACIComponentsDoesNotMatter() { String spec = "{ itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {cn=y,sn=n,dc=l} , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } }, " + " identificationTag \"id2\" , authenticationLevel none, precedence 14 } "; assertTrue( checker.isValidSyntax( spec ) ); } @Test public void testRestrictedValueComponentsOrderDoesNotMatter() { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\"}, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , " + "maxValueCount { { type 10.11.12, maxCount 10 }, { maxCount 20, type 11.12.13 } } " + " } , grantsAndDenials { grantBrowse } } } } } "; assertTrue( checker.isValidSyntax( spec ) ); } @Test public void testMaxValueCountComponentsOrderDoesNotMatter() { String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , " + "userPermissions { { protectedItems{ entry , " + "restrictedBy { { type 10.11.12, valuesIn ou }, { valuesIn cn, type 11.12.13 } } " + " } , grantsAndDenials { grantBrowse } } } } } "; assertTrue( checker.isValidSyntax( spec ) ); } /** * Test case for DIRSERVER-891 */ @Test public void testInvalidAttributeValue() { String spec; // no name-value-pair spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue { must_be_a_name_value_pair } , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } }, userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + " maximum 2, minimum 1 } } } } } "; assertFalse( checker.isValidSyntax( spec ) ); // no name-value-pair spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , " + "itemOrUserFirst userFirst: { userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue { x=y,m=n,k=l,x } , " + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } }, userClasses { allUsers , name { \"ou=people,cn=ersin\" }, " + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + " maximum 2, minimum 1 } } } } } "; assertFalse( checker.isValidSyntax( spec ) ); } /** * Test case for DIRSERVER-891 */ @Test public void testIncomplete() { String spec; spec = "{ }"; assertFalse( checker.isValidSyntax( spec ) ); spec = "{ identificationTag \"id2\" }"; assertFalse( checker.isValidSyntax( spec ) ); spec = "{ identificationTag \"id2\", precedence 14 } "; assertFalse( checker.isValidSyntax( spec ) ); spec = "{ identificationTag \"id2\", precedence 14, authenticationLevel none } "; assertFalse( checker.isValidSyntax( spec ) ); } } ././@LongLink0100644 0000000 0000000 00000000215 13114114302 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxCheckerTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/Su0100644 0000767 0000024 00000022577 13114114302 034760 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.schema.syntaxCheckers; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.ldap.model.schema.syntaxCheckers.SubtreeSpecificationSyntaxChecker; import org.apache.directory.api.ldap.schema.loader.JarLdifSchemaLoader; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; /** * Test cases for SubtreeSpecificationSyntaxChecker. * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class SubtreeSpecificationSyntaxCheckerTest { private static SubtreeSpecificationSyntaxChecker checker; /** * Initialization */ @BeforeClass public static void init() throws Exception { JarLdifSchemaLoader loader = new JarLdifSchemaLoader(); SchemaManager schemaManager = new DefaultSchemaManager( loader ); schemaManager.loadAllEnabled(); checker = SubtreeSpecificationSyntaxChecker.INSTANCE; checker.setSchemaManager( schemaManager ); } @Test public void testNullString() { assertFalse( checker.isValidSyntax( null ) ); } @Test public void testEmptyString() { assertFalse( checker.isValidSyntax( "" ) ); } @Test public void testOid() { assertEquals( "1.3.6.1.4.1.1466.115.121.1.45", checker.getOid() ); } @Test public void testCorrectCase() { } /** A valid empty specification with single white space between brackets */ private static final String EMPTY_SPEC = "{ }"; /** A valid specification only with base set */ private static final String SPEC_WITH_BASE = "{ base \"ou=system\" }"; /** An invalid specification with missing white space and base set */ private static final String INVALID_SPEC_WITH_BASE_AND_MISSING_WS = "{ base\"ou=system\"}"; /** A valid specification with some specific exclusions set */ private static final String SPEC_WITH_SPECIFICEXCLUSIONS = "{ specificExclusions { chopAfter:\"ef=gh\", chopBefore:\"ab=cd\" } }"; /** A valid specification with empty specific exclusions set */ private static final String SPEC_WITH_EMPTY_SPECIFICEXCLUSIONS = "{ specificExclusions { } }"; /** A valid specification with minimum and maximum set */ private static final String SPEC_WITH_MINIMUM_AND_MAXIMUM = "{ minimum 1, maximum 2 }"; /** A valid specification with base and minimum and maximum set */ private static final String SPEC_WITH_BASE_AND_MINIMUM_AND_MAXIMUM = "{ base \"ou=ORGANIZATION UNIT\", minimum 1, maximum 2 }"; /** * A valid specification with base and specific exclusions and minimum and * maximum set */ private static final String SPEC_WITH_BASE_AND_SPECIFICEXCLUSIONS_AND_MINIMUM_AND_MAXIMUM = "{ base \"ou=people\", specificExclusions { chopBefore:\"x=y\"" + ", chopAfter:\"k=l\", chopBefore:\"y=z\", chopAfter:\"l=m\" }, minimum 7, maximum 77 }"; /** A valid specification with refinement set */ private static final String SPEC_WITH_REFINEMENT = "{ base \"ou=system\", specificationFilter and:{ and:{ item:1.2.3" + ", or:{ item:4.5.6, item:person-7 } }, not: item:10.11.12 } }"; /** A valid specification with base and an empty refinement set */ private static final String SPEC_WITH_BASE_AND_EMPTY_REFINEMENT = "{ base \"ou=system\", specificationFilter and:{ } }"; /** A valid specification with ALL IN ONE */ private static final String SPEC_WITH_ALL_IN_ONE = "{ base \"ou=departments\"" + ", specificExclusions { chopBefore:\"x=y\", chopAfter:\"k=l\", chopBefore:\"y=z\", chopAfter:\"l=m\" }" + ", minimum 7, maximum 77" + ", specificationFilter and:{ and:{ item:1.2.3, or:{ item:4.5.6, item:7.8.9 } }, not: item:10.11.12 } }"; /** An valid specification with unordinary component order */ private static final String SPEC_ORDER_OF_COMPONENTS_DOES_NOT_MATTER = "{ base \"ou=system\", minimum 3, specificExclusions { chopBefore:\"x=y\" } }"; /** An invalid specification with completely unrelated content */ private static final String INVALID_SILLY_THING = "How much wood would a wood chuck chuck if a wood chuck would chuck wood?"; /** A valid specification with filter expression */ private static final String SPEC_WITH_FILTER = "{ base \"ou=system\", specificationFilter (&(cn=test)(sn=test)) }"; /** * Tests the parser with a valid empty specification. */ @Test public void testEmptySpec() throws Exception { assertTrue( checker.isValidSyntax( EMPTY_SPEC ) ); // try a second time assertTrue( checker.isValidSyntax( EMPTY_SPEC ) ); // try a third time assertTrue( checker.isValidSyntax( EMPTY_SPEC ) ); } /** * Tests the parser with a valid specification with base set. */ @Test public void testSpecWithBase() throws Exception { assertTrue( checker.isValidSyntax( SPEC_WITH_BASE ) ); } /** * Tests the parser with an invalid specification with missing white spaces * and base set. */ @Test public void testInvalidSpecWithBaseAndMissingWS() throws Exception { assertFalse( checker.isValidSyntax( INVALID_SPEC_WITH_BASE_AND_MISSING_WS ) ); } /** * Tests the parser with a valid specification with some specific exclusions * set. */ @Test public void testSpecWithSpecificExclusions() throws Exception { assertTrue( checker.isValidSyntax( SPEC_WITH_SPECIFICEXCLUSIONS ) ); } /** * Tests the parser with a valid specification with an empty specific * exclusions set. */ @Test public void testSpecWithEmptySpecificExclusions() throws Exception { assertTrue( checker.isValidSyntax( SPEC_WITH_EMPTY_SPECIFICEXCLUSIONS ) ); } /** * Tests the parser with a valid specification with minimum and maximum set. */ @Test public void testSpecWithMinimumAndMaximum() throws Exception { assertTrue( checker.isValidSyntax( SPEC_WITH_MINIMUM_AND_MAXIMUM ) ); } /** * Tests the parser with a valid specification with base and minimum and * maximum set. */ @Test public void testWithBaseAndMinimumAndMaximum() throws Exception { assertTrue( checker.isValidSyntax( SPEC_WITH_BASE_AND_MINIMUM_AND_MAXIMUM ) ); } /** * Tests the parser with a valid specification with base and specific * exclusions and minimum and maximum set. */ @Test public void testSpecWithBaseAndSpecificExclusionsAndMinimumAndMaximum() throws Exception { assertTrue( checker.isValidSyntax( SPEC_WITH_BASE_AND_SPECIFICEXCLUSIONS_AND_MINIMUM_AND_MAXIMUM ) ); } /** * Tests the parser with a valid specification with refinement set. */ @Test public void testSpecWithRefinement() throws Exception { assertTrue( checker.isValidSyntax( SPEC_WITH_REFINEMENT ) ); } /** * Tests the parser with a valid specification with base and empty * refinement set. */ @Test public void testSpecWithBaseAndEmptyRefinement() throws Exception { assertTrue( checker.isValidSyntax( SPEC_WITH_BASE_AND_EMPTY_REFINEMENT ) ); } /** * Tests the parser with a valid specification with all components set. */ @Test public void testSpecWithAllInOne() throws Exception { assertTrue( checker.isValidSyntax( SPEC_WITH_ALL_IN_ONE ) ); } /** * Tests the parser with a valid specification with unordinary component * order. */ @Test public void testSpecOrderOfComponentsDoesNotMatter() throws Exception { assertTrue( checker.isValidSyntax( SPEC_ORDER_OF_COMPONENTS_DOES_NOT_MATTER ) ); } /** * Tests the parser with a valid specification with unordinary component * order. */ @Test public void testBadAssertion() throws Exception { assertFalse( checker.isValidSyntax( INVALID_SILLY_THING ) ); } /** * Tests the parser with a valid specification with refinement set. */ @Test public void testSpecWithFilter() throws Exception { assertTrue( checker.isValidSyntax( SPEC_WITH_FILTER ) ); } } ././@LongLink0100644 0000000 0000000 00000000170 13114114302 011617 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/subtree/SubtreeSpecificationParserTest.javaapache-ldap-api-1.0.0-src/integ/src/test/java/org/apache/directory/api/ldap/subtree/SubtreeSpecifica0100644 0000767 0000024 00000042423 13114114302 035014 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ package org.apache.directory.api.ldap.subtree; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.text.ParseException; import java.util.ArrayList; import java.util.List; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.ldap.model.schema.ObjectClass; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.ldap.model.subtree.AndRefinement; import org.apache.directory.api.ldap.model.subtree.ItemRefinement; import org.apache.directory.api.ldap.model.subtree.NotRefinement; import org.apache.directory.api.ldap.model.subtree.OrRefinement; import org.apache.directory.api.ldap.model.subtree.Refinement; import org.apache.directory.api.ldap.model.subtree.SubtreeSpecification; import org.apache.directory.api.ldap.model.subtree.SubtreeSpecificationParser; import org.apache.directory.api.ldap.schema.loader.JarLdifSchemaLoader; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.mycila.junit.concurrent.Concurrency; import com.mycila.junit.concurrent.ConcurrentJunitRunner; /** * Unit tests class for Subtree Specification parser (wrapper). * * @author Apache Directory Project */ @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class SubtreeSpecificationParserTest { /** the ss parser wrapper */ private static SubtreeSpecificationParser parser; /** A valid empty specification with single white space between brackets */ private static final String EMPTY_SPEC = "{ }"; /** A valid specification only with base set */ private static final String SPEC_WITH_BASE = "{ base \"ou=system\" }"; /** An invalid specification with missing white space and base set */ private static final String INVALID_SPEC_WITH_BASE_AND_MISSING_WS = "{ base\"ou=system\"}"; /** A valid specification with some specific exclusions set */ private static final String SPEC_WITH_SPECIFICEXCLUSIONS = "{ specificExclusions { chopAfter:\"cn=gh\", chopBefore:\"cn=cd\" } }"; /** A valid specification with empty specific exclusions set */ private static final String SPEC_WITH_EMPTY_SPECIFICEXCLUSIONS = "{ specificExclusions { } }"; /** A valid specification with minimum and maximum set */ private static final String SPEC_WITH_MINIMUM_AND_MAXIMUM = "{ minimum 1, maximum 2 }"; /** A valid specification with base and minimum and maximum set */ private static final String SPEC_WITH_BASE_AND_MINIMUM_AND_MAXIMUM = "{ base \"ou=ORGANIZATION UNIT\", minimum 1, maximum 2 }"; /** * A valid specification with base and specific exclusions and minimum and * maximum set */ private static final String SPEC_WITH_BASE_AND_SPECIFICEXCLUSIONS_AND_MINIMUM_AND_MAXIMUM = "{ base \"ou=people\", specificExclusions { chopBefore:\"cn=y\"" + ", chopAfter:\"sn=l\", chopBefore:\"c=z\", chopAfter:\"l=m\" }, minimum 7, maximum 77 }"; /** A valid specification with refinement set */ private static final String SPEC_WITH_REFINEMENT = "{ base \"ou=system\", specificationFilter and:{ and:{ item:2.5.6.0" + ", or:{ item:2.5.6.1, item:person } }, not: item:2.5.6.2 } }"; /** A valid specification with base and an empty refinement set */ private static final String SPEC_WITH_BASE_AND_EMPTY_REFINEMENT = "{ base \"ou=system\", specificationFilter and:{ } }"; /** A valid specification with ALL IN ONE */ private static final String SPEC_WITH_ALL_IN_ONE = "{ base \"ou=departments\"" + ", specificExclusions { chopBefore:\"cn=y\", chopAfter:\"sn=l\", chopBefore:\"c=z\", chopAfter:\"l=m\" }" + ", minimum 7, maximum 77" + ", specificationFilter and:{ and:{ item:2.5.6.0, or:{ item:2.5.6.1, item:2.5.6.2 } }, not: item:2.5.6.3 } }"; /** An valid specification with unordinary component order */ private static final String SPEC_ORDER_OF_COMPONENTS_DOES_NOT_MATTER = "{ base \"ou=system\", minimum 3, specificExclusions { chopBefore:\"cn=y\" } }"; /** An invalid specification with completely unrelated content */ private static final String INVALID_SILLY_THING = "How much wood would a wood chuck chuck if a wood chuck would chuck wood?"; /** holds multithreaded success value */ boolean isSuccessMultithreaded = true; /** The schema manager */ private static SchemaManager schemaManager; /** Some global OC */ private static ObjectClass topOC; // 2.5.6.0 private static ObjectClass aliasOC; // 2.5.6.1 private static ObjectClass countryOC; // 2.5.6.2 private static ObjectClass personOC; // 2.5.6.6 /** * Initialization */ @BeforeClass public static void init() throws Exception { JarLdifSchemaLoader loader = new JarLdifSchemaLoader(); schemaManager = new DefaultSchemaManager( loader ); schemaManager.loadAllEnabled(); parser = new SubtreeSpecificationParser( schemaManager ); topOC = schemaManager.lookupObjectClassRegistry( "top" ); aliasOC = schemaManager.lookupObjectClassRegistry( "alias" ); countryOC = schemaManager.lookupObjectClassRegistry( "country" ); personOC = schemaManager.lookupObjectClassRegistry( "person" ); } /** * Tests the parser with a valid empty specification. */ @Test public void testEmptySpec() throws Exception { SubtreeSpecification ss = parser.parse( EMPTY_SPEC ); assertNotNull( ss ); // try a second time ss = parser.parse( EMPTY_SPEC ); assertNotNull( ss ); // try a third time ss = parser.parse( EMPTY_SPEC ); assertNotNull( ss ); } /** * Tests the parser with a valid specification with base set. */ @Test public void testSpecWithBase() throws Exception { SubtreeSpecification ss = parser.parse( SPEC_WITH_BASE ); assertNotNull( ss ); assertEquals( "ou=system", ss.getBase().toString() ); } /** * Tests the parser with an invalid specification with missing white spaces * and base set. */ @Test public void testInvalidSpecWithBaseAndMissingWS() throws Exception { try { parser.parse( INVALID_SPEC_WITH_BASE_AND_MISSING_WS ); fail( "testInvalidSpecWithBaseAndMissingWS() should never come here..." ); } catch ( ParseException e ) { assertNotNull( e ); } } /** * Tests the parser with a valid specification with some specific exclusions * set. */ @Test public void testSpecWithSpecificExclusions() throws Exception { SubtreeSpecification ss = parser.parse( SPEC_WITH_SPECIFICEXCLUSIONS ); assertFalse( ss.getChopBeforeExclusions().isEmpty() ); assertFalse( ss.getChopAfterExclusions().isEmpty() ); assertTrue( ss.getChopBeforeExclusions().contains( new Dn( schemaManager, "cn=cd" ) ) ); assertTrue( ss.getChopAfterExclusions().contains( new Dn( schemaManager, "cn=gh" ) ) ); // try a second time ss = parser.parse( SPEC_WITH_SPECIFICEXCLUSIONS ); assertFalse( ss.getChopBeforeExclusions().isEmpty() ); assertFalse( ss.getChopAfterExclusions().isEmpty() ); assertTrue( ss.getChopBeforeExclusions().contains( new Dn( schemaManager, "cn=cd" ) ) ); assertTrue( ss.getChopAfterExclusions().contains( new Dn( schemaManager, "cn=gh" ) ) ); // try a third time ss = parser.parse( SPEC_WITH_SPECIFICEXCLUSIONS ); assertFalse( ss.getChopBeforeExclusions().isEmpty() ); assertFalse( ss.getChopAfterExclusions().isEmpty() ); assertTrue( ss.getChopBeforeExclusions().contains( new Dn( schemaManager, "cn=cd" ) ) ); assertTrue( ss.getChopAfterExclusions().contains( new Dn( schemaManager, "cn=gh" ) ) ); } /** * Tests the parser with a valid specification with an empty specific * exclusions set. */ @Test public void testSpecWithEmptySpecificExclusions() throws Exception { SubtreeSpecification ss = parser.parse( SPEC_WITH_EMPTY_SPECIFICEXCLUSIONS ); assertNotNull( ss ); assertTrue( ss.getChopBeforeExclusions().isEmpty() ); } /** * Tests the parser with a valid specification with minimum and maximum set. */ @Test public void testSpecWithMinimumAndMaximum() throws Exception { SubtreeSpecification ss = parser.parse( SPEC_WITH_MINIMUM_AND_MAXIMUM ); assertEquals( 1, ss.getMinBaseDistance() ); assertEquals( 2, ss.getMaxBaseDistance() ); // try a second time ss = parser.parse( SPEC_WITH_MINIMUM_AND_MAXIMUM ); assertEquals( 1, ss.getMinBaseDistance() ); assertEquals( 2, ss.getMaxBaseDistance() ); // try a third time ss = parser.parse( SPEC_WITH_MINIMUM_AND_MAXIMUM ); assertEquals( 1, ss.getMinBaseDistance() ); assertEquals( 2, ss.getMaxBaseDistance() ); } /** * Tests the parser with a valid specification with base and minimum and * maximum set. */ @Test public void testWithBaseAndMinimumAndMaximum() throws Exception { SubtreeSpecification ss = parser.parse( SPEC_WITH_BASE_AND_MINIMUM_AND_MAXIMUM ); assertEquals( new Dn( "ou=ORGANIZATION UNIT" ).getName(), ss.getBase().getName() ); assertEquals( 1, ss.getMinBaseDistance() ); assertEquals( 2, ss.getMaxBaseDistance() ); } /** * Tests the parser with a valid specification with base and specific * exclusions and minimum and maximum set. */ @Test public void testSpecWithBaseAndSpecificExclusionsAndMinimumAndMaximum() throws Exception { SubtreeSpecification ss = parser.parse( SPEC_WITH_BASE_AND_SPECIFICEXCLUSIONS_AND_MINIMUM_AND_MAXIMUM ); assertNotNull( ss ); assertEquals( "ou=people", ss.getBase().toString() ); assertTrue( ss.getChopBeforeExclusions().contains( new Dn( "cn=y" ).apply( schemaManager ) ) ); assertTrue( ss.getChopBeforeExclusions().contains( new Dn( "c=z" ).apply( schemaManager ) ) ); assertTrue( ss.getChopAfterExclusions().contains( new Dn( "sn=l" ).apply( schemaManager ) ) ); assertTrue( ss.getChopAfterExclusions().contains( new Dn( "l=m" ).apply( schemaManager ) ) ); assertEquals( 7, ss.getMinBaseDistance() ); assertEquals( 77, ss.getMaxBaseDistance() ); } /** * Tests the parser with a valid specification with refinement set. */ @Test public void testSpecWithRefinement() throws Exception { SubtreeSpecification ss = parser.parse( SPEC_WITH_REFINEMENT ); // The items Refinement topItem = new ItemRefinement( topOC ); Refinement aliasItem = new ItemRefinement( aliasOC ); Refinement personItem = new ItemRefinement( personOC ); Refinement countryItem = new ItemRefinement( countryOC ); // The inner OR refinement or:{item:2.5.6.1, item:person} List orList = new ArrayList(); orList.add( aliasItem ); orList.add( personItem ); Refinement orRefinement = new OrRefinement( orList ); // The inner AND refinement and:{ item:2.5.6.0, or:... } List innerAndList = new ArrayList(); innerAndList.add( topItem ); innerAndList.add( orRefinement ); Refinement innerAndRefinement = new AndRefinement( innerAndList ); // The NOT refinement not:item:2.5.6.2 Refinement notRefinement = new NotRefinement( countryItem ); // The outer AND refinement and:{and:..., not:...} List outerAndList = new ArrayList(); outerAndList.add( innerAndRefinement ); outerAndList.add( notRefinement ); StringBuilder buffer = new StringBuilder(); ss.getRefinement().printRefinementToBuffer( buffer ); //assertEquals( outerAndRefinement.toString(), buffer ); assertEquals( "and: { and: { item: 2.5.6.0, or: { item: 2.5.6.1, item: person } }, not: item: 2.5.6.2 }", buffer.toString() ); } /** * Tests the parser with a valid specification with base and empty * refinement set. */ @Test public void testSpecWithBaseAndEmptyRefinement() throws Exception { SubtreeSpecification ss = parser.parse( SPEC_WITH_BASE_AND_EMPTY_REFINEMENT ); assertEquals( "ou=system", ss.getBase().toString() ); } /** * Tests the parser with a valid specification with all components set. */ @Test public void testSpecWithAllInOne() throws Exception { SubtreeSpecification ss = parser.parse( SPEC_WITH_ALL_IN_ONE ); assertNotNull( ss ); } /** * Tests the parser with a valid specification with unordinary component * order. */ @Test public void testSpecOrderOfComponentsDoesNotMatter() throws Exception { SubtreeSpecification ss = parser.parse( SPEC_ORDER_OF_COMPONENTS_DOES_NOT_MATTER ); assertNotNull( ss ); } /** * Tests the parser with an invalid specification with silly things in. */ @Test public void testInvalidSillyThing() throws Exception { try { parser.parse( INVALID_SILLY_THING ); fail( "testInvalidSillyThing() should never come here..." ); } catch ( ParseException e ) { assertNotNull( e ); } } /** * Test reusability, especially if the state is resetted. */ @Test public void testReusabiltiy() throws Exception { Dn firstDn = new Dn( schemaManager, "cn=l" ); String firstExclusion = "{ specificExclusions { chopAfter:\"cn=l\" } }"; SubtreeSpecification firstSpec = parser.parse( firstExclusion ); assertEquals( 1, firstSpec.getChopAfterExclusions().size() ); assertEquals( firstDn, firstSpec.getChopAfterExclusions().iterator().next() ); Dn secondDn = new Dn( schemaManager, "l=y" ); String secondExclusion = "{ specificExclusions { chopAfter:\"l=y\" } }"; SubtreeSpecification secondSpec = parser.parse( secondExclusion ); assertEquals( 1, secondSpec.getChopAfterExclusions().size() ); assertEquals( secondDn, secondSpec.getChopAfterExclusions().iterator().next() ); } /** * Tests the multithreaded use of a single parser. */ @Test public void testMultiThreaded() throws Exception { // start up and track all threads (40 threads) List threads = new ArrayList(); for ( int ii = 0; ii < 10; ii++ ) { Thread t0 = new Thread( new ParseSpecification( EMPTY_SPEC ) ); Thread t1 = new Thread( new ParseSpecification( SPEC_WITH_SPECIFICEXCLUSIONS ) ); Thread t2 = new Thread( new ParseSpecification( SPEC_WITH_MINIMUM_AND_MAXIMUM ) ); Thread t3 = new Thread( new ParseSpecification( SPEC_WITH_ALL_IN_ONE ) ); threads.add( t0 ); threads.add( t1 ); threads.add( t2 ); threads.add( t3 ); t0.start(); t1.start(); t2.start(); t3.start(); } // wait until all threads have died boolean hasLiveThreads = false; do { hasLiveThreads = false; for ( int ii = 0; ii < threads.size(); ii++ ) { Thread t = threads.get( ii ); hasLiveThreads = hasLiveThreads || t.isAlive(); } } while ( hasLiveThreads ); // check that no one thread failed to parse and generate a SS object assertTrue( isSuccessMultithreaded ); } /** * Used to test multithreaded use of a single parser. */ class ParseSpecification implements Runnable { private final String specStr; SubtreeSpecification result; public ParseSpecification( String specStr ) { this.specStr = specStr; } public void run() { try { result = parser.parse( specStr ); } catch ( ParseException e ) { e.printStackTrace(); } isSuccessMultithreaded = isSuccessMultithreaded && ( result != null ); } } } apache-ldap-api-1.0.0-src/integ/src/test/resources/log4j.properties0100644 0000767 0000024 00000002404 13114114302 026714 0ustar00elecharnystaff0000000 0000000 ############################################################################# # 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. ############################################################################# log4j.rootCategory=ERROR, 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.org.apache.directory.api.ldap.codec.standalone.StandaloneLdapCodecService=DEBUG apache-ldap-api-1.0.0-src/integ-osgi/pom.xml0100644 0000767 0000024 00000016107 13114114302 022260 0ustar00elecharnystaff0000000 0000000 4.0.0 org.apache.directory.api api-parent 1.0.0 api-integ-osgi Apache Directory API OSGi Integration Tests 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_2 test junit junit test ch.qos.logback logback-classic 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 org.eclipse.m2e lifecycle-mapping 1.0.0 org.apache.maven.plugins maven-dependency-plugin [2.8,) copy-dependencies ././@LongLink0100644 0000000 0000000 00000000156 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasSpOsgiTest.javaapache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasSpOsgi0100644 0000767 0000024 00000002352 13114114302 034726 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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" ); } } ././@LongLink0100644 0000000 0000000 00000000163 13114114302 011621 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasTriggerOsgiTest.javaapache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasTrigge0100644 0000767 0000024 00000002566 13114114302 034752 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); } } ././@LongLink0100644 0000000 0000000 00000000160 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasUtilOsgiTest.javaapache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasUtilOs0100644 0000767 0000024 00000003052 13114114302 034737 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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(); } } ././@LongLink0100644 0000000 0000000 00000000153 13114114302 011620 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapModelOsgiTest.javaapache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapModelOsgiTes0100644 0000767 0000024 00000005362 13114114302 034675 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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.StringValue; 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" ); // uses FastDnParser new Dn( "cn=a+sn=b,dc=example,dc=com" ); // uses ComplexDnparser (antlr based) new StringValue( "foo" ); new DefaultAttribute( "cn" ); new DefaultEntry(); AttributeUtils.toJndiAttribute( new DefaultAttribute( "cn" ) ); new BindRequestImpl(); new EqualityNode( "cn", new StringValue( "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(); } } ././@LongLink0100644 0000000 0000000 00000000155 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapNetMinaOsgiTest.javaapache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapNetMinaOsgiT0100644 0000767 0000024 00000004253 13114114302 034636 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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(); 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 ); } } ././@LongLink0100644 0000000 0000000 00000000165 13114114302 011623 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapSchemaConverterOsgiTest.javaapache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapSchemaConver0100644 0000767 0000024 00000003617 13114114302 034715 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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 ); } } ././@LongLink0100644 0000000 0000000 00000000160 13114114302 011616 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapSchemaDataOsgiTest.javaapache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiLdapSchemaDataOs0100644 0000767 0000024 00000003326 13114114302 034631 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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(); } } ././@LongLink0100644 0000000 0000000 00000000146 13114114302 011622 Lustar 0000000 0000000 apache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.javaapache-ldap-api-1.0.0-src/integ-osgi/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.jav0100644 0000767 0000024 00000012016 13114114302 034643 0ustar00elecharnystaff0000000 0000000 /* * 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. * */ 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(); // static // { // skips.add( "antlr-2.7.7.jar" ); // skips.add( "xpp3-1.1.4c.jar" ); // skips.add( "dom4j-1.6.1.jar" ); // } @Configuration public Option[] config() throws IOException { List