You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2008/05/21 21:09:15 UTC
svn commit: r658814 - in
/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core:
authz/ interceptor/
Author: akarasulu
Date: Wed May 21 12:09:14 2008
New Revision: 658814
URL: http://svn.apache.org/viewvc?rev=658814&view=rev
Log:
fixing issues with Cursor verses NamingEnumeration usage in Interceptors
Modified:
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=658814&r1=658813&r2=658814&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Wed May 21 12:09:14 2008
@@ -199,7 +199,7 @@
* @param directoryService the directory service core
* @throws NamingException if there are problems during initialization
*/
- public void init( DirectoryService directoryService ) throws NamingException
+ public void init( DirectoryService directoryService ) throws Exception
{
super.init( directoryService );
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=658814&r1=658813&r2=658814&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Wed May 21 12:09:14 2008
@@ -118,7 +118,7 @@
}
- public void init( DirectoryService directoryService ) throws NamingException
+ public void init( DirectoryService directoryService ) throws Exception
{
nexus = directoryService.getPartitionNexus();
normalizerMapping = directoryService.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
@@ -143,7 +143,7 @@
}
- private void loadAdministrators( Registries registries ) throws NamingException
+ private void loadAdministrators( Registries registries ) throws Exception
{
// read in the administrators and cache their normalized names
Set<String> newAdministrators = new HashSet<String>( 2 );
@@ -258,7 +258,7 @@
* the admin needs access.
*/
public void modify( NextInterceptor nextInterceptor, ModifyOperationContext opContext )
- throws NamingException
+ throws Exception
{
if ( enabled )
{
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=658814&r1=658813&r2=658814&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Wed May 21 12:09:14 2008
@@ -29,9 +29,9 @@
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.cursor.Cursor;
import org.apache.directory.server.core.entry.ServerAttribute;
import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerSearchResult;
import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
@@ -52,7 +52,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.SearchControls;
@@ -100,7 +99,7 @@
* @param directoryService the directory service core
* @throws NamingException if there are failures on initialization
*/
- public GroupCache( DirectoryService directoryService ) throws NamingException
+ public GroupCache( DirectoryService directoryService ) throws Exception
{
normalizerMap = directoryService.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
nexus = directoryService.getPartitionNexus();
@@ -124,7 +123,7 @@
}
- private void initialize( Registries registries ) throws NamingException
+ private void initialize( Registries registries ) throws Exception
{
// search all naming contexts for static groups and generate
// normalized sets of members to cache within the map
@@ -143,14 +142,14 @@
LdapDN baseDn = new LdapDN( suffix );
SearchControls ctls = new SearchControls();
ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
- NamingEnumeration<ServerSearchResult> results = nexus.search( new SearchOperationContext( registries,
+ Cursor<ServerEntry> results = nexus.search( new SearchOperationContext( registries,
baseDn, AliasDerefMode.DEREF_ALWAYS, filter, ctls ) );
- while ( results.hasMore() )
+ while ( results.next() )
{
- ServerSearchResult result = results.next();
+ ServerEntry result = results.get();
LdapDN groupDn = result.getDn().normalize( normalizerMap );
- EntryAttribute members = getMemberAttribute( result.getServerEntry() );
+ EntryAttribute members = getMemberAttribute( result );
if ( members != null )
{
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?rev=658814&r1=658813&r2=658814&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java Wed May 21 12:09:14 2008
@@ -49,7 +49,6 @@
import javax.naming.Context;
import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
import javax.naming.ldap.LdapContext;
import java.util.Iterator;
@@ -107,8 +106,9 @@
/**
* This method does nothing by default.
+ * @throws Exception
*/
- public void init( DirectoryService directoryService ) throws NamingException
+ public void init( DirectoryService directoryService ) throws Exception
{
}
@@ -125,118 +125,118 @@
// Interceptor's Invoke Method
// ------------------------------------------------------------------------
- public void add( NextInterceptor next, AddOperationContext opContext ) throws NamingException
+ public void add( NextInterceptor next, AddOperationContext opContext ) throws Exception
{
next.add( opContext );
}
- public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws NamingException
+ public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws Exception
{
next.delete( opContext );
}
- public LdapDN getMatchedName ( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws NamingException
+ public LdapDN getMatchedName ( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws Exception
{
return next.getMatchedName( opContext );
}
- public ServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws NamingException
+ public ServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws Exception
{
return next.getRootDSE( opContext );
}
- public LdapDN getSuffix( NextInterceptor next, GetSuffixOperationContext opContext ) throws NamingException
+ public LdapDN getSuffix( NextInterceptor next, GetSuffixOperationContext opContext ) throws Exception
{
return next.getSuffix( opContext );
}
- public boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws NamingException
+ public boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws Exception
{
return next.hasEntry( opContext );
}
public NamingEnumeration<ServerSearchResult> list( NextInterceptor next, ListOperationContext opContext )
- throws NamingException
+ throws Exception
{
return next.list( opContext );
}
public Iterator<String> listSuffixes ( NextInterceptor next, ListSuffixOperationContext opContext )
- throws NamingException
+ throws Exception
{
return next.listSuffixes( opContext );
}
- public ServerEntry lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException
+ public ServerEntry lookup( NextInterceptor next, LookupOperationContext opContext ) throws Exception
{
return next.lookup( opContext );
}
- public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws NamingException
+ public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws Exception
{
next.modify( opContext );
}
- public void rename( NextInterceptor next, RenameOperationContext opContext ) throws NamingException
+ public void rename( NextInterceptor next, RenameOperationContext opContext ) throws Exception
{
next.rename( opContext );
}
public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext )
- throws NamingException
+ throws Exception
{
next.moveAndRename( opContext );
}
- public void move( NextInterceptor next, MoveOperationContext opContext ) throws NamingException
+ public void move( NextInterceptor next, MoveOperationContext opContext ) throws Exception
{
next.move( opContext );
}
- public NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
+ public NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws Exception
{
return next.search( opContext );
}
- public void addContextPartition( NextInterceptor next, AddContextPartitionOperationContext opContext ) throws NamingException
+ public void addContextPartition( NextInterceptor next, AddContextPartitionOperationContext opContext ) throws Exception
{
next.addContextPartition( opContext );
}
- public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws NamingException
+ public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws Exception
{
next.removeContextPartition( opContext );
}
- public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws NamingException
+ public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws Exception
{
return next.compare( opContext );
}
- public void bind( NextInterceptor next, BindOperationContext opContext ) throws NamingException
+ public void bind( NextInterceptor next, BindOperationContext opContext ) throws Exception
{
next.bind( opContext );
}
- public void unbind( NextInterceptor next, UnbindOperationContext opContext ) throws NamingException
+ public void unbind( NextInterceptor next, UnbindOperationContext opContext ) throws Exception
{
next.unbind( opContext );
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java?rev=658814&r1=658813&r2=658814&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java Wed May 21 12:09:14 2008
@@ -47,7 +47,6 @@
import org.apache.directory.shared.ldap.name.LdapDN;
import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
import java.util.Iterator;
@@ -125,8 +124,9 @@
/**
* Intializes this interceptor. This is invoked by {@link InterceptorChain}
* when this intercepter is loaded into interceptor chain.
+ * @throws Exception
*/
- void init( DirectoryService directoryService ) throws NamingException;
+ void init( DirectoryService directoryService ) throws Exception;
/**
@@ -139,113 +139,113 @@
/**
* Filters {@link PartitionNexus#getRootDSE( GetRootDSEOperationContext )} call.
*/
- ServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws NamingException;
+ ServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws Exception;
/**
* Filters {@link PartitionNexus#getMatchedName( GetMatchedNameOperationContext )} call.
*/
- LdapDN getMatchedName( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws NamingException;
+ LdapDN getMatchedName( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws Exception;
/**
* Filters {@link PartitionNexus#getSuffix( GetSuffixOperationContext )} call.
*/
- LdapDN getSuffix ( NextInterceptor next, GetSuffixOperationContext opContext ) throws NamingException;
+ LdapDN getSuffix ( NextInterceptor next, GetSuffixOperationContext opContext ) throws Exception;
/**
* Filters {@link PartitionNexus#listSuffixes( ListSuffixOperationContext )} call.
*/
- Iterator<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext ) throws NamingException;
+ Iterator<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext ) throws Exception;
/**
* Filters {@link PartitionNexus#addContextPartition( AddContextPartitionOperationContext )} call.
*/
- void addContextPartition( NextInterceptor next, AddContextPartitionOperationContext opContext ) throws NamingException;
+ void addContextPartition( NextInterceptor next, AddContextPartitionOperationContext opContext ) throws Exception;
/**
* Filters {@link PartitionNexus#removeContextPartition( RemoveContextPartitionOperationContext )} call.
*/
- void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws NamingException;
+ void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws Exception;
/**
* Filters {@link PartitionNexus#compare( CompareOperationContext )} call.
*/
- boolean compare( NextInterceptor next, CompareOperationContext opContext) throws NamingException;
+ boolean compare( NextInterceptor next, CompareOperationContext opContext) throws Exception;
/**
* Filters {@link Partition#delete( DeleteOperationContext )} call.
*/
- void delete( NextInterceptor next, DeleteOperationContext opContext ) throws NamingException;
+ void delete( NextInterceptor next, DeleteOperationContext opContext ) throws Exception;
/**
* Filters {@link Partition#add( AddOperationContext )} call.
*/
- void add( NextInterceptor next, AddOperationContext opContext ) throws NamingException;
+ void add( NextInterceptor next, AddOperationContext opContext ) throws Exception;
/**
* Filters {@link Partition#modify( ModifyOperationContext )} call.
*/
- void modify( NextInterceptor next, ModifyOperationContext opContext ) throws NamingException;
+ void modify( NextInterceptor next, ModifyOperationContext opContext ) throws Exception;
/**
* Filters {@link Partition#list( ListOperationContext )} call.
*/
- NamingEnumeration<ServerSearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException;
+ NamingEnumeration<ServerSearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws Exception;
/**
* Filters {@link Partition#search( SearchOperationContext )} call.
*/
- NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException;
+ NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws Exception;
/**
* Filters {@link Partition#lookup( LookupOperationContext )} call.
*/
- ServerEntry lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException;
+ ServerEntry lookup( NextInterceptor next, LookupOperationContext opContext ) throws Exception;
/**
* Filters {@link Partition#hasEntry( EntryOperationContext )} call.
*/
- boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws NamingException;
+ boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws Exception;
/**
* Filters {@link Partition#rename( RenameOperationContext )} call.
*/
- void rename( NextInterceptor next, RenameOperationContext opContext ) throws NamingException;
+ void rename( NextInterceptor next, RenameOperationContext opContext ) throws Exception;
/**
* Filters {@link Partition#move( MoveOperationContext )} call.
*/
- void move( NextInterceptor next, MoveOperationContext opContext ) throws NamingException;
+ void move( NextInterceptor next, MoveOperationContext opContext ) throws Exception;
/**
* Filters {@link Partition#moveAndRename( MoveAndRenameOperationContext) } call.
*/
void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext )
- throws NamingException;
+ throws Exception;
/**
* Filters {@link Partition#bind( BindOperationContext )} call.
*/
void bind( NextInterceptor next, BindOperationContext opContext )
- throws NamingException;
+ throws Exception;
/**
* Filters {@link Partition#unbind( UnbindOperationContext )} call.
*/
- void unbind( NextInterceptor next, UnbindOperationContext opContext ) throws NamingException;
+ void unbind( NextInterceptor next, UnbindOperationContext opContext ) throws Exception;
}