Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8E27B009 for ; Sun, 22 Jan 2012 20:56:19 +0000 (UTC) Received: (qmail 83189 invoked by uid 500); 22 Jan 2012 20:56:19 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 83116 invoked by uid 500); 22 Jan 2012 20:56:19 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 83109 invoked by uid 99); 22 Jan 2012 20:56:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jan 2012 20:56:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jan 2012 20:56:17 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A3FC6238899C for ; Sun, 22 Jan 2012 20:55:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1234602 - in /directory/apacheds/branches/apacheds-osgi: ./ component-hub/ interceptors/admin/src/main/java/org/apache/directory/server/core/admin/ interceptors/authn/src/main/java/org/apache/directory/server/core/authn/ service-osgi/ Date: Sun, 22 Jan 2012 20:55:57 -0000 To: commits@directory.apache.org From: gokturk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120122205557.A3FC6238899C@eris.apache.org> Author: gokturk Date: Sun Jan 22 20:55:57 2012 New Revision: 1234602 URL: http://svn.apache.org/viewvc?rev=1234602&view=rev Log: component-hub and service-osgi are subject to reimplementation. Removed: directory/apacheds/branches/apacheds-osgi/component-hub/ directory/apacheds/branches/apacheds-osgi/service-osgi/ Modified: directory/apacheds/branches/apacheds-osgi/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java directory/apacheds/branches/apacheds-osgi/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java directory/apacheds/branches/apacheds-osgi/pom.xml Modified: directory/apacheds/branches/apacheds-osgi/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java?rev=1234602&r1=1234601&r2=1234602&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java (original) +++ directory/apacheds/branches/apacheds-osgi/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java Sun Jan 22 20:55:57 2012 @@ -95,8 +95,6 @@ import org.slf4j.LoggerFactory; * * @author Apache Directory Project */ -@Component -@Provides(specifications={Interceptor.class}) public class AdministrativePointInterceptor extends BaseInterceptor { /** A {@link Logger} for this class */ Modified: directory/apacheds/branches/apacheds-osgi/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=1234602&r1=1234601&r2=1234602&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original) +++ directory/apacheds/branches/apacheds-osgi/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Sun Jan 22 20:55:57 2012 @@ -96,6 +96,8 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.util.DateUtils; import org.apache.directory.shared.util.StringConstants; import org.apache.directory.shared.util.Strings; +import org.apache.felix.ipojo.annotations.Component; +import org.apache.felix.ipojo.annotations.Provides; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -231,7 +233,7 @@ public class AuthenticationInterceptor e this.authenticators.clear(); - for (Authenticator authenticator : authenticators) + for ( Authenticator authenticator : authenticators ) { this.authenticators.add( authenticator ); } @@ -312,7 +314,6 @@ public class AuthenticationInterceptor e Entry entry = addContext.getEntry(); - if ( !directoryService.isPwdPolicyEnabled() ) { next( addContext ); @@ -342,7 +343,8 @@ public class AuthenticationInterceptor e { PasswordPolicyDecorator responseControl = new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true ); - responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.get( e.getErrorCode() ) ); + responseControl.getResponse().setPasswordPolicyError( + PasswordPolicyErrorEnum.get( e.getErrorCode() ) ); addContext.addResponseControl( responseControl ); } @@ -808,8 +810,7 @@ public class AuthenticationInterceptor e checkAuthenticated( modifyContext ); - - if ( ! directoryService.isPwdPolicyEnabled() ) + if ( !directoryService.isPwdPolicyEnabled() ) { next( modifyContext ); invalidateAuthenticatorCaches( modifyContext.getDn() ); @@ -836,7 +837,8 @@ public class AuthenticationInterceptor e { PasswordPolicyDecorator responseControl = new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true ); - responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.CHANGE_AFTER_RESET ); + responseControl.getResponse().setPasswordPolicyError( + PasswordPolicyErrorEnum.CHANGE_AFTER_RESET ); modifyContext.addResponseControl( responseControl ); } @@ -854,7 +856,8 @@ public class AuthenticationInterceptor e { PasswordPolicyDecorator responseControl = new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true ); - responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.MUST_SUPPLY_OLD_PASSWORD ); + responseControl.getResponse().setPasswordPolicyError( + PasswordPolicyErrorEnum.MUST_SUPPLY_OLD_PASSWORD ); modifyContext.addResponseControl( responseControl ); } @@ -868,7 +871,8 @@ public class AuthenticationInterceptor e { PasswordPolicyDecorator responseControl = new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true ); - responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.PASSWORD_MOD_NOT_ALLOWED ); + responseControl.getResponse().setPasswordPolicyError( + PasswordPolicyErrorEnum.PASSWORD_MOD_NOT_ALLOWED ); modifyContext.addResponseControl( responseControl ); } @@ -908,7 +912,8 @@ public class AuthenticationInterceptor e { PasswordPolicyDecorator responseControl = new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true ); - responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.get( e.getErrorCode() ) ); + responseControl.getResponse().setPasswordPolicyError( + PasswordPolicyErrorEnum.get( e.getErrorCode() ) ); modifyContext.addResponseControl( responseControl ); } @@ -933,7 +938,7 @@ public class AuthenticationInterceptor e List pwdHistLst = new ArrayList(); - for ( Value value : pwdHistoryAt ) + for ( Value value : pwdHistoryAt ) { PasswordHistory pwdh = new PasswordHistory( Strings.utf8ToString( value.getBytes() ) ); @@ -945,7 +950,8 @@ public class AuthenticationInterceptor e { PasswordPolicyDecorator responseControl = new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true ); - responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.PASSWORD_IN_HISTORY ); + responseControl.getResponse().setPasswordPolicyError( + PasswordPolicyErrorEnum.PASSWORD_IN_HISTORY ); modifyContext.addResponseControl( responseControl ); } @@ -1181,14 +1187,15 @@ public class AuthenticationInterceptor e AT_PWD_GRACE_USE_TIME = schemaManager.lookupAttributeTypeRegistry( PWD_GRACE_USE_TIME_AT ); PWD_POLICY_STATE_ATTRIBUTE_TYPES.add( AT_PWD_GRACE_USE_TIME ); - + PWD_POLICY_STATE_ATTRIBUTE_TYPES.add( schemaManager.lookupAttributeTypeRegistry( PWD_POLICY_SUBENTRY_AT ) ); } } // ---------- private methods ---------------- - private void check( String username, byte[] password, PasswordPolicyConfiguration policyConfig ) throws LdapException + private void check( String username, byte[] password, PasswordPolicyConfiguration policyConfig ) + throws LdapException { final int qualityVal = policyConfig.getPwdCheckQuality(); @@ -1214,7 +1221,7 @@ public class AuthenticationInterceptor e } } - String strPassword = Strings.utf8ToString(password); + String strPassword = Strings.utf8ToString( password ); // perform the length validation validatePasswordLength( strPassword, policyConfig ); @@ -1226,7 +1233,8 @@ public class AuthenticationInterceptor e /** * validates the length of the password */ - private void validatePasswordLength( String password, PasswordPolicyConfiguration policyConfig ) throws PasswordPolicyException + private void validatePasswordLength( String password, PasswordPolicyConfiguration policyConfig ) + throws PasswordPolicyException { int maxLen = policyConfig.getPwdMaxLength(); int minLen = policyConfig.getPwdMinLength(); @@ -1253,7 +1261,8 @@ public class AuthenticationInterceptor e } - private int getPwdTimeBeforeExpiry( Entry userEntry, PasswordPolicyConfiguration policyConfig ) throws LdapException + private int getPwdTimeBeforeExpiry( Entry userEntry, PasswordPolicyConfiguration policyConfig ) + throws LdapException { if ( policyConfig.getPwdMaxAge() == 0 ) { @@ -1268,7 +1277,7 @@ public class AuthenticationInterceptor e } Attribute pwdChangedTimeAt = userEntry.get( PWD_CHANGED_TIME_AT ); - long changedTime = DateUtils.getDate(pwdChangedTimeAt.getString()).getTime(); + long changedTime = DateUtils.getDate( pwdChangedTimeAt.getString() ).getTime(); long currentTime = DateUtils.getDate( DateUtils.getGeneralizedTime() ).getTime(); int pwdAge = ( int ) ( currentTime - changedTime ) / 1000; @@ -1344,7 +1353,8 @@ public class AuthenticationInterceptor e } - private PwdModDetailsHolder getPwdModDetails( ModifyOperationContext modifyContext, PasswordPolicyConfiguration policyConfig ) throws LdapException + private PwdModDetailsHolder getPwdModDetails( ModifyOperationContext modifyContext, + PasswordPolicyConfiguration policyConfig ) throws LdapException { PwdModDetailsHolder pwdModDetails = new PwdModDetailsHolder(); @@ -1388,7 +1398,7 @@ public class AuthenticationInterceptor e */ private void checkPwdReset( OperationContext opContext ) throws LdapException { - if ( ! directoryService.isPwdPolicyEnabled() ) + if ( !directoryService.isPwdPolicyEnabled() ) { CoreSession session = opContext.getSession(); @@ -1411,7 +1421,6 @@ public class AuthenticationInterceptor e } } - private static class PwdModDetailsHolder { private boolean pwdModPresent = false; @@ -1537,8 +1546,8 @@ public class AuthenticationInterceptor e public boolean isPwdPolicyEnabled() { return ( ( pwdPolicyContainer != null ) - && ( ( pwdPolicyContainer.getDefaultPolicy() != null ) - || ( pwdPolicyContainer.hasCustomConfigs() ) ) ); + && ( ( pwdPolicyContainer.getDefaultPolicy() != null ) + || ( pwdPolicyContainer.hasCustomConfigs() ) ) ); } Modified: directory/apacheds/branches/apacheds-osgi/pom.xml URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/pom.xml?rev=1234602&r1=1234601&r2=1234602&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/pom.xml (original) +++ directory/apacheds/branches/apacheds-osgi/pom.xml Sun Jan 22 20:55:57 2012 @@ -153,8 +153,6 @@ installers apache-felix dependencies - service-osgi - component-hub