directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lucasthei...@apache.org
Subject svn commit: r1613672 - in /directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template: ModelFactoryImpl.java PasswordPolicyResponderImpl.java PasswordWarningImpl.java
Date Sat, 26 Jul 2014 16:35:46 GMT
Author: lucastheisen
Date: Sat Jul 26 16:35:46 2014
New Revision: 1613672

URL: http://svn.apache.org/r1613672
Log:
changed visibility to prevent leakage of implementation details, provided AbstractPasswordPolicyResponder

Modified:
    directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/ModelFactoryImpl.java
    directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/PasswordPolicyResponderImpl.java
    directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/PasswordWarningImpl.java

Modified: directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/ModelFactoryImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/ModelFactoryImpl.java?rev=1613672&r1=1613671&r2=1613672&view=diff
==============================================================================
--- directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/ModelFactoryImpl.java
(original)
+++ directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/ModelFactoryImpl.java
Sat Jul 26 16:35:46 2014
@@ -44,7 +44,7 @@ import org.apache.directory.ldap.client.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ModelFactoryImpl implements ModelFactory
+class ModelFactoryImpl implements ModelFactory
 {
     @Override
     public AddRequest newAddRequest( Entry entry )

Modified: directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/PasswordPolicyResponderImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/PasswordPolicyResponderImpl.java?rev=1613672&r1=1613671&r2=1613672&view=diff
==============================================================================
--- directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/PasswordPolicyResponderImpl.java
(original)
+++ directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/PasswordPolicyResponderImpl.java
Sat Jul 26 16:35:46 2014
@@ -21,14 +21,6 @@ package org.apache.directory.ldap.client
 
 
 import org.apache.directory.api.ldap.codec.api.LdapApiService;
-import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicy;
-import org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyDecorator;
-import org.apache.directory.api.ldap.model.exception.LdapException;
-import org.apache.directory.api.ldap.model.message.Control;
-import org.apache.directory.api.ldap.model.message.Response;
-import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
-import org.apache.directory.api.ldap.model.message.ResultResponse;
-import org.apache.directory.ldap.client.template.exception.PasswordException;
 
 
 /**
@@ -36,61 +28,11 @@ import org.apache.directory.ldap.client.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PasswordPolicyResponderImpl implements PasswordPolicyResponder
+final class PasswordPolicyResponderImpl extends AbstractPasswordPolicyResponder 
+    implements PasswordPolicyResponder
 {
-    private final PasswordPolicyDecorator passwordPolicyRequestControl;
-
-
-    public PasswordPolicyResponderImpl( LdapApiService ldapApiService )
-    {
-        this.passwordPolicyRequestControl = new PasswordPolicyDecorator(
-            ldapApiService );
-    }
-
-
-    private PasswordPolicy getPasswordPolicy( Response response )
+    PasswordPolicyResponderImpl( LdapApiService ldapApiService )
     {
-        Control control = response.getControls().get( passwordPolicyRequestControl.getOid()
);
-        return control == null
-            ? null
-            : ( ( PasswordPolicyDecorator ) control ).getDecorated();
-    }
-
-
-    @Override
-    public PasswordWarning process( PasswordPolicyOperation operation )
-        throws PasswordException
-    {
-        try
-        {
-            ResultResponse response = operation.process();
-            PasswordPolicy passwordPolicy = getPasswordPolicy( response );
-
-            ResultCodeEnum resultCode = response.getLdapResult().getResultCode();
-            if ( resultCode == ResultCodeEnum.SUCCESS )
-            {
-                if ( passwordPolicy != null )
-                {
-                    return PasswordWarningImpl.newWarning( passwordPolicy );
-                }
-                return null;
-            }
-            else
-            {
-                PasswordException exception = new PasswordException();
-                exception.setResultCode( resultCode );
-                if ( passwordPolicy != null
-                    && passwordPolicy.getResponse() != null
-                    && passwordPolicy.getResponse().getPasswordPolicyError() != null
)
-                {
-                    exception.setPasswordPolicyError( passwordPolicy.getResponse().getPasswordPolicyError()
);
-                }
-                throw exception;
-            }
-        }
-        catch ( LdapException e )
-        {
-            throw new PasswordException().setLdapException( e );
-        }
+        super( ldapApiService );
     }
 }

Modified: directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/PasswordWarningImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/PasswordWarningImpl.java?rev=1613672&r1=1613671&r2=1613672&view=diff
==============================================================================
--- directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/PasswordWarningImpl.java
(original)
+++ directory/shared/branches/1.0.0-M23-FP1/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/PasswordWarningImpl.java
Sat Jul 26 16:35:46 2014
@@ -45,7 +45,7 @@ class PasswordWarningImpl implements Pas
     }
 
 
-    public static PasswordWarning newWarning( PasswordPolicy policy )
+    static PasswordWarning newWarning( PasswordPolicy policy )
     {
         PasswordPolicyResponse response = policy.getResponse();
         if ( response != null )



Mime
View raw message