You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2008/05/23 03:37:14 UTC
svn commit: r659355 - in
/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core:
authn/ interceptor/context/ jndi/
Author: elecharny
Date: Thu May 22 18:37:11 2008
New Revision: 659355
URL: http://svn.apache.org/viewvc?rev=659355&view=rev
Log:
o Modified the OperationContext to store the PrincipalDN into it
o Removed the password from the LdapPrincipal structure
o Moved the OperationContext from the doAddOperation to the caller, in order to get ready for the JNDI removal
o Added a getName() method in the opContext
Modified:
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddContextPartitionOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EntryOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetMatchedNameOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetRootDSEOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListSuffixOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RemoveContextPartitionOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ReplaceOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java Thu May 22 18:37:11 2008
@@ -25,7 +25,6 @@
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.util.StringTools;
/**
@@ -48,11 +47,6 @@
/** the authentication level for this principal */
private final AuthenticationLevel authenticationLevel;
- /** The userPassword
- * @todo security risk remove this immediately
- */
- private byte[] userPassword;
-
/**
* Creates a new LDAP/X500 principal without any group associations. Keep
@@ -65,12 +59,13 @@
public LdapPrincipal( LdapDN name, AuthenticationLevel authenticationLevel )
{
this.name = name;
+
if ( ! name.isNormalized() )
{
throw new IllegalStateException( "Names used for principals must be normalized!" );
}
+
this.authenticationLevel = authenticationLevel;
- this.userPassword = null;
}
/**
@@ -86,7 +81,6 @@
{
this.name = name;
this.authenticationLevel = authenticationLevel;
- this.userPassword = userPassword;
}
@@ -98,7 +92,6 @@
{
name = new LdapDN();
authenticationLevel = AuthenticationLevel.NONE;
- userPassword = null;
}
@@ -140,18 +133,6 @@
*/
public String toString()
{
- return "['" + name.getUpName() + "', '" + StringTools.utf8ToString( userPassword ) +"']'";
- }
-
-
- public byte[] getUserPassword()
- {
- return userPassword;
- }
-
-
- public void setUserPassword( byte[] userPassword )
- {
- this.userPassword = userPassword;
+ return "['" + name.getUpName() + /*"', '" + StringTools.utf8ToString( userPassword ) +*/ "']'";
}
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java Thu May 22 18:37:11 2008
@@ -188,45 +188,25 @@
* @return A byte array which can be empty if the password was not found
* @throws NamingException If we have a problem during the lookup operation
*/
- private LdapPrincipal getStoredPassword( Registries registries, LdapDN principalDN ) throws NamingException
+ private byte[] getStoredPassword( Registries registries, LdapDN principalDN ) throws NamingException
{
- LdapPrincipal principal;
- String principalNorm = principalDN.getNormName();
+ byte[] storedPassword;
- synchronized( credentialCache )
- {
- principal = (LdapPrincipal)credentialCache.get( principalNorm );
- }
+ // Not found in the cache
+ // Get the user password from the backend
+ storedPassword = lookupUserPassword( registries, principalDN );
- byte[] storedPassword;
- if ( principal == null )
+ // Deal with the special case where the user didn't enter a password
+ // We will compare the empty array with the credentials. Sometime,
+ // a user does not set a password. This is bad, but there is nothing
+ // we can do against that, except education ...
+ if ( storedPassword == null )
{
- // Not found in the cache
- // Get the user password from the backend
- storedPassword = lookupUserPassword( registries, principalDN );
-
-
- // Deal with the special case where the user didn't enter a password
- // We will compare the empty array with the credentials. Sometime,
- // a user does not set a password. This is bad, but there is nothing
- // we can do against that, except education ...
- if ( storedPassword == null )
- {
- storedPassword = ArrayUtils.EMPTY_BYTE_ARRAY;
- }
-
- // Create the new principal before storing it in the cache
- principal = new LdapPrincipal( principalDN, AuthenticationLevel.SIMPLE, storedPassword );
-
- // Now, update the local cache.
- synchronized( credentialCache )
- {
- credentialCache.put( principalDN.getNormName(), principal );
- }
+ storedPassword = ArrayUtils.EMPTY_BYTE_ARRAY;
}
-
- return principal;
+
+ return storedPassword;
}
/**
@@ -307,10 +287,28 @@
// ---- extract password from JNDI environment
byte[] credentials = getCredentials( ctx );
- LdapPrincipal principal = getStoredPassword( getDirectoryService().getRegistries(), principalDn );
+ LdapPrincipal principal;
+ String principalNorm = principalDn.getNormName();
+
+ synchronized( credentialCache )
+ {
+ principal = (LdapPrincipal)credentialCache.get( principalNorm );
+ }
+
+ byte[] storedPassword = getStoredPassword( getDirectoryService().getRegistries(), principalDn );
+
+ if ( principal == null )
+ {
+ // Create the new principal before storing it in the cache
+ principal = new LdapPrincipal( principalDn, AuthenticationLevel.SIMPLE );
+
+ // Now, update the local cache.
+ synchronized( credentialCache )
+ {
+ credentialCache.put( principalDn.getNormName(), principal );
+ }
+ }
- // Get the stored password, either from cache or from backend
- byte[] storedPassword = principal.getUserPassword();
// Short circuit for PLAIN TEXT passwords : we compare the byte array directly
// Are the passwords equal ?
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java Thu May 22 18:37:11 2008
@@ -45,6 +45,9 @@
/** The DN associated with the context */
private LdapDN dn;
+ /** The principal DN associated with the context */
+ private LdapDN principalDn;
+
/** The associated request's controls */
private Map<String, Control> requestControls = new HashMap<String, Control>(4);
@@ -236,11 +239,37 @@
/**
- * Remove the invocation fro the invocation stack
+ * Remove the invocation from the invocation stack
*/
public void pop()
{
InvocationStack stack = InvocationStack.getInstance();
stack.pop();
}
+
+
+ /**
+ * Set the principal DN into this context.
+ *
+ * @param principalDn the principal DN
+ */
+ public void setPrincipalDN( LdapDN principalDn )
+ {
+ this.principalDn= principalDn;
+ }
+
+
+ /**
+ * @return the PrincipalDN
+ */
+ public LdapDN getPrincipalDN()
+ {
+ return principalDn;
+ }
+
+
+ /**
+ * @return the operation name
+ */
+ public abstract String getName();
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddContextPartitionOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddContextPartitionOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddContextPartitionOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddContextPartitionOperationContext.java Thu May 22 18:37:11 2008
@@ -78,4 +78,13 @@
{
this.partition = partition;
}
+
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return "AddContextPartition";
+ }
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java Thu May 22 18:37:11 2008
@@ -22,6 +22,7 @@
import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
@@ -123,6 +124,15 @@
/**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return MessageTypeEnum.ADD_REQUEST.name();
+ }
+
+
+ /**
* @see Object#toString()
*/
public String toString()
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java Thu May 22 18:37:11 2008
@@ -22,6 +22,7 @@
import java.util.List;
import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
import org.apache.directory.shared.ldap.util.StringTools;
/**
@@ -87,11 +88,22 @@
return saslAuthId;
}
+
public void setSaslAuthId( String saslAuthId )
{
this.saslAuthId = saslAuthId;
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return MessageTypeEnum.BIND_REQUEST.name();
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java Thu May 22 18:37:11 2008
@@ -20,6 +20,7 @@
package org.apache.directory.server.core.interceptor.context;
import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.util.StringTools;
@@ -127,6 +128,16 @@
this.value = value;
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return MessageTypeEnum.COMPARE_REQUEST.name();
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java Thu May 22 18:37:11 2008
@@ -20,6 +20,7 @@
package org.apache.directory.server.core.interceptor.context;
import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
/**
@@ -75,6 +76,15 @@
/**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return MessageTypeEnum.DEL_REQUEST.name();
+ }
+
+
+ /**
* @see Object#toString()
*/
public String toString()
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java Thu May 22 18:37:11 2008
@@ -29,7 +29,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public class EmptyOperationContext extends AbstractOperationContext
+public abstract class EmptyOperationContext extends AbstractOperationContext
{
/**
* Creates a new instance of EmptyOperationContext.
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EntryOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EntryOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EntryOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EntryOperationContext.java Thu May 22 18:37:11 2008
@@ -20,6 +20,7 @@
package org.apache.directory.server.core.interceptor.context;
import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
/**
@@ -49,6 +50,16 @@
super( registries, entryDn );
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return MessageTypeEnum.ADD_REQUEST.name();
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetMatchedNameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetMatchedNameOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetMatchedNameOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetMatchedNameOperationContext.java Thu May 22 18:37:11 2008
@@ -49,6 +49,16 @@
super( registries, dn );
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return "MatchedName";
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetRootDSEOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetRootDSEOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetRootDSEOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetRootDSEOperationContext.java Thu May 22 18:37:11 2008
@@ -50,6 +50,15 @@
}
/**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return "GetRootDSE";
+ }
+
+
+ /**
* @see Object#toString()
*/
public String toString()
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixOperationContext.java Thu May 22 18:37:11 2008
@@ -49,6 +49,16 @@
super( registries, dn );
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return "GetSuffix";
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListSuffixOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListSuffixOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListSuffixOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListSuffixOperationContext.java Thu May 22 18:37:11 2008
@@ -49,6 +49,16 @@
super( registries, dn );
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return "ListSuffix";
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java Thu May 22 18:37:11 2008
@@ -215,6 +215,16 @@
return attrsOid;
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return "Lookup";
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java Thu May 22 18:37:11 2008
@@ -30,6 +30,7 @@
import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.entry.Modification;
import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
/**
@@ -118,6 +119,15 @@
/**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return MessageTypeEnum.MODIFY_REQUEST.name();
+ }
+
+
+ /**
* @see Object#toString()
*/
public String toString()
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java Thu May 22 18:37:11 2008
@@ -20,6 +20,7 @@
package org.apache.directory.server.core.interceptor.context;
import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
/**
@@ -73,6 +74,16 @@
this.parent = parent;
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return MessageTypeEnum.MOD_DN_REQUEST.name();
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java Thu May 22 18:37:11 2008
@@ -75,7 +75,7 @@
/**
* Adds a response control to this operation.
*
- * @param responseControl the response control to add to this operation.
+ * @param responseControl the response control to add to this operation
*/
void addResponseControl( Control responseControl );
@@ -125,7 +125,7 @@
/**
* Adds a request control to this operation.
*
- * @param requestControl the request control to add to this operation.
+ * @param requestControl the request control to add to this operation
*/
void addRequestControl( Control requestControl );
@@ -151,7 +151,27 @@
/**
* Adds many request controls to this operation.
*
- * @param requestControls the request controls to add to this operation.
+ * @param requestControls the request controls to add to this operation
*/
void addRequestControls( Control[] requestControls );
+
+
+ /**
+ * Set the principal DN into this context.
+ *
+ * @param principalDn the principal DN
+ */
+ void setPrincipalDN( LdapDN principalDn );
+
+
+ /**
+ * @return the PrincipalDN
+ */
+ LdapDN getPrincipalDN();
+
+
+ /**
+ * @return the operation's name
+ */
+ String getName();
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RemoveContextPartitionOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RemoveContextPartitionOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RemoveContextPartitionOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RemoveContextPartitionOperationContext.java Thu May 22 18:37:11 2008
@@ -50,6 +50,16 @@
super( registries, dn );
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return "RemoveContext";
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java Thu May 22 18:37:11 2008
@@ -21,6 +21,7 @@
import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.Rdn;
@@ -106,6 +107,15 @@
/**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return MessageTypeEnum.MOD_DN_REQUEST.name();
+ }
+
+
+ /**
* @see Object#toString()
*/
public String toString()
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ReplaceOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ReplaceOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ReplaceOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ReplaceOperationContext.java Thu May 22 18:37:11 2008
@@ -20,6 +20,7 @@
package org.apache.directory.server.core.interceptor.context;
import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
/**
@@ -73,6 +74,16 @@
this.parent = parent;
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return MessageTypeEnum.MOD_DN_REQUEST.name();
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java Thu May 22 18:37:11 2008
@@ -20,6 +20,7 @@
package org.apache.directory.server.core.interceptor.context;
import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
/**
@@ -49,6 +50,16 @@
super( registries, principalDn );
}
+
+ /**
+ * @return the operation name
+ */
+ public String getName()
+ {
+ return MessageTypeEnum.UNBIND_REQUEST.name();
+ }
+
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?rev=659355&r1=659354&r2=659355&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java Thu May 22 18:37:11 2008
@@ -25,6 +25,7 @@
import org.apache.directory.server.core.authn.LdapPrincipal;
import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
import org.apache.directory.server.core.partition.PartitionNexusProxy;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -328,7 +329,10 @@
ServerEntry clone = ( ServerEntry ) serverEntry.clone();
try
{
- doAddOperation( target, clone );
+ // setup the op context
+ AddOperationContext opCtx = new AddOperationContext( registries, clone );
+
+ doAddOperation( opCtx, target, clone );
}
catch ( Exception e )
{
@@ -355,7 +359,10 @@
try
{
- doAddOperation( target, clone );
+ // setup the op context
+ AddOperationContext opCtx = new AddOperationContext( registries, clone );
+
+ doAddOperation( opCtx, target, clone );
}
catch ( Exception e )
{
@@ -393,7 +400,10 @@
JavaLdapSupport.serialize( serverEntry, obj, registries );
try
{
- doAddOperation( target, clone );
+ // setup the op context
+ AddOperationContext opCtx = new AddOperationContext( registries, clone );
+
+ doAddOperation( opCtx, target, clone );
}
catch ( Exception e )
{
@@ -416,7 +426,10 @@
try
{
- doAddOperation( target, entry );
+ // setup the op context
+ AddOperationContext opCtx = new AddOperationContext( registries, entry );
+
+ doAddOperation( opCtx, target, entry );
}
catch ( Exception e )
{
@@ -531,7 +544,12 @@
// Add the new context to the server which as a side effect adds
try
{
- doAddOperation( target, ServerEntryUtils.toServerEntry( attributes, target, registries ) );
+ ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attributes, target, registries );
+
+ // setup the op context
+ AddOperationContext opCtx = new AddOperationContext( registries, serverEntry );
+
+ doAddOperation( opCtx, target, serverEntry );
}
catch ( Exception e )
{