directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRAPI-165) Add a FilterBuillder
Date Mon, 26 Jan 2015 12:59:34 GMT

    [ https://issues.apache.org/jira/browse/DIRAPI-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14291792#comment-14291792
] 

Emmanuel Lecharny commented on DIRAPI-165:
------------------------------------------

I checked the code, there are at missing parts :
- the ASF headers (they are mandatory, and we can't cut a release without them)
- the classes header : we need the apache directory email address to be added in the header
- The javadoc : we are poor on Javadoc, due to the urge of developping and because we are
a bit lazzy, but we try to get this fixed

Currently, the {{FilterBuilder}} class is the only one that has everything but the ASF header,
and I must admit it's quite well documented. It would be cool if the other classes have a
bit of doco, too. Not necessarily that extensive, but still. For test, we don't really care
about Javadoc, except for specific tests.

Regarding the {{Operator}} enum, we do have an enum in the ldap-model module that could have
been used, or at least improved : AssertionType. I think there is some room for improvement
in this enum. I also think that there is no need to declare two inner Operator - in UnaryFilter
and setOfFiltersFilter -.

Last, not least, the Filter.build(...) is clearly missing a lot of things : the attribute
value is to be escaped wrt RFC 4515  (assertionvalue) :

{code}
      assertionvalue = valueencoding
      ; The <valueencoding> rule is used to encode an <AssertionValue>
      ; from Section 4.1.6 of [RFC4511].
      valueencoding  = 0*(normal / escaped)
      normal         = UTF1SUBSET / UTFMB
      escaped        = ESC HEX HEX
      UTF1SUBSET     = %x01-27 / %x2B-5B / %x5D-7F
                          ; UTF1SUBSET excludes 0x00 (NUL), LPAREN,
                          ; RPAREN, ASTERISK, and ESC.
      EXCLAMATION    = %x21 ; exclamation mark ("!")
      AMPERSAND      = %x26 ; ampersand (or AND symbol) ("&")
      ASTERISK       = %x2A ; asterisk ("*")
      COLON          = %x3A ; colon (":")
      VERTBAR        = %x7C ; vertical bar (or pipe) ("|")
      TILDE          = %x7E ; tilde ("~")
{code}

If we don't do that, we are very likely to have failing requests. I think we have the code
that does the escaping in the ldap-model module (Filter)

> Add a FilterBuillder
> --------------------
>
>                 Key: DIRAPI-165
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-165
>             Project: Directory Client API
>          Issue Type: New Feature
>    Affects Versions: 1.0.0-M21
>            Reporter: lucas theisen
>            Priority: Minor
>             Fix For: 1.0.0-M29
>
>
> Looking for something Fluent, in the _spirit_ of Hibernate Criteria.  May not seem like
much, but can drastically reduce query syntax issues. Also, you would likely be using a StringBuilder
anyway, so its not much different. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message