Hi all,
Dushan :
I'll look in to the facts you have mentioned. Thanks for the feedback.

   - If you can please send some samples of integration test
   implementations. We are not familiar with integration test writing.
   - Currently we needed only CURD operations. To keep ldap connector
   generic to each scenarios we think that those operations are enough. Any
   ideas about new operations that can be added?
   - For that multi threaded issue what can we do?

Isuru:
Thanks for the feedback. We will get into that.

Thanks
Dimuthu



On Fri, Feb 7, 2014 at 9:23 AM, Isuru Udana <[email protected]> wrote:

> Hi Dimuthu,
>
> Following is a feedback on the code.
>
> ** Log statements in synapse configuration*
> - We should not print any logs from the synapse configuration for the
> happy path. So remove all logs in templates.
>
> ** Need better exception handling.*
> - Print exceptions using log statements and remove e.printStackTrace().
> Then throw exceptions using handleException() method.
>
> ** Improve logging*
> - Put some debug level logs which might help to debug issues.
> Make sure that debug statements get printed only if debug is enabled.
>
> Ex.
>
> if (log.isDebugEnabled()) {
>    log.warn("Log statement here");
> }
>
> - Remove sysout statements
>
> ** Use of constants*
> - "http://org.wso2.esbconnectors.ldap"; is used in multiple places. Better
> to make it a constant and use it.
>
> ** Avoid possible NPEs*
> Re-visit the code and see whether there are possible NullPointerExceptions
> and handle them properly.
>
>
> On Fri, Feb 7, 2014 at 8:14 AM, Dushan Abeyruwan <[email protected]> wrote:
>
>> Hi Dimuthu,
>>
>>    - Code require proper exception handling and of cause some cleanup
>>    (i.e for for users, we should compile proper error message use
>>    AbstractMediator handleException)
>>    - Use Logs not sysouts(see synapse inbuilt mediators)
>>    - Integration tests ?
>>    - Only CURD operations ?
>>    - Documentation refer
>>    http://docs.wso2.org/display/ESB480/ESB+Connectors for templates
>>
>>
>>
>>
>>      protected static DirContext getContext(String providerUrl,String 
>> securityPrincipal,String credentials) {
>>              Hashtable env = new Hashtable();
>>              env.put(Context.INITIAL_CONTEXT_FACTORY,
>>                              "com.sun.jndi.ldap.LdapCtxFactory");
>>
>>              *env.put(Context.PROVIDER_URL, 
>> providerUrl);//"ldap://192.168.1.164:389/ <http://192.168.1.164:389/>"
>>              env.put(Context.SECURITY_PRINCIPAL,securityPrincipal);// 
>> "cn=admin,dc=wso2,dc=com"
>>              env.put(Context.SECURITY_CREDENTIALS, credentials);//"comadmin"*
>>
>>              DirContext ctx = null;
>>              try {
>>                      ctx = new InitialDirContext(env);
>>              } catch (NamingException e) {
>>                      log.error("Error connecting to LDAP server", e);
>>                      e.printStackTrace();
>>              }
>>
>>              return ctx;
>>      }
>>
>>
>>    - see highlighted section I don't think this will work in
>>    Multi-threaded environment, because connectors are subjected open for
>>    multiple LDAP connections (may be in single proxy you can define multiple
>>    LDAPs to connect then using Environment variables as seen above ?)
>>
>>
>>
>> Cheers
>> Dushan
>>
>>
>> On Fri, Feb 7, 2014 at 7:26 AM, Samisa Abeysinghe <[email protected]>wrote:
>>
>>> ESB team, can we please have a look into this?
>>>
>>> Thanks,
>>> Samisa...
>>>
>>>
>>> Samisa Abeysinghe
>>>
>>> Vice President Developer Evangelism
>>>
>>> WSO2 Inc.
>>> http://wso2.com
>>>
>>>
>>>
>>> On Fri, Jan 31, 2014 at 9:34 AM, Dimuthu Upeksha <[email protected]>wrote:
>>>
>>>> Hi all,
>>>> We are working on our intern project Infra portal. We needed to do some
>>>> LDAP operations in our project. To make the integration easy we implemented
>>>> a LDAP connector [1] for WSO2 ESB 4.8.0. We hope this will be useful to
>>>> other groups which are working on LDAP authentication stuff. So we decided
>>>> to share this with everyone. Detailed descriptions of currently available
>>>> operations are mentioned in this[2] blog. We hope that this should be
>>>> improved further because this includes only basic LDAP operations.
>>>>
>>>> It will be a great help for us I you can give us some feedbacks about
>>>> improvements we can do in this connector.
>>>>
>>>> [1] https://svn.wso2.com/wso2/interns/2013/dimuthuu/ldap_connector/
>>>> [2]
>>>> http://dimuthuupeksha.blogspot.com/2014/01/ldap-connector-for-wso2-esb.html
>>>>
>>>> Thanks
>>>> Dimuthu
>>>>
>>>> --
>>>> Dimuthu Upeksha
>>>> Engineering Intern
>>>> WSO2 inc.
>>>>
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Dushan Abeyruwan | Associate Tech Lead
>>  Integration Technologies Team
>> PMC Member Apache Synpase
>> WSO2 Inc. http://wso2.com/
>> Blog:http://dushansview.blogspot.com/
>> Mobile:(0094)713942042
>>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Isuru Udana*
> Senior
> * Software Engineer*
> WSO2 Inc.; http://wso2.com
> email: [email protected] cell: +94 77 3791887
> blog: http://mytecheye.blogspot.com/
> twitter: http://twitter.com/isudana
>



-- 
Dimuthu Upeksha
Engineering Intern
WSO2 inc.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to