Author: akarasulu
Date: Tue Mar 22 22:11:07 2005
New Revision: 158735
URL: http://svn.apache.org/viewcvs?view=rev&rev=158735
Log:
changes ...
o reformatted code
o removed @author tags for both trustin and I replacing them with only
the directory project dev list email address
o cleaned up some javadocs that looked old
o added some javadocs that were missing: MANY still missing
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Add.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Delete.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/GetMatchedDN.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/GetSuffix.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/HasEntry.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Invocation.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/IsSuffix.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/List.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ListSuffixes.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Lookup.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/LookupWithAttrIds.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Modify.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ModifyMany.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ModifyRN.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Move.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/MoveAndModifyRN.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Search.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Authorizer.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/BaseInterceptor.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Interceptor.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/InterceptorChain.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/InterceptorConfigBuilder.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/InterceptorContext.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/InterceptorException.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/NextInterceptor.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/OperationalAttributeInterceptor.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/SchemaManager.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Validator.java
directory/apacheds/branches/interceptor_revamp/core/src/test/org/apache/ldap/server/jndi/invocation/interceptor/ConfigurationTest.java
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Add.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Add.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Add.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Add.java
Tue Mar 22 22:11:07 2005
@@ -16,60 +16,73 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#add(String, Name, Attributes)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class Add extends Invocation {
+public class Add extends Invocation
+{
private final String userProvidedName;
+
private final Name normalizedName;
+
private final Attributes attributes;
-
+
+
public Add( String userProvidedName, Name normalizedName, Attributes
attributes )
{
- if( userProvidedName == null )
+ if ( userProvidedName == null )
{
throw new NullPointerException( "userProvidedName" );
}
-
- if( normalizedName == null )
+
+ if ( normalizedName == null )
{
throw new NullPointerException( "normalizedName" );
}
-
- if( attributes == null )
+
+ if ( attributes == null )
{
throw new NullPointerException( "attributes" );
}
-
+
this.userProvidedName = userProvidedName;
this.normalizedName = normalizedName;
this.attributes = attributes;
}
- public Attributes getAttributes() {
+
+ public Attributes getAttributes()
+ {
return attributes;
}
- public Name getNormalizedName() {
+
+ public Name getNormalizedName()
+ {
return normalizedName;
}
-
- public String getUserProvidedName() {
+
+
+ public String getUserProvidedName()
+ {
return userProvidedName;
}
- protected Object doExecute( BackingStore store ) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
store.add( userProvidedName, normalizedName, attributes );
return null;
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Delete.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Delete.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Delete.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Delete.java
Tue Mar 22 22:11:07 2005
@@ -16,37 +16,44 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#delete(Name)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class Delete extends Invocation {
+public class Delete extends Invocation
+{
private final Name name;
-
+
+
public Delete( Name name )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
-
+
this.name = name;
}
- public Name getName() {
+
+ public Name getName()
+ {
return name;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
store.delete( name );
return null;
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/GetMatchedDN.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/GetMatchedDN.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/GetMatchedDN.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/GetMatchedDN.java
Tue Mar 22 22:11:07 2005
@@ -16,44 +16,54 @@
*/
package org.apache.ldap.server.jndi.invocation;
-import javax.naming.Name;
-import javax.naming.NamingException;
import org.apache.ldap.server.BackingStore;
import org.apache.ldap.server.PartitionNexus;
+import javax.naming.Name;
+import javax.naming.NamingException;
+
+
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
PartitionNexus#getMatchedDn(Name, boolean)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class GetMatchedDN extends Invocation {
+public class GetMatchedDN extends Invocation
+{
private final Name name;
+
private final boolean normalized;
-
+
+
public GetMatchedDN( Name name, boolean normalized )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
-
+
this.name = name;
this.normalized = normalized;
}
- public boolean isNormalized() {
+
+ public boolean isNormalized()
+ {
return normalized;
}
- public Name getName() {
+
+ public Name getName()
+ {
return name;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
return ( ( PartitionNexus ) store ).getMatchedDn( name, normalized );
}
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/GetSuffix.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/GetSuffix.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/GetSuffix.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/GetSuffix.java
Tue Mar 22 22:11:07 2005
@@ -16,44 +16,54 @@
*/
package org.apache.ldap.server.jndi.invocation;
-import javax.naming.Name;
-import javax.naming.NamingException;
import org.apache.ldap.server.BackingStore;
import org.apache.ldap.server.ContextPartition;
+import javax.naming.Name;
+import javax.naming.NamingException;
+
+
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
ContextPartition#getSuffix(boolean)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class GetSuffix extends Invocation {
+public class GetSuffix extends Invocation
+{
private final Name name;
+
private final boolean normalized;
-
+
+
public GetSuffix( Name name, boolean normalized )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
-
+
this.name = name;
this.normalized = normalized;
}
- public boolean isNormalized() {
+
+ public boolean isNormalized()
+ {
return normalized;
}
- public Name getName() {
+
+ public Name getName()
+ {
return name;
}
- protected Object doExecute(BackingStore store) throws NamingException {
- return ( ( ContextPartition) store ).getSuffix( normalized );
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
+ return ( ( ContextPartition ) store ).getSuffix( normalized );
}
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/HasEntry.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/HasEntry.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/HasEntry.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/HasEntry.java
Tue Mar 22 22:11:07 2005
@@ -16,37 +16,44 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#hasEntry(Name)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class HasEntry extends Invocation {
+public class HasEntry extends Invocation
+{
private final Name name;
-
+
+
public HasEntry( Name name )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
-
+
this.name = name;
}
- public Name getName() {
+
+ public Name getName()
+ {
return name;
}
- protected Object doExecute(BackingStore store) throws NamingException {
- return store.hasEntry( name )? Boolean.TRUE : Boolean.FALSE;
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
+ return store.hasEntry( name ) ? Boolean.TRUE : Boolean.FALSE;
}
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Invocation.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Invocation.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Invocation.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Invocation.java
Tue Mar 22 22:11:07 2005
@@ -16,36 +16,39 @@
*/
package org.apache.ldap.server.jndi.invocation;
-import java.util.Stack;
+
+import org.apache.ldap.server.BackingStore;
import javax.naming.NamingException;
+import java.util.Stack;
-import org.apache.ldap.server.BackingStore;
/**
- * Represents a method invocation on [EMAIL PROTECTED] BackingStore}s.
- * You can perform any [EMAIL PROTECTED] BackingStore} calls by invoking
- * [EMAIL PROTECTED]
org.apache.ldap.server.jndi.JndiProvider#invoke(Invocation)}.
- * <p>
- * This class is abstract, and developers should extend this class
- * to represent the actual method invocations.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ * Represents a method invocation on [EMAIL PROTECTED] BackingStore}s. You can
perform any
+ * [EMAIL PROTECTED] BackingStore} calls by invoking [EMAIL PROTECTED]
+ * org.apache.ldap.server.jndi.JndiProvider#invoke(Invocation)}.<p/>
+ * This class is abstract, and developers should extend this class to
+ * represent the actual method invocations.
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public abstract class Invocation {
+public abstract class Invocation
+{
protected Object response;
+
protected Stack contextStack;
- /**
- * Creates a new instance. This constructor does nothing.
- */
+
+ /**
+ * Creates a new instance. This constructor does nothing.
+ */
protected Invocation()
{
}
-
+
+
/**
* Returns the response object for this invocation.
*/
@@ -53,7 +56,8 @@
{
return response;
}
-
+
+
/**
* Sets the response object for this invocation.
*/
@@ -61,10 +65,11 @@
{
this.response = response;
}
-
+
+
/**
- * Gets the context stack in which this invocation occurs. The context
- * stack is a stack of LdapContexts.
+ * Gets the context stack in which this invocation occurs. The
+ * context stack is a stack of LdapContexts.
*
* @return a stack of LdapContexts in which the invocation occurs
*/
@@ -73,38 +78,37 @@
return contextStack;
}
+
/**
- * Sets the context stack in which this invocation occurs. The context
- * stack is a stack of LdapContexts.
+ * Sets the context stack in which this invocation occurs. The context
stack
+ * is a stack of LdapContexts.
*
- * @param contextStack a stack of LdapContexts in which the invocation
- * occurs
+ * @param contextStack a stack of LdapContexts in which the invocation
occurs
*/
public void setContextStack( Stack contextStack )
{
this.contextStack = contextStack;
}
-
- /**
- * Executes this invocation on the specified <code>store</code>.
- * The default implementation calls an abstract method
- * [EMAIL PROTECTED] #doExecute(BackingStore)} and sets the
- * <code>response</code> property of this invocation to its
- * return value.
- *
- * @throws NamingException if the operation failed
- */
+
+
+ /**
+ * Executes this invocation on the specified <code>store</code>. The
default
+ * implementation calls an abstract method [EMAIL PROTECTED]
#doExecute(BackingStore)}
+ * and sets the <code>response</code> property of this invocation to its
return value.
+ *
+ * @throws NamingException if the operation failed
+ */
public void execute( BackingStore store ) throws NamingException
{
setResponse( doExecute( store ) );
}
-
- /**
- * Implement this method to invoke the appropriate operation
- * on the specified <code>store</code>. Returned value will be
- * set as the <code>response</code> proeprty of this invocation.
- *
- * @throws NamingException if the operation failed
- */
+
+
+ /**
+ * Implement this method to invoke the appropriate operation on the
specified
+ * <code>store</code>. Returned value will be set as the
<code>response</code> proeprty of this invocation.
+ *
+ * @throws NamingException if the operation failed
+ */
protected abstract Object doExecute( BackingStore store ) throws
NamingException;
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/IsSuffix.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/IsSuffix.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/IsSuffix.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/IsSuffix.java
Tue Mar 22 22:11:07 2005
@@ -16,37 +16,44 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#isSuffix(Name)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class IsSuffix extends Invocation {
+public class IsSuffix extends Invocation
+{
private final Name name;
-
+
+
public IsSuffix( Name name )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
-
+
this.name = name;
}
- public Name getName() {
+
+ public Name getName()
+ {
return name;
}
- protected Object doExecute(BackingStore store) throws NamingException {
- return store.isSuffix( name )? Boolean.TRUE : Boolean.FALSE;
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
+ return store.isSuffix( name ) ? Boolean.TRUE : Boolean.FALSE;
}
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/List.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/List.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/List.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/List.java
Tue Mar 22 22:11:07 2005
@@ -16,37 +16,44 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#list(Name)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class List extends Invocation {
+public class List extends Invocation
+{
private final Name baseName;
-
+
+
public List( Name baseName )
{
- if( baseName == null )
+ if ( baseName == null )
{
throw new NullPointerException( "baseName" );
}
-
+
this.baseName = baseName;
}
- public Name getBaseName() {
+
+ public Name getBaseName()
+ {
return baseName;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
return store.list( baseName );
}
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ListSuffixes.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ListSuffixes.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ListSuffixes.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ListSuffixes.java
Tue Mar 22 22:11:07 2005
@@ -16,32 +16,39 @@
*/
package org.apache.ldap.server.jndi.invocation;
-import javax.naming.NamingException;
import org.apache.ldap.server.BackingStore;
import org.apache.ldap.server.PartitionNexus;
+import javax.naming.NamingException;
+
+
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
PartitionNexus#listSuffixes(boolean)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class ListSuffixes extends Invocation {
+public class ListSuffixes extends Invocation
+{
private final boolean normalized;
-
+
+
public ListSuffixes( boolean normalized )
{
this.normalized = normalized;
}
- public boolean isNormalized() {
+
+ public boolean isNormalized()
+ {
return normalized;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
return ( ( PartitionNexus ) store ).listSuffixes( normalized );
}
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Lookup.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Lookup.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Lookup.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Lookup.java
Tue Mar 22 22:11:07 2005
@@ -16,37 +16,44 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#lookup(Name)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class Lookup extends Invocation {
+public class Lookup extends Invocation
+{
private final Name name;
-
+
+
public Lookup( Name name )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
-
+
this.name = name;
}
- public Name getName() {
+
+ public Name getName()
+ {
return name;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
return store.lookup( name );
}
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/LookupWithAttrIds.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/LookupWithAttrIds.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/LookupWithAttrIds.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/LookupWithAttrIds.java
Tue Mar 22 22:11:07 2005
@@ -16,26 +16,30 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#lookup(Name, String[])}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class LookupWithAttrIds extends Invocation {
+public class LookupWithAttrIds extends Invocation
+{
private final Name name;
+
private final String[] attributeIds;
-
+
+
public LookupWithAttrIds( Name name, String[] attributeIds )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
@@ -43,15 +47,21 @@
this.attributeIds = attributeIds;
}
- public Name getName() {
+
+ public Name getName()
+ {
return name;
}
-
- public String[] getAttributeIds() {
+
+
+ public String[] getAttributeIds()
+ {
return attributeIds;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
return store.lookup( name, attributeIds );
}
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Modify.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Modify.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Modify.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Modify.java
Tue Mar 22 22:11:07 2005
@@ -16,53 +16,63 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#modify(Name, int, Attributes)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class Modify extends Invocation {
+public class Modify extends Invocation
+{
private final Name name;
+
private final int modOp;
+
private final Attributes attributes;
-
+
+
public Modify( Name name, int modOp, Attributes attributes )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
-
+
this.name = name;
this.modOp = modOp;
this.attributes = attributes;
}
+
public Name getName()
{
return name;
}
-
+
+
public int getModOp()
{
return modOp;
}
-
+
+
public Attributes getAttributes()
{
return attributes;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
store.modify( name, modOp, attributes );
return null;
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ModifyMany.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ModifyMany.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ModifyMany.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ModifyMany.java
Tue Mar 22 22:11:07 2005
@@ -16,50 +16,58 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
import javax.naming.directory.ModificationItem;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#modify(Name, ModificationItem[])}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class ModifyMany extends Invocation {
+public class ModifyMany extends Invocation
+{
private final Name name;
+
private final ModificationItem[] modificationItems;
-
+
+
public ModifyMany( Name name, ModificationItem[] modificationItems )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
- if( modificationItems == null )
+ if ( modificationItems == null )
{
throw new NullPointerException( "modificationItems" );
}
-
+
this.name = name;
this.modificationItems = modificationItems;
}
+
public Name getName()
{
return name;
}
-
+
+
public ModificationItem[] getModificationItems()
{
return modificationItems;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
store.modify( name, modificationItems );
return null;
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ModifyRN.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ModifyRN.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ModifyRN.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/ModifyRN.java
Tue Mar 22 22:11:07 2005
@@ -16,58 +16,68 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#modifyRn(Name, String, boolean)\}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class ModifyRN extends Invocation {
+public class ModifyRN extends Invocation
+{
private final Name name;
+
private final String newRelativeName;
+
private final boolean deleteOldName;
-
+
+
public ModifyRN( Name name, String newRelativeName,
- boolean deleteOldName )
+ boolean deleteOldName )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
-
- if( newRelativeName == null )
+
+ if ( newRelativeName == null )
{
throw new NullPointerException( "newRelativeName" );
}
-
+
this.name = name;
this.newRelativeName = newRelativeName;
this.deleteOldName = deleteOldName;
}
-
+
+
public Name getName()
{
return name;
}
+
public String getNewRelativeName()
{
return newRelativeName;
}
-
+
+
public boolean isDeleteOldName()
{
return deleteOldName;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
store.modifyRn( name, newRelativeName, deleteOldName );
return null;
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Move.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Move.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Move.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Move.java
Tue Mar 22 22:11:07 2005
@@ -16,50 +16,58 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#move(Name, Name)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class Move extends Invocation {
+public class Move extends Invocation
+{
private final Name name;
+
private final Name newParentName;
-
+
+
public Move( Name name, Name newParentName )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
-
- if( newParentName == null )
+
+ if ( newParentName == null )
{
throw new NullPointerException( "newParentName" );
}
-
+
this.name = name;
this.newParentName = newParentName;
}
-
+
+
public Name getName()
{
return name;
}
+
public Name getNewParentName()
{
return newParentName;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
store.move( name, newParentName );
return null;
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/MoveAndModifyRN.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/MoveAndModifyRN.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/MoveAndModifyRN.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/MoveAndModifyRN.java
Tue Mar 22 22:11:07 2005
@@ -16,68 +16,80 @@
*/
package org.apache.ldap.server.jndi.invocation;
+
+import org.apache.ldap.server.BackingStore;
+
import javax.naming.Name;
import javax.naming.NamingException;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#move(Name, Name, String, boolean)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class MoveAndModifyRN extends Invocation {
+public class MoveAndModifyRN extends Invocation
+{
private final Name name;
+
private final Name newParentName;
+
private final String newRelativeName;
+
private final boolean deleteOldName;
-
+
+
public MoveAndModifyRN( Name name, Name newParentName, String
newRelativeName,
- boolean deleteOldName )
+ boolean deleteOldName )
{
- if( name == null )
+ if ( name == null )
{
throw new NullPointerException( "name" );
}
- if( newParentName == null )
+ if ( newParentName == null )
{
throw new NullPointerException( "newParentName" );
}
- if( newRelativeName == null )
+ if ( newRelativeName == null )
{
throw new NullPointerException( "newRelativeName" );
}
-
+
this.name = name;
this.newParentName = newParentName;
this.newRelativeName = newRelativeName;
this.deleteOldName = deleteOldName;
}
-
+
+
public Name getName()
{
return name;
}
-
+
+
public Name getNewParentName()
{
return newParentName;
}
+
public String getNewRelativeName()
{
return newRelativeName;
}
-
+
+
public boolean isDeleteOldName()
{
return deleteOldName;
}
- protected Object doExecute(BackingStore store) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
store.move( name, newParentName, newRelativeName, deleteOldName );
return null;
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Search.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Search.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Search.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/Search.java
Tue Mar 22 22:11:07 2005
@@ -16,76 +16,87 @@
*/
package org.apache.ldap.server.jndi.invocation;
-import java.util.Map;
+
+import org.apache.ldap.common.filter.ExprNode;
+import org.apache.ldap.server.BackingStore;
import javax.naming.Name;
import javax.naming.NamingException;
import javax.naming.directory.SearchControls;
+import java.util.Map;
-import org.apache.ldap.common.filter.ExprNode;
-import org.apache.ldap.server.BackingStore;
/**
* Represents an [EMAIL PROTECTED] Invocation} on [EMAIL PROTECTED]
BackingStore#search(Name, Map, ExprNode, SearchControls)}.
- *
- * @author Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
-public class Search extends Invocation {
+public class Search extends Invocation
+{
private final Name baseName;
+
private final Map environment;
+
private final ExprNode filter;
+
private final SearchControls controls;
-
+
+
public Search( Name baseName, Map environment, ExprNode filters,
SearchControls controls )
{
- if( baseName == null )
+ if ( baseName == null )
{
throw new NullPointerException( "baseName" );
}
- if( environment == null )
+ if ( environment == null )
{
throw new NullPointerException( "environment" );
}
- if( filters == null )
+ if ( filters == null )
{
throw new NullPointerException( "filter" );
}
- if( controls == null )
+ if ( controls == null )
{
throw new NullPointerException( "controls" );
}
-
+
this.baseName = baseName;
this.environment = environment;
this.filter = filters;
this.controls = controls;
}
+
public Name getBaseName()
{
return baseName;
}
-
+
+
public Map getEnvironment()
{
return environment;
}
-
+
+
public ExprNode getFilter()
{
return filter;
}
-
+
+
public SearchControls getControls()
{
return controls;
}
- protected Object doExecute( BackingStore store ) throws NamingException {
+
+ protected Object doExecute( BackingStore store ) throws NamingException
+ {
return store.search( baseName, environment, filter, controls );
}
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Authorizer.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Authorizer.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Authorizer.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Authorizer.java
Tue Mar 22 22:11:07 2005
@@ -16,14 +16,6 @@
*/
package org.apache.ldap.server.jndi.invocation.interceptor;
-import javax.naming.Name;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.ModificationItem;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.naming.ldap.LdapContext;
import org.apache.ldap.common.exception.LdapNoPermissionException;
import org.apache.ldap.common.name.DnParser;
@@ -32,45 +24,50 @@
import org.apache.ldap.server.db.ResultFilteringEnumeration;
import org.apache.ldap.server.db.SearchResultFilter;
import org.apache.ldap.server.jndi.ServerContext;
-import org.apache.ldap.server.jndi.invocation.Delete;
-import org.apache.ldap.server.jndi.invocation.HasEntry;
-import org.apache.ldap.server.jndi.invocation.Invocation;
-import org.apache.ldap.server.jndi.invocation.List;
-import org.apache.ldap.server.jndi.invocation.Lookup;
-import org.apache.ldap.server.jndi.invocation.LookupWithAttrIds;
-import org.apache.ldap.server.jndi.invocation.Modify;
-import org.apache.ldap.server.jndi.invocation.ModifyMany;
-import org.apache.ldap.server.jndi.invocation.ModifyRN;
-import org.apache.ldap.server.jndi.invocation.Move;
-import org.apache.ldap.server.jndi.invocation.MoveAndModifyRN;
-import org.apache.ldap.server.jndi.invocation.Search;
+import org.apache.ldap.server.jndi.invocation.*;
import org.apache.ldap.server.schema.AttributeTypeRegistry;
import org.apache.ldap.server.schema.ConcreteNameComponentNormalizer;
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.LdapContext;
+
/**
* An [EMAIL PROTECTED] Interceptor} that controls access to [EMAIL PROTECTED]
BackingStore}
* operations. If a user tries to perform any operations that requires
- * permission he or she doesn't have, [EMAIL PROTECTED] NamingException} will
be thrown
- * and therefore the current invocation chain will terminate.
+ * permission he or she doesn't have, [EMAIL PROTECTED] NamingException} will
be
+ * thrown and therefore the current invocation chain will terminate.
*
- * @author The Apache Directory Project ([email protected])
- * @author Alex Karasulu ([EMAIL PROTECTED])
- * @author Trustin Lee ([EMAIL PROTECTED])
- *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
public class Authorizer extends BaseInterceptor
{
- /** the administrator's distinguished [EMAIL PROTECTED] Name} */
+ /**
+ * the administrator's distinguished [EMAIL PROTECTED] Name}
+ */
private static final Name ADMIN_DN = SystemPartition.getAdminDn();
- /** the base distinguished [EMAIL PROTECTED] Name} for all users */
+
+ /**
+ * the base distinguished [EMAIL PROTECTED] Name} for all users
+ */
private static final Name USER_BASE_DN = SystemPartition.getUsersBaseDn();
- /** the base distinguished [EMAIL PROTECTED] Name} for all groups */
+
+ /**
+ * the base distinguished [EMAIL PROTECTED] Name} for all groups
+ */
private static final Name GROUP_BASE_DN =
SystemPartition.getGroupsBaseDn();
- /** the name parser used by this service */
- private DnParser dnParser;
+ /**
+ * the name parser used by this service
+ */
+ private DnParser dnParser;
/**
@@ -79,17 +76,20 @@
public Authorizer()
{
}
-
+
+
public void init( InterceptorContext ctx ) throws NamingException
{
AttributeTypeRegistry atr =
ctx.getGlobalRegistries().getAttributeTypeRegistry();
dnParser = new DnParser( new ConcreteNameComponentNormalizer( atr ) );
}
-
+
+
public void destroy()
{
}
-
+
+
public void process( NextInterceptor nextInterceptor, Invocation call )
throws NamingException
{
super.process( nextInterceptor, call );
@@ -119,7 +119,7 @@
}
if ( name.size() > 2 && name.startsWith( USER_BASE_DN )
- && ! principalDn.equals( ADMIN_DN ) )
+ && !principalDn.equals( ADMIN_DN ) )
{
String msg = "User " + principalDn;
msg += " does not have permission to delete the user account: ";
@@ -128,25 +128,23 @@
}
if ( name.size() > 2 && name.startsWith( GROUP_BASE_DN )
- && ! principalDn.equals( ADMIN_DN ) )
+ && !principalDn.equals( ADMIN_DN ) )
{
String msg = "User " + principalDn;
msg += " does not have permission to delete the group entry: ";
msg += name + ". Only the admin can delete groups.";
throw new LdapNoPermissionException( msg );
}
-
+
nextInterceptor.process( call );
}
/**
* Note that we do nothing here. First because this is not an externally
- * exposed function via the JNDI interfaces. It is used internally by the
- * provider for optimization purposes so there is no reason for us to start
- * to constrain it.
- *
- * @see org.apache.ldap.server.jndi.BaseInterceptor#hasEntry(Name)
+ * exposed function via the JNDI interfaces. It is used internally by
+ * the provider for optimization purposes so there is no reason for us to
+ * start to constrain it.
*/
protected void process( NextInterceptor nextInterceptor, HasEntry call )
throws NamingException
{
@@ -160,12 +158,10 @@
/**
- * This policy needs to be really tight too because some attributes may
- * take part in giving the user permissions to protected resources. We
- * do not want users to self access these resources. As far as we're
- * concerned no one but the admin needs access.
- *
- * @see BaseInterceptor#modify(Name, int, Attributes)
+ * This policy needs to be really tight too because some attributes may
take
+ * part in giving the user permissions to protected resources. We do not
want
+ * users to self access these resources. As far as we're concerned no one
but
+ * the admin needs access.
*/
protected void process( NextInterceptor nextInterceptor, Modify call )
throws NamingException
{
@@ -175,12 +171,10 @@
/**
- * This policy needs to be really tight too because some attributes may
- * take part in giving the user permissions to protected resources. We
- * do not want users to self access these resources. As far as we're
- * concerned no one but the admin needs access.
- *
- * @see BaseInterceptor#modify(Name, ModificationItem[])
+ * This policy needs to be really tight too because some attributes may
take part
+ * in giving the user permissions to protected resources. We do not want
users to
+ * self access these resources. As far as we're concerned no one but the
admin
+ * needs access.
*/
protected void process( NextInterceptor nextInterceptor, ModifyMany call )
throws NamingException
{
@@ -199,7 +193,7 @@
throw new LdapNoPermissionException( msg );
}
- if ( ! principalDn.equals( ADMIN_DN ) )
+ if ( !principalDn.equals( ADMIN_DN ) )
{
if ( dn == ADMIN_DN || dn.equals( ADMIN_DN ) )
{
@@ -279,7 +273,7 @@
throw new LdapNoPermissionException( msg );
}
- if ( dn.size() > 2 && dn.startsWith( USER_BASE_DN ) && !
principalDn.equals( ADMIN_DN ) )
+ if ( dn.size() > 2 && dn.startsWith( USER_BASE_DN ) &&
!principalDn.equals( ADMIN_DN ) )
{
String msg = "User '" + principalDn;
msg += "' does not have permission to move or rename the user";
@@ -288,7 +282,7 @@
throw new LdapNoPermissionException( msg );
}
- if ( dn.size() > 2 && dn.startsWith( GROUP_BASE_DN ) && !
principalDn.equals( ADMIN_DN ) )
+ if ( dn.size() > 2 && dn.startsWith( GROUP_BASE_DN ) &&
!principalDn.equals( ADMIN_DN ) )
{
String msg = "User " + principalDn;
msg += " does not have permission to move or rename the group
entry ";
@@ -296,12 +290,14 @@
throw new LdapNoPermissionException( msg );
}
}
-
- protected void process(NextInterceptor nextInterceptor, Lookup call)
throws NamingException {
- super.process(nextInterceptor, call);
-
+
+
+ protected void process( NextInterceptor nextInterceptor, Lookup call )
throws NamingException
+ {
+ super.process( nextInterceptor, call );
+
Attributes attributes = ( Attributes ) call.getResponse();
- if( attributes == null )
+ if ( attributes == null )
{
return;
}
@@ -312,11 +308,13 @@
call.setResponse( retval );
}
- protected void process(NextInterceptor nextInterceptor, LookupWithAttrIds
call) throws NamingException {
- super.process(nextInterceptor, call);
-
+
+ protected void process( NextInterceptor nextInterceptor, LookupWithAttrIds
call ) throws NamingException
+ {
+ super.process( nextInterceptor, call );
+
Attributes attributes = ( Attributes ) call.getResponse();
- if( attributes == null )
+ if ( attributes == null )
{
return;
}
@@ -326,12 +324,13 @@
protectLookUp( ctx, call.getName() );
call.setResponse( retval );
}
-
+
+
private void protectLookUp( LdapContext ctx, Name dn ) throws
NamingException
{
Name principalDn = ( ( ServerContext ) ctx ).getPrincipal().getDn();
- if ( ! principalDn.equals( ADMIN_DN ) )
+ if ( !principalDn.equals( ADMIN_DN ) )
{
if ( dn.size() > 2 && dn.startsWith( USER_BASE_DN ) )
{
@@ -376,38 +375,42 @@
}
}
}
-
- protected void process(NextInterceptor nextInterceptor, Search call)
throws NamingException {
- super.process(nextInterceptor, call);
-
+
+
+ protected void process( NextInterceptor nextInterceptor, Search call )
throws NamingException
+ {
+ super.process( nextInterceptor, call );
+
SearchControls searchControls = call.getControls();
if ( searchControls.getReturningAttributes() != null )
{
return;
}
- NamingEnumeration e ;
+ NamingEnumeration e;
ResultFilteringEnumeration retval;
LdapContext ctx = ( LdapContext ) call.getContextStack().peek();
e = ( NamingEnumeration ) call.getResponse();
retval = new ResultFilteringEnumeration( e, searchControls, ctx,
- new SearchResultFilter()
- {
- public boolean accept( LdapContext ctx, SearchResult result,
- SearchControls controls )
- throws NamingException
+ new SearchResultFilter()
{
- return Authorizer.this.isSearchable( ctx, result );
- }
- } );
+ public boolean accept( LdapContext ctx, SearchResult
result,
+ SearchControls controls )
+ throws NamingException
+ {
+ return Authorizer.this.isSearchable( ctx, result );
+ }
+ } );
call.setResponse( retval );
}
- protected void process(NextInterceptor nextInterceptor, List call) throws
NamingException {
- super.process(nextInterceptor, call);
-
- NamingEnumeration e ;
+
+ protected void process( NextInterceptor nextInterceptor, List call )
throws NamingException
+ {
+ super.process( nextInterceptor, call );
+
+ NamingEnumeration e;
ResultFilteringEnumeration retval;
LdapContext ctx = ( LdapContext ) call.getContextStack().peek();
e = ( NamingEnumeration ) call.getResponse();
@@ -425,34 +428,35 @@
call.setResponse( retval );
}
+
private boolean isSearchable( LdapContext ctx, SearchResult result )
throws NamingException
{
Name dn;
- synchronized( dnParser )
+ synchronized ( dnParser )
{
dn = dnParser.parse( result.getName() );
}
-
+
Name principalDn = ( ( ServerContext ) ctx ).getPrincipal().getDn();
- if ( ! principalDn.equals( ADMIN_DN ) )
+ if ( !principalDn.equals( ADMIN_DN ) )
{
- if ( dn.size() > 2 )
+ if ( dn.size() > 2 )
{
if ( dn.startsWith( USER_BASE_DN ) || dn.startsWith(
GROUP_BASE_DN ) )
{
return false;
}
}
-
+
if ( dn.equals( ADMIN_DN ) )
{
return false;
}
-
+
}
-
+
return true;
}
}
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/BaseInterceptor.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/BaseInterceptor.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/BaseInterceptor.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/BaseInterceptor.java
Tue Mar 22 22:11:07 2005
@@ -17,38 +17,21 @@
package org.apache.ldap.server.jndi.invocation.interceptor;
-import javax.naming.NamingException;
-
import org.apache.ldap.server.auth.LdapPrincipal;
import org.apache.ldap.server.jndi.ServerContext;
-import org.apache.ldap.server.jndi.invocation.Add;
-import org.apache.ldap.server.jndi.invocation.Invocation;
-import org.apache.ldap.server.jndi.invocation.Delete;
-import org.apache.ldap.server.jndi.invocation.GetMatchedDN;
-import org.apache.ldap.server.jndi.invocation.GetSuffix;
-import org.apache.ldap.server.jndi.invocation.HasEntry;
-import org.apache.ldap.server.jndi.invocation.IsSuffix;
-import org.apache.ldap.server.jndi.invocation.List;
-import org.apache.ldap.server.jndi.invocation.ListSuffixes;
-import org.apache.ldap.server.jndi.invocation.Lookup;
-import org.apache.ldap.server.jndi.invocation.LookupWithAttrIds;
-import org.apache.ldap.server.jndi.invocation.Modify;
-import org.apache.ldap.server.jndi.invocation.ModifyMany;
-import org.apache.ldap.server.jndi.invocation.ModifyRN;
-import org.apache.ldap.server.jndi.invocation.Move;
-import org.apache.ldap.server.jndi.invocation.MoveAndModifyRN;
-import org.apache.ldap.server.jndi.invocation.Search;
+import org.apache.ldap.server.jndi.invocation.*;
+
+import javax.naming.NamingException;
/**
- * A easy-to-use implementation of [EMAIL PROTECTED] Interceptor} that
demultiplexes
- * invocations using method signature overloading.
- * <p>
- * This [EMAIL PROTECTED] Interceptor} forwards received process requests to an
- * appropriate <code>process(NextInterceptor,
<em>ConcreteInvocation</em>)</code>
- * methods. Users can override any <code>process(..)</code> methods that
- * corresponds to [EMAIL PROTECTED] Invocation} types that he or she wants to
filter.
- * <p>
+ * A easy-to-use implementation of [EMAIL PROTECTED] Interceptor} that
demultiplexes invocations using method signature
+ * overloading.
+ * <p/>
+ * This [EMAIL PROTECTED] Interceptor} forwards received process requests to
an appropriate <code>process(NextInterceptor,
+ * <em>ConcreteInvocation</em>)</code> methods. Users can override any
<code>process(..)</code> methods that
+ * corresponds to [EMAIL PROTECTED] Invocation} types that he or she wants to
filter.
+ * <p/>
* For example, if user wants to filter [EMAIL PROTECTED] Add} invocation:
* <pre>
* public class MyInterceptor extends BaseInterceptor
@@ -60,19 +43,16 @@
* }
* }
* </pre>
- * <code>BaseInterceptor</code> handles all long and tedious if-elseif blocks
- * behind the scene.
+ * <code>BaseInterceptor</code> handles all long and tedious if-elseif blocks
behind the scene.
*
- * @author The Apache Directory Project ([email protected])
- * @author Alex Karasulu ([EMAIL PROTECTED])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
*/
public abstract class BaseInterceptor implements Interceptor
{
/**
* Gets the call's current context's Principal.
- *
+ *
* @return the principal making the call
*/
public static LdapPrincipal getPrincipal( Invocation call )
@@ -81,6 +61,7 @@
return ctx.getPrincipal();
}
+
protected BaseInterceptor()
{
}
@@ -91,79 +72,78 @@
/**
* Uses a switch on the invocation method type to call the respective
member
- * analog method that does the work of the Interceptor for that Invocation
- * method.
+ * analog method that does the work of the Interceptor for that Invocation
method.
*/
public void process( NextInterceptor nextInterceptor, Invocation call )
throws NamingException
{
- if( call instanceof Add )
+ if ( call instanceof Add )
{
process( nextInterceptor, ( Add ) call );
}
- else if( call instanceof Delete )
+ else if ( call instanceof Delete )
{
process( nextInterceptor, ( Delete ) call );
}
- else if( call instanceof GetMatchedDN )
+ else if ( call instanceof GetMatchedDN )
{
process( nextInterceptor, ( GetMatchedDN ) call );
}
- else if( call instanceof GetSuffix )
+ else if ( call instanceof GetSuffix )
{
process( nextInterceptor, ( GetSuffix ) call );
}
- else if( call instanceof HasEntry )
+ else if ( call instanceof HasEntry )
{
process( nextInterceptor, ( HasEntry ) call );
}
- else if( call instanceof IsSuffix )
+ else if ( call instanceof IsSuffix )
{
process( nextInterceptor, ( IsSuffix ) call );
}
- else if( call instanceof List )
+ else if ( call instanceof List )
{
process( nextInterceptor, ( List ) call );
}
- else if( call instanceof ListSuffixes )
+ else if ( call instanceof ListSuffixes )
{
process( nextInterceptor, ( ListSuffixes ) call );
}
- else if( call instanceof Lookup )
+ else if ( call instanceof Lookup )
{
process( nextInterceptor, ( Lookup ) call );
}
- else if( call instanceof LookupWithAttrIds )
+ else if ( call instanceof LookupWithAttrIds )
{
process( nextInterceptor, ( LookupWithAttrIds ) call );
}
- else if( call instanceof Modify )
+ else if ( call instanceof Modify )
{
process( nextInterceptor, ( Modify ) call );
}
- else if( call instanceof ModifyMany )
+ else if ( call instanceof ModifyMany )
{
process( nextInterceptor, ( ModifyMany ) call );
}
- else if( call instanceof ModifyRN )
+ else if ( call instanceof ModifyRN )
{
process( nextInterceptor, ( ModifyRN ) call );
}
- else if( call instanceof Move )
+ else if ( call instanceof Move )
{
process( nextInterceptor, ( Move ) call );
}
- else if( call instanceof MoveAndModifyRN )
+ else if ( call instanceof MoveAndModifyRN )
{
process( nextInterceptor, ( MoveAndModifyRN ) call );
}
- else if( call instanceof Search )
+ else if ( call instanceof Search )
{
process( nextInterceptor, ( Search ) call );
}
- else {
- throw new IllegalArgumentException(
- "Unknown call type: " + call.getClass() );
+ else
+ {
+ throw new IllegalArgumentException( "Unknown call type: " +
call.getClass() );
}
}
@@ -177,91 +157,106 @@
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, Delete call )
+
+ protected void process( NextInterceptor nextInterceptor, Delete call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, GetMatchedDN call
)
+
+ protected void process( NextInterceptor nextInterceptor, GetMatchedDN call
)
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, GetSuffix call )
+
+ protected void process( NextInterceptor nextInterceptor, GetSuffix call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, HasEntry call )
+
+ protected void process( NextInterceptor nextInterceptor, HasEntry call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, IsSuffix call )
+
+ protected void process( NextInterceptor nextInterceptor, IsSuffix call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, List call )
+
+ protected void process( NextInterceptor nextInterceptor, List call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, ListSuffixes call
)
+
+ protected void process( NextInterceptor nextInterceptor, ListSuffixes call
)
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, Lookup call )
+
+ protected void process( NextInterceptor nextInterceptor, Lookup call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, LookupWithAttrIds
call )
+
+ protected void process( NextInterceptor nextInterceptor, LookupWithAttrIds
call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, Modify call )
+
+ protected void process( NextInterceptor nextInterceptor, Modify call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, ModifyMany call )
+
+ protected void process( NextInterceptor nextInterceptor, ModifyMany call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, ModifyRN call )
+
+ protected void process( NextInterceptor nextInterceptor, ModifyRN call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, Move call )
+
+ protected void process( NextInterceptor nextInterceptor, Move call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, MoveAndModifyRN
call )
+
+ protected void process( NextInterceptor nextInterceptor, MoveAndModifyRN
call )
throws NamingException
{
nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextInterceptor, Search call )
+
+ protected void process( NextInterceptor nextInterceptor, Search call )
throws NamingException
{
nextInterceptor.process( call );
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Interceptor.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Interceptor.java?view=diff&r1=158734&r2=158735
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Interceptor.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Interceptor.java
Tue Mar 22 22:11:07 2005
@@ -16,24 +16,24 @@
*/
package org.apache.ldap.server.jndi.invocation.interceptor;
-import javax.naming.NamingException;
import org.apache.ldap.server.BackingStore;
import org.apache.ldap.server.jndi.invocation.Invocation;
+import javax.naming.NamingException;
+
+
/**
- * Filters any directory operations. You can filter any
- * [EMAIL PROTECTED] Invocation}s performed on [EMAIL PROTECTED]
BackingStore}s just like Servlet
- * filters do.
- *
- * <h2>Interceptor Chaining</h2>
- * Interceptors should usually pass the control of current invocation
- * to the next interceptor by calling [EMAIL PROTECTED]
NextInterceptor#process(Invocation)}.
- * The flow control is returned when the next interceptor's
- * [EMAIL PROTECTED] Interceptor#process(NextInterceptor, Invocation)} returns.
- * You can therefore implement pre-, post-, around- invocation
- * handler by how you place the statement.
- * <p>
+ * Filters any directory operations. You can filter any [EMAIL PROTECTED]
Invocation}s
+ * performed on [EMAIL PROTECTED] BackingStore}s just like Servlet filters do.
+ * <p/>
+ * <h2>Interceptor Chaining</h2> Interceptors should usually pass the control
+ * of current invocation to the next interceptor by calling
+ * [EMAIL PROTECTED] NextInterceptor#process(Invocation)}. The flow control is
returned
+ * when the next interceptor's [EMAIL PROTECTED]
Interceptor#process(NextInterceptor, Invocation)}
+ * returns. You can therefore implement pre-, post-, around- invocation
+ * handler by how you place the statement.
+ * <p/>
* <h3>Pre-invocation Filtering</h3>
* <pre>
* public void process( NextInterceptor nextInterceptor, Invocation invocation
)
@@ -42,7 +42,7 @@
* nextInterceptor.process( invocation );
* }
* </pre>
- *
+ * <p/>
* <h3>Post-invocation Filtering</h3>
* <pre>
* public void process( NextInterceptor nextInterceptor, Invocation invocation
)
@@ -51,12 +51,12 @@
* System.out.println( "Invocation ended." );
* }
* </pre>
- *
+ * <p/>
* <h3>Around-invocation Filtering</h3>
* <pre>
* public void process( NextInterceptor nextInterceptor, Invocation invocation
)
* {
- * long startTime = System.currentTimeMillis();
+ * long startTime = System.currentTimeMillis();
* try
* {
* nextInterceptor.process( invocation );
@@ -68,52 +68,52 @@
* }
* }
* </pre>
- *
+ * <p/>
* <h2>Interceptor Naming Convention</h2>
- * <p>
- * When you create an implementation of Interceptor, you have to follow
- * the basic class naming convention to avoid others' confusion:
+ * <p/>
+ * When you create an implementation of Interceptor, you have to follow the
+ * basic class naming convention to avoid others' confusion:
* <ul>
- * <li>Class name must be an agent noun or end with
'<code>Interceptor</code>'.</li>
+ * <li>Class name must be an agent noun or end with
'<code>Interceptor</code>'.</li>
* </ul>
* Plus, placing your interceptor implementations to packages like
* '<code>interceptor</code>' would be the best practice.
- *
+ * <p/>
* <h2>Overriding Default Interceptor Settings</h2>
- * <p>
+ * <p/>
* See [EMAIL PROTECTED] org.apache.ldap.server.jndi.EnvKeys#INTERCEPTORS} and
* [EMAIL PROTECTED] InterceptorChain#newDefaultChain()}.
- *
- * @author The Apache Directory Project ([email protected])
- * @author Trustin Lee ([EMAIL PROTECTED])
+ *
+ * @author <a href="mailto:[email protected]">Apache Directory
Project</a>
* @version $Rev$, $Date$
- *
- * @see InvocationChain
* @see NextInterceptor
*/
public interface Interceptor
{
/**
- * Intializes this interceptor. This is invoked by directory service
- * provider when this intercepter is loaded into interceptor chain.
- *
- * @param config the configuration properties for this interceptor
+ * Intializes this interceptor. This is invoked by directory
+ * service provider when this intercepter is loaded into interceptor chain.
+ *
+ * @param context the configuration properties for this interceptor
* @throws NamingException if failed to initialize this interceptor
*/
void init( InterceptorContext context ) throws NamingException;
+
/**
- * Deinitializes this interceptor. This is invoked by directory service
- * provider when this intercepter is unloaded from interceptor chain.
+ * Deinitializes this interceptor. This is invoked by directory
+ * service provider when this intercepter is unloaded from interceptor
chain.
*/
void destroy();
+
/**
* Filters a particular invocation. You can pass control to
- * <code>nextInterceptor</code> by calling [EMAIL PROTECTED]
NextInterceptor#invoke(Invocation)}.
+ * <code>nextInterceptor</code> by calling [EMAIL PROTECTED]
NextInterceptor#process(
+ * org.apache.ldap.server.jndi.invocation.Invocation)}
*
* @param nextInterceptor the next interceptor in the interceptor chain
- * @param invocation the invocation to process
+ * @param invocation the invocation to process
* @throws NamingException on failures while handling the invocation
*/
void process( NextInterceptor nextInterceptor, Invocation invocation )