Is there a separate Java library that provides LDAP style analysis?

I am looking for a separate Java library that allows me to parse LDAP style filter expressions. Is this possible, or is it advisable to use ANTLR instead and build it with one self?

As a background: the filter itself is sent through the network, and I want to create say, the corresponding criteria for sleep mode. I do nothing with LDAP!

Any other ideas for a technology-independent solution for transmitting and converting user queries are also welcome.

+3
source share
7 answers

You can use the shared Apache LDAP directory library.

maven

<dependency>
  <groupId>org.apache.directory.shared</groupId>
  <artifactId>shared-ldap</artifactId>
  <version>0.9.15</version>
</dependency>

:

final ExprNode filter = FilterParser.parse(filterString);
+2

Apache , , lavinio- OpenLDAP, .

+1

OpenDS LDAPFilter, , , , , :

LDAPFilter parsed = LDAPFilter.decode(filter);

javadoc .

Apache DS FilterParser, , . , , , , , , - .

, , , , - :

filter.replaceAll("\\s?([\\(\\|&!=:\\)])\\s?", "$1");

, .

+1

LDAP , System.DirectoryServices.NET . * Mono, ( .net ).

0

jldap OpenLDAP?

, URL- LDAP . , , , LDAP, , .

0

, sail- LDAP, ldap.

- ?

http://josql.sourceforge.net/

0

OSGi , OSGi.

0

Source: https://habr.com/ru/post/1710993/


All Articles