directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Password policy response, ideas?
Date Fri, 01 Feb 2013 23:13:57 GMT
Hi, I've tried everything I can think of but cannot get the BindResponse  cast to the PasswordPolicyResponse
 object I need.
When I breakpoint the line Control control= ..  I can see the data I'm looking for is there.
 I just can't' get it into a useable object.
I get
java.lang.ClassCastException: cannot be cast to

I want to bind with a password policy control, get the response and retrieve the policy error.

Here is the pseudo code.

                     BindRequest bindRequest = new BindRequestImpl();

                     LdapApiService codec = LdapApiServiceFactory.getSingleton();
                     PasswordPolicyDecorator pwCtrl = new PasswordPolicyDecorator(codec,new

                     bindResponse = connection.bind(bindRequest);

              if (bindResponse.hasControl(PasswordPolicy.OID))
                     Control control = ((Response)bindResponse).getControls().get( PasswordPolicy.OID
                     PasswordPolicy pwPolicy = ((PasswordPolicyDecorator)control).getDecorated();
// exception thrown here!

                     PasswordPolicyResponse  pw = pwPolicy.getResponse();   //<- this is
where I 'm trying to get.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message