directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "lucas theisen (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (DIRAPI-163) Add an LdapConnectionTemplate (template design pattern)
Date Thu, 19 Dec 2013 16:40:09 GMT

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

lucas theisen edited comment on DIRAPI-163 at 12/19/13 4:38 PM:
----------------------------------------------------------------

I attached an initial proposed template.  It is by no means complete and possibly does not
fit with the intentions of the directory team.  However, I find it very useful.  A couple
things to note are:
* I wrap LdapException in LdapRuntimeException because I find nearly all LdapException's I
encounter to be non-recoverable failures though that may not be the case for everyone.  By
wrapping them this way, it makes the client code cleaner as it only needs to catch or throw
them if it has some way of dealing with it.  This is an approach some people like, some dont.
 
* The newXxx() methods are there to abstract the implementation class from the consumer. 

* This makes use of my other proposed solution LdapConnections (DIRSERVER-1938) which provides
an abstraction for obtaining a pooled admin connection or a new user connection.
* There is a MemoryClearingBuffer class that offers translations from char[] to byte[] and
back including the ability to strip leading and trailing whitespace and collapse to lowercase
which is useful for comparing close matches for things like forgotten password answers.  It
will clear the memory used by any temporary buffer upon request to reduce the possibility
that sensitive info will not get dumped in a heap dump (like jvm crash).


was (Author: ltheisen@mitre.org):
An initial proposed template.  It is by no means complete and possibly does not fit with the
intentions of the directory team.  However, I find it very useful.  A couple things to note
are:
* I wrap LdapException in LdapRuntimeException because I find nearly all LdapException's I
encounter to be non-recoverable failures though that may not be the case for everyone.  By
wrapping them this way, it makes the client code cleaner as it only needs to catch or throw
them if it has some way of dealing with it.  This is an approach some people like, some dont.
 
* The newXxx() methods are there to abstract the implementation class from the consumer. 

* This makes use of my other proposed solution LdapConnections (DIRSERVER-1938) which provides
an abstraction for obtaining a pooled admin connection or a new user connection.
* There is a MemoryClearingBuffer class that offers translations from char[] to byte[] and
back including the ability to strip leading and trailing whitespace and collapse to lowercase
which is useful for comparing close matches for things like forgotten password answers.  It
will clear the memory used by any temporary buffer upon request to reduce the possibility
that sensitive info will not get dumped in a heap dump (like jvm crash).

> Add an LdapConnectionTemplate (template design pattern)
> -------------------------------------------------------
>
>                 Key: DIRAPI-163
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-163
>             Project: Directory Client API
>          Issue Type: New Feature
>    Affects Versions: 1.0.0-M21
>            Reporter: lucas theisen
>         Attachments: LdapConnectionTemplate.java
>
>
> Create an LdapConnectionTemplate that can abstract the cookie cutter using callbacks.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message