directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1197571 - in /directory/apacheds/branches/apacheds-osgi: core-api/src/main/java/org/apache/directory/server/core/api/schema/ interceptors/authz/src/main/java/org/apache/directory/server/core/authz/ interceptors/trigger/src/main/java/org/ap...
Date Fri, 04 Nov 2011 13:55:39 GMT
Author: elecharny
Date: Fri Nov  4 13:55:39 2011
New Revision: 1197571

URL: http://svn.apache.org/viewvc?rev=1197571&view=rev
Log:
Minor fixes : removed useless imports, used directoryService instead of context.getDirectoryService()

Modified:
    directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
    directory/apacheds/branches/apacheds-osgi/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
    directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
    directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java

Modified: directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java?rev=1197571&r1=1197570&r2=1197571&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
Fri Nov  4 13:55:39 2011
@@ -40,7 +40,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.UnbindOperationContext;
 import org.apache.directory.server.core.api.partition.AbstractPartition;
-import org.apache.directory.server.core.api.partition.ByPassConstants;
 import org.apache.directory.server.core.api.partition.Partition;
 import org.apache.directory.server.core.api.schema.registries.synchronizers.RegistrySynchronizerAdaptor;
 import org.apache.directory.server.i18n.I18n;

Modified: directory/apacheds/branches/apacheds-osgi/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=1197571&r1=1197570&r2=1197571&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
Fri Nov  4 13:55:39 2011
@@ -55,7 +55,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.SearchingOperationContext;
-import org.apache.directory.server.core.api.partition.ByPassConstants;
 import org.apache.directory.server.core.api.partition.PartitionNexus;
 import org.apache.directory.server.core.authz.support.ACDFEngine;
 import org.apache.directory.server.core.authz.support.AciContext;
@@ -506,7 +505,7 @@ public class AciAuthorizationInterceptor
     public void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException
     {
         // bypass authz code if it was disabled
-        if ( !addContext.getSession().getDirectoryService().isAccessControlEnabled() )
+        if ( !directoryService.isAccessControlEnabled() )
         {
             ACI_LOG.debug( "ACI interceptor disabled" );
             next.add( addContext );
@@ -604,7 +603,7 @@ public class AciAuthorizationInterceptor
         CoreSession session = deleteContext.getSession();
 
         // bypass authz code if we are disabled
-        if ( !session.getDirectoryService().isAccessControlEnabled() )
+        if ( !directoryService.isAccessControlEnabled() )
         {
             next.delete( deleteContext );
             return;
@@ -666,7 +665,7 @@ public class AciAuthorizationInterceptor
         Dn principalDn = principal.getDn();
 
         // bypass authz code if we are disabled
-        if ( !modifyContext.getSession().getDirectoryService().isAccessControlEnabled() )
+        if ( !directoryService.isAccessControlEnabled() )
         {
             next.modify( modifyContext );
             return;
@@ -820,7 +819,7 @@ public class AciAuthorizationInterceptor
     {
         Dn dn = hasEntryContext.getDn();
 
-        if ( !hasEntryContext.getSession().getDirectoryService().isAccessControlEnabled()
)
+        if ( !directoryService.isAccessControlEnabled() )
         {
             return ( dn.isRootDSE() || next.hasEntry( hasEntryContext ) );
         }
@@ -834,9 +833,11 @@ public class AciAuthorizationInterceptor
             // It's the rootDSE, and it exists !
             return answer;
         }
+        
+        CoreSession session = hasEntryContext.getSession();
 
         // TODO - eventually replace this with a check on session.isAnAdministrator()
-        LdapPrincipal principal = hasEntryContext.getSession().getEffectivePrincipal();
+        LdapPrincipal principal = session.getEffectivePrincipal();
         Dn principalDn = principal.getDn();
 
         if ( isPrincipalAnAdministrator( principalDn ) )
@@ -844,9 +845,9 @@ public class AciAuthorizationInterceptor
             return answer;
         }
 
-        CoreSession session = hasEntryContext.getSession();
         LookupOperationContext lookupContext = new LookupOperationContext( session, dn, SchemaConstants.ALL_ATTRIBUTES_ARRAY
);
-        Entry entry = session.getDirectoryService().getPartitionNexus().lookup( lookupContext
);
+        Entry entry = directoryService.getPartitionNexus().lookup( lookupContext );
+        
         Set<Dn> userGroups = groupCache.getGroups( principalDn.getNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( hasEntryContext, tuples, dn, entry );
@@ -943,7 +944,6 @@ public class AciAuthorizationInterceptor
     public Entry lookup( NextInterceptor next, LookupOperationContext lookupContext ) throws
LdapException
     {
         CoreSession session = lookupContext.getSession();
-        DirectoryService directoryService = session.getDirectoryService();
 
         LdapPrincipal principal = session.getEffectivePrincipal();
         Dn principalDn = principal.getDn();
@@ -982,7 +982,7 @@ public class AciAuthorizationInterceptor
         Dn newName = renameContext.getNewDn();
 
         // bypass authz code if we are disabled
-        if ( !renameContext.getSession().getDirectoryService().isAccessControlEnabled() )
+        if ( !directoryService.isAccessControlEnabled() )
         {
             next.rename( renameContext );
             return;
@@ -1037,7 +1037,7 @@ public class AciAuthorizationInterceptor
         Dn newDn = moveAndRenameContext.getNewDn();
 
         // bypass authz code if we are disabled
-        if ( !moveAndRenameContext.getSession().getDirectoryService().isAccessControlEnabled()
)
+        if ( !directoryService.isAccessControlEnabled() )
         {
             next.moveAndRename( moveAndRenameContext );
             return;
@@ -1080,7 +1080,7 @@ public class AciAuthorizationInterceptor
 
         CoreSession session = moveAndRenameContext.getSession();
         LookupOperationContext lookupContext = new LookupOperationContext( session, oldDn,
SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
-        Entry importedEntry = session.getDirectoryService().getPartitionNexus().lookup( lookupContext
);
+        Entry importedEntry = directoryService.getPartitionNexus().lookup( lookupContext
);
 
         // As the target entry does not exist yet and so
         // its subentry operational attributes are not there,
@@ -1126,14 +1126,15 @@ public class AciAuthorizationInterceptor
 
         // Access the principal requesting the operation, and bypass checks if it is the
admin
         Entry entry = moveContext.getOriginalEntry();
+        CoreSession session = moveContext.getSession();
 
         Dn newDn = moveContext.getNewDn();
 
-        LdapPrincipal principal = moveContext.getSession().getEffectivePrincipal();
+        LdapPrincipal principal = session.getEffectivePrincipal();
         Dn principalDn = principal.getDn();
 
         // bypass authz code if we are disabled
-        if ( !moveContext.getSession().getDirectoryService().isAccessControlEnabled() )
+        if ( !directoryService.isAccessControlEnabled() )
         {
             next.move( moveContext );
             return;
@@ -1172,9 +1173,8 @@ public class AciAuthorizationInterceptor
         // will not be valid at the new location.
         // This will certainly be fixed by the SubentryInterceptor,
         // but after this service.
-        CoreSession session = moveContext.getSession();
         LookupOperationContext lookupContext = new LookupOperationContext( session, oriChildName,
SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
-        Entry importedEntry = session.getDirectoryService().getPartitionNexus().lookup( lookupContext
);
+        Entry importedEntry = directoryService.getPartitionNexus().lookup( lookupContext
);
 
         // As the target entry does not exist yet and so
         // its subentry operational attributes are not there,
@@ -1217,7 +1217,7 @@ public class AciAuthorizationInterceptor
         EntryFilteringCursor cursor = next.list( listContext );
 
         if ( isPrincipalAnAdministrator( user.getDn() )
-            || !listContext.getSession().getDirectoryService().isAccessControlEnabled() )
+            || !directoryService.isAccessControlEnabled() )
         {
             return cursor;
         }
@@ -1240,7 +1240,7 @@ public class AciAuthorizationInterceptor
             && searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE;
 
         if ( isPrincipalAnAdministrator( principalDn )
-            || !searchContext.getSession().getDirectoryService().isAccessControlEnabled()
|| isRootDSELookup
+            || !directoryService.isAccessControlEnabled() || isRootDSELookup
             || isSubschemaSubentryLookup )
         {
             return cursor;
@@ -1265,14 +1265,13 @@ public class AciAuthorizationInterceptor
         CoreSession session = compareContext.getSession();
         Dn dn = compareContext.getDn();
         String oid = compareContext.getOid();
-        Value<?> value = compareContext.getValue();
 
         Entry entry = compareContext.getOriginalEntry();
 
         LdapPrincipal principal = session.getEffectivePrincipal();
         Dn principalDn = principal.getDn();
 
-        if ( isPrincipalAnAdministrator( principalDn ) || !session.getDirectoryService().isAccessControlEnabled()
)
+        if ( isPrincipalAnAdministrator( principalDn ) || !directoryService.isAccessControlEnabled()
)
         {
             return next.compare( compareContext );
         }

Modified: directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java?rev=1197571&r1=1197570&r2=1197571&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
Fri Nov  4 13:55:39 2011
@@ -25,7 +25,6 @@ import java.util.Map;
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.OperationContext;
-import org.apache.directory.server.core.api.partition.ByPassConstants;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;

Modified: directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java?rev=1197571&r1=1197570&r2=1197571&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
Fri Nov  4 13:55:39 2011
@@ -28,7 +28,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.OperationContext;
-import org.apache.directory.server.core.api.partition.ByPassConstants;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Modification;

Modified: directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=1197571&r1=1197570&r2=1197571&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
Fri Nov  4 13:55:39 2011
@@ -40,7 +40,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.OperationContext;
 import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext;
-import org.apache.directory.server.core.api.partition.ByPassConstants;
 import org.apache.directory.server.core.api.sp.StoredProcEngine;
 import org.apache.directory.server.core.api.sp.StoredProcEngineConfig;
 import org.apache.directory.server.core.api.sp.StoredProcExecutionManager;
@@ -444,7 +443,7 @@ public class TriggerInterceptor extends 
         CoreSession session = moveAndRenameContext.getSession();
         LookupOperationContext lookupContext = new LookupOperationContext( session, oldDn,
SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
 
-        Entry importedEntry = session.getDirectoryService().getPartitionNexus().lookup( lookupContext
);
+        Entry importedEntry = directoryService.getPartitionNexus().lookup( lookupContext
);
 
         // As the target entry does not exist yet and so
         // its subentry operational attributes are not there,
@@ -519,7 +518,7 @@ public class TriggerInterceptor extends 
         CoreSession session = moveContext.getSession();
         LookupOperationContext lookupContext = new LookupOperationContext( session, dn, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY
);
 
-        Entry importedEntry = session.getDirectoryService().getPartitionNexus().lookup( lookupContext
);
+        Entry importedEntry = directoryService.getPartitionNexus().lookup( lookupContext
);
 
         // As the target entry does not exist yet and so
         // its subentry operational attributes are not there,



Mime
View raw message