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 2010/01/26 23:55:43 UTC
svn commit: r903472 [2/2] - in /directory/apacheds/trunk: all/
avl-partition/ core-annotations/ core-api/
core-api/src/main/java/org/apache/directory/server/core/
core-api/src/main/java/org/apache/directory/server/core/interceptor/context/
core-avl/ co...
Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Tue Jan 26 22:55:37 2010
@@ -83,6 +83,7 @@
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.filter.PresenceNode;
import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
import org.apache.directory.shared.ldap.message.AliasDerefMode;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.name.AVA;
@@ -247,7 +248,7 @@
// Use these methods instead of manually calling the nexusProxy so we can
// add request controls to operation contexts before the call and extract
// response controls from the contexts after the call. NOTE that the
- // requestControls must be cleared after each operation. This makes a
+ // JndiUtils.fromJndiControls( requestControls ) must be cleared after each operation. This makes a
// context not thread safe.
// ------------------------------------------------------------------------
@@ -261,7 +262,7 @@
// setup the op context and populate with request controls
AddOperationContext opCtx = new AddOperationContext( session, entry );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// Inject the referral handling into the operation context
injectReferralControl( opCtx );
@@ -272,7 +273,7 @@
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
}
@@ -285,7 +286,7 @@
// setup the op context and populate with request controls
DeleteOperationContext opCtx = new DeleteOperationContext( session, target );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// Inject the referral handling into the operation context
injectReferralControl( opCtx );
@@ -296,7 +297,7 @@
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
}
@@ -335,7 +336,7 @@
// setup the op context and populate with request controls
opContext = new SearchOperationContext( session, dn, aliasDerefMode, filter,
searchControls );
- opContext.addRequestControls( requestControls );
+ opContext.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
if ( result )
{
@@ -354,7 +355,7 @@
// setup the op context and populate with request controls
opContext = new SearchOperationContext( session, dn, aliasDerefMode, filter,
searchControls );
- opContext.addRequestControls( requestControls );
+ opContext.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// Inject the referral handling into the operation context
injectReferralControl( opContext );
@@ -365,7 +366,7 @@
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opContext.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opContext.getResponseControls() );
return results;
}
@@ -378,7 +379,7 @@
{
// setup the op context and populate with request controls
ListOperationContext opCtx = new ListOperationContext( session, target );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// execute list operation
OperationManager operationManager = service.getOperationManager();
@@ -386,7 +387,7 @@
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
return results;
}
@@ -395,7 +396,7 @@
protected ServerEntry doGetRootDSEOperation( LdapDN target ) throws Exception
{
GetRootDSEOperationContext opCtx = new GetRootDSEOperationContext( session, target );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// do not reset request controls since this is not an external
// operation and not do bother setting the response controls either
@@ -414,13 +415,13 @@
// execute lookup/getRootDSE operation
opCtx = new LookupOperationContext( session, target );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
OperationManager operationManager = service.getOperationManager();
ServerEntry serverEntry = operationManager.lookup( opCtx );
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
return serverEntry;
}
@@ -435,13 +436,13 @@
// execute lookup/getRootDSE operation
opCtx = new LookupOperationContext( session, target, attrIds );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
OperationManager operationManager = service.getOperationManager();
ClonedServerEntry serverEntry = operationManager.lookup( opCtx );
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
// Now remove the ObjectClass attribute if it has not been requested
if ( ( opCtx.getAttrsId() != null ) && ( opCtx.getAttrsId().size() != 0 ) )
@@ -469,7 +470,7 @@
opCtx.setCredentials( credentials );
opCtx.setSaslMechanism( saslMechanism );
opCtx.setSaslAuthId( saslAuthId );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// execute bind operation
OperationManager operationManager = service.getOperationManager();
@@ -477,7 +478,7 @@
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
return opCtx;
}
@@ -491,7 +492,7 @@
// setup the op context and populate with request controls
MoveAndRenameOperationContext opCtx = new MoveAndRenameOperationContext( session, oldDn, parent, new RDN(
newRdn ), delOldDn );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// Inject the referral handling into the operation context
injectReferralControl( opCtx );
@@ -502,7 +503,7 @@
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
}
@@ -513,7 +514,7 @@
{
// setup the op context and populate with request controls
ModifyOperationContext opCtx = new ModifyOperationContext( session, dn, modifications );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// Inject the referral handling into the operation context
injectReferralControl( opCtx );
@@ -524,7 +525,7 @@
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
}
@@ -535,7 +536,7 @@
{
// setup the op context and populate with request controls
MoveOperationContext opCtx = new MoveOperationContext( session, oldDn, target );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// Inject the referral handling into the operation context
injectReferralControl( opCtx );
@@ -546,7 +547,7 @@
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
}
@@ -557,7 +558,7 @@
{
// setup the op context and populate with request controls
RenameOperationContext opCtx = new RenameOperationContext( session, oldDn, newRdn, delOldRdn );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// Inject the referral handling into the operation context
injectReferralControl( opCtx );
@@ -568,7 +569,7 @@
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
}
Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java Tue Jan 26 22:55:37 2010
@@ -67,6 +67,7 @@
import org.apache.directory.shared.ldap.filter.PresenceNode;
import org.apache.directory.shared.ldap.filter.SearchScope;
import org.apache.directory.shared.ldap.filter.SimpleNode;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
import org.apache.directory.shared.ldap.message.AliasDerefMode;
import org.apache.directory.shared.ldap.name.AVA;
import org.apache.directory.shared.ldap.name.LdapDN;
Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java Tue Jan 26 22:55:37 2010
@@ -38,6 +38,7 @@
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.NotImplementedException;
import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.util.StringTools;
@@ -218,7 +219,7 @@
CompareOperationContext opCtx = new CompareOperationContext( getSession(), name, oid, val );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
// Inject the Referral flag
injectReferralControl( opCtx );
@@ -253,7 +254,7 @@
{
LdapDN principalDn = getSession().getEffectivePrincipal().getJndiName();
UnbindOperationContext opCtx = new UnbindOperationContext( getSession() );
- opCtx.addRequestControls( requestControls );
+ opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
try
{
super.getDirectoryService().getOperationManager().unbind( opCtx );
@@ -262,7 +263,7 @@
{
JndiUtils.wrap( e );
}
- responseControls = opCtx.getResponseControls();
+ responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
requestControls = EMPTY_CONTROLS;
}
Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java (original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java Tue Jan 26 22:55:37 2010
@@ -26,7 +26,6 @@
import java.util.Set;
import javax.naming.NamingException;
-import javax.naming.ldap.Control;
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.changelog.LogChange;
@@ -65,6 +64,7 @@
import org.apache.directory.shared.ldap.message.InternalModifyRequest;
import org.apache.directory.shared.ldap.message.InternalSearchRequest;
import org.apache.directory.shared.ldap.message.InternalUnbindRequest;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.RDN;
import org.apache.directory.shared.ldap.schema.AttributeType;
Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java (original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java Tue Jan 26 22:55:37 2010
@@ -23,7 +23,6 @@
import java.util.List;
import javax.naming.NamingException;
-import javax.naming.ldap.Control;
import org.apache.directory.server.core.entry.ClonedServerEntry;
import org.apache.directory.server.core.entry.ServerEntry;
@@ -34,6 +33,7 @@
import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.name.LdapDN;
public class MockOperation implements OperationContext
Modified: directory/apacheds/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/pom.xml?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/core/pom.xml (original)
+++ directory/apacheds/trunk/core/pom.xml Tue Jan 26 22:55:37 2010
@@ -26,6 +26,7 @@
<artifactId>apacheds-parent</artifactId>
<version>1.5.6-SNAPSHOT</version>
</parent>
+
<artifactId>apacheds-core</artifactId>
<name>ApacheDS Core</name>
<packaging>jar</packaging>
@@ -38,21 +39,27 @@
<dependencies>
<dependency>
- <groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-i18n</artifactId>
- <version>${pom.version}</version>
+ <groupId>${groupId}</groupId>
+ <version>${version}</version>
</dependency>
<dependency>
- <groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-core-api</artifactId>
+ <groupId>${groupId}</groupId>
<version>${pom.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-utils</artifactId>
- <version>${pom.version}</version>
+ <groupId>${groupId}</groupId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>apacheds-utils</artifactId>
+ <groupId>${groupId}</groupId>
+ <version>${version}</version>
</dependency>
<dependency>
@@ -75,6 +82,7 @@
</systemProperties>
</configuration>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java Tue Jan 26 22:55:37 2010
@@ -26,7 +26,6 @@
import java.util.Set;
import javax.naming.NamingException;
-import javax.naming.ldap.Control;
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.changelog.LogChange;
@@ -65,6 +64,7 @@
import org.apache.directory.shared.ldap.message.InternalModifyRequest;
import org.apache.directory.shared.ldap.message.InternalSearchRequest;
import org.apache.directory.shared.ldap.message.InternalUnbindRequest;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.RDN;
import org.apache.directory.shared.ldap.schema.AttributeType;
Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java Tue Jan 26 22:55:37 2010
@@ -34,7 +34,6 @@
import java.util.Set;
import javax.naming.NamingException;
-import javax.naming.ldap.Control;
import javax.naming.ldap.LdapContext;
import org.apache.directory.server.core.CoreSession;
@@ -89,6 +88,7 @@
import org.apache.directory.shared.ldap.cursor.CursorIterator;
import org.apache.directory.shared.ldap.entry.Modification;
import org.apache.directory.shared.ldap.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.registries.Registries;
Modified: directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java (original)
+++ directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java Tue Jan 26 22:55:37 2010
@@ -34,6 +34,7 @@
import org.apache.directory.shared.ldap.client.api.exception.LdapException;
import org.apache.directory.shared.ldap.client.api.messages.BindResponse;
import org.apache.directory.shared.ldap.name.LdapDN;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -75,6 +76,10 @@
{
fail();
}
+ catch ( IOException ioe )
+ {
+ fail();
+ }
finally
{
try
@@ -90,6 +95,7 @@
@Test
+ @Ignore
public void testGetSupportedControls() throws Exception
{
LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort() );
Modified: directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java (original)
+++ directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java Tue Jan 26 22:55:37 2010
@@ -48,6 +48,7 @@
import org.apache.directory.shared.ldap.message.AliasDerefMode;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
@@ -90,6 +91,7 @@
@Test
+ @Ignore
public void testAbandonSearch() throws Exception
{
// injecting some values to keep the
Modified: directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientBindRequestTest.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientBindRequestTest.java (original)
+++ directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientBindRequestTest.java Tue Jan 26 22:55:37 2010
@@ -24,7 +24,6 @@
import static org.junit.Assert.fail;
import java.io.IOException;
-import java.util.concurrent.Semaphore;
import org.apache.directory.server.annotations.CreateLdapServer;
import org.apache.directory.server.annotations.CreateTransport;
@@ -35,8 +34,12 @@
import org.apache.directory.shared.ldap.client.api.listeners.BindListener;
import org.apache.directory.shared.ldap.client.api.messages.BindRequest;
import org.apache.directory.shared.ldap.client.api.messages.BindResponse;
+import org.apache.directory.shared.ldap.client.api.messages.Response;
+import org.apache.directory.shared.ldap.client.api.messages.future.ResponseFuture;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -56,7 +59,11 @@
public class ClientBindRequestTest extends AbstractLdapTestUnit
{
private LdapConnection connection;
+
+ /**
+ * Create the LdapConnection
+ */
@Before
public void setup() throws Exception
{
@@ -65,6 +72,23 @@
/**
+ * Close the LdapConnection
+ */
+ @After
+ public void shutdown()
+ {
+ try
+ {
+ connection.close();
+ }
+ catch( IOException ioe )
+ {
+ fail();
+ }
+ }
+
+
+ /**
* Test a successful synchronous bind request
*
* @throws IOException
@@ -72,8 +96,6 @@
@Test
public void testSyncBindRequest() throws Exception
{
- connection = new LdapConnection( "localhost", ldapServer.getPort() );
-
try
{
BindResponse bindResponse = connection.bind( "uid=admin,ou=system", "secret" );
@@ -81,24 +103,14 @@
assertNotNull( bindResponse );
assertNotNull( bindResponse.getLdapResult() );
assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
-
+ assertEquals( 1, bindResponse.getMessageId() );
+
connection.unBind();
}
catch ( LdapException le )
{
fail();
}
- finally
- {
- try
- {
- connection.close();
- }
- catch( IOException ioe )
- {
- fail();
- }
- }
}
@@ -108,36 +120,36 @@
* @throws IOException
*/
@Test
+ @Ignore
public void testAsyncBindRequest() throws Exception
{
int i = 0;
int nbLoop = 10;
- final Semaphore lock = new Semaphore( 1 );
try
{
- lock.acquire();
-
for ( ; i < nbLoop; i++)
{
- connection = new LdapConnection( "localhost", ldapServer.getPort() );
-
BindRequest bindRequest = new BindRequest();
bindRequest.setName( "uid=admin,ou=system" );
bindRequest.setCredentials( "secret" );
-
- connection.bind( bindRequest, new BindListener()
+ final int loop = i;
+
+ ResponseFuture bindFuture = connection.bind( bindRequest, new BindListener()
{
public void bindCompleted( LdapConnection connection, BindResponse bindResponse ) throws LdapException
{
assertNotNull( bindResponse );
assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
- lock.release();
+ assertEquals( 1, bindResponse.getMessageId() );
+ System.out.println( "Bound " + loop );
}
} );
- lock.acquire();
- lock.release();
+ Response bindResponse = (Response)bindFuture.get();
+ bindResponse.wait();
+
+ System.out.println( "Unbinding " + loop );
connection.unBind();
}
}
@@ -150,16 +162,68 @@
{
e.printStackTrace();
}
- finally
+ }
+
+
+ @Test
+ public void testSimpleBindAnonymous() throws Exception
+ {
+ try
{
- try
- {
- connection.close();
- }
- catch( IOException ioe )
- {
- fail();
- }
+ BindResponse bindResponse = connection.bind();
+
+ assertNotNull( bindResponse );
+ assertNotNull( bindResponse.getLdapResult() );
+ assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
+ assertEquals( 1, bindResponse.getMessageId() );
+
+ connection.unBind();
+ }
+ catch ( LdapException le )
+ {
+ fail();
+ }
+ }
+
+
+ @Test
+ public void testSimpleBindAnonymous2() throws Exception
+ {
+ try
+ {
+ BindResponse bindResponse = connection.bind( "", "" );
+
+ assertNotNull( bindResponse );
+ assertNotNull( bindResponse.getLdapResult() );
+ assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
+ assertEquals( 1, bindResponse.getMessageId() );
+
+ connection.unBind();
+ }
+ catch ( LdapException le )
+ {
+ fail();
+ }
+ }
+
+
+ @Test
+ public void testSimpleBindAnonymous3() throws Exception
+ {
+ try
+ {
+ BindResponse bindResponse = connection.bind( (String)null, (String)null );
+
+ assertNotNull( bindResponse );
+ assertNotNull( bindResponse.getLdapResult() );
+ assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
+ assertEquals( 1, bindResponse.getMessageId() );
+
+ connection.unBind();
+ }
+ catch ( LdapException le )
+ {
+ fail();
}
}
}
Added: directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/utils/SASLPrep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/utils/SASLPrep.java?rev=903472&view=auto
==============================================================================
--- directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/utils/SASLPrep.java (added)
+++ directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/utils/SASLPrep.java Tue Jan 26 22:55:37 2010
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.client.api.utils;
+
+/**
+ * This class implement the RFC 4013. It contains methods to prepare
+ * String passwords before the client API can send them to the server.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SASLPrep
+{
+
+}
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolConstants.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolConstants.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolConstants.java Tue Jan 26 22:55:37 2010
@@ -19,7 +19,8 @@
*/
package org.apache.directory.server.ldap;
-import javax.naming.ldap.Control;
+import org.apache.directory.shared.ldap.message.control.Control;
+
/**
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java Tue Jan 26 22:55:37 2010
@@ -20,17 +20,16 @@
package org.apache.directory.server.ldap;
-import javax.naming.ldap.Control;
-
-import org.apache.directory.shared.ldap.message.InternalExtendedRequest;
import org.apache.directory.shared.ldap.message.ExtendedRequestImpl;
-import org.apache.directory.shared.ldap.message.InternalControl;
+import org.apache.directory.shared.ldap.message.InternalExtendedRequest;
import org.apache.directory.shared.ldap.message.InternalRequest;
-import org.apache.directory.shared.ldap.message.ResponseCarryingMessageException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.message.InternalResultResponse;
import org.apache.directory.shared.ldap.message.InternalResultResponseRequest;
+import org.apache.directory.shared.ldap.message.ResponseCarryingMessageException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
+import org.apache.mina.core.service.IoHandler;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.ssl.SslFilter;
import org.apache.mina.handler.demux.DemuxingIoHandler;
@@ -177,13 +176,13 @@
if ( ( ( InternalRequest ) message ).getControls().size() > 0 && message instanceof InternalResultResponseRequest )
{
InternalResultResponseRequest req = ( InternalResultResponseRequest ) message;
- for ( Control control1 : req.getControls().values() )
+
+ for ( Control control : req.getControls().values() )
{
- InternalControl control = ( InternalControl ) control1;
- if ( control.isCritical() && ! ldapServer.getSupportedControls().contains( control.getID() ) )
+ if ( control.isCritical() && ! ldapServer.getSupportedControls().contains( control.getOid() ) )
{
InternalResultResponse resp = req.getResultResponse();
- resp.getLdapResult().setErrorMessage( "Unsupport critical control: " + control.getID() );
+ resp.getLdapResult().setErrorMessage( "Unsupport critical control: " + control.getOid() );
resp.getLdapResult().setResultCode( ResultCodeEnum.UNAVAILABLE_CRITICAL_EXTENSION );
session.write( resp );
return;
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java Tue Jan 26 22:55:37 2010
@@ -50,6 +50,7 @@
import org.apache.directory.shared.ldap.filter.OrNode;
import org.apache.directory.shared.ldap.filter.PresenceNode;
import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
import org.apache.directory.shared.ldap.message.InternalLdapResult;
import org.apache.directory.shared.ldap.message.InternalReferral;
import org.apache.directory.shared.ldap.message.InternalResponse;
@@ -409,7 +410,7 @@
}
pagedResultsControl = new PagedResultsControl( 0, true );
- req.getResultResponse().add( pagedResultsControl );
+ req.getResultResponse().add( JndiUtils.fromJndiControl( pagedResultsControl ) );
return;
}
@@ -422,7 +423,7 @@
// We stop here. We have to add a ResponseControl
// DO NOT WRITE THE RESPONSE - JUST RETURN IT
ldapResult.setResultCode( ResultCodeEnum.SUCCESS );
- req.getResultResponse().add( pagedResultsControl );
+ req.getResultResponse().add( JndiUtils.fromJndiControl( pagedResultsControl ) );
// Stores the cursor current position
pagedContext.incrementCurrentPosition( pageCount );
@@ -483,7 +484,7 @@
// DO NOT WRITE THE RESPONSE - JUST RETURN IT
InternalLdapResult ldapResult = req.getResultResponse().getLdapResult();
ldapResult.setResultCode( ResultCodeEnum.SUCCESS );
- req.getResultResponse().add( pagedResultsControl );
+ req.getResultResponse().add( JndiUtils.fromJndiControl( pagedResultsControl ) );
return ( InternalSearchResponseDone ) req.getResultResponse();
}
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java Tue Jan 26 22:55:37 2010
@@ -20,6 +20,19 @@
package org.apache.directory.server.ldap.handlers.bind;
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.ldap.InitialLdapContext;
+import javax.naming.ldap.LdapContext;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.sasl.AuthorizeCallback;
+import javax.security.sasl.RealmCallback;
+
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.CoreSession;
import org.apache.directory.server.core.DirectoryService;
@@ -28,10 +41,11 @@
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
import org.apache.directory.shared.ldap.message.InternalBindRequest;
import org.apache.directory.shared.ldap.message.InternalLdapResult;
-import org.apache.directory.shared.ldap.message.InternalControl;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.util.ExceptionUtils;
import org.apache.directory.shared.ldap.util.StringTools;
@@ -39,18 +53,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.ldap.InitialLdapContext;
-import javax.naming.ldap.LdapContext;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.sasl.AuthorizeCallback;
-import javax.security.sasl.RealmCallback;
-import java.util.Hashtable;
-
/**
* Base class for all SASL {@link CallbackHandler}s. Implementations of SASL mechanisms
@@ -66,7 +68,7 @@
private static final Logger LOG = LoggerFactory.getLogger( AbstractSaslCallbackHandler.class );
/** An empty control array */
- private static final InternalControl[] EMPTY = new InternalControl[0];
+ private static final Control[] EMPTY = new Control[0];
private String username;
private String realm;
@@ -238,9 +240,9 @@
try
{
- InternalControl[] connCtls = bindRequest.getControls().values().toArray( EMPTY );
+ Control[] connCtls = bindRequest.getControls().values().toArray( EMPTY );
env.put( DirectoryService.JNDI_KEY, directoryService );
- ctx = new InitialLdapContext( env, connCtls );
+ ctx = new InitialLdapContext( env, JndiUtils.toJndiControls( connCtls ) );
}
catch ( NamingException e )
{
Modified: directory/apacheds/trunk/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java (original)
+++ directory/apacheds/trunk/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java Tue Jan 26 22:55:37 2010
@@ -31,7 +31,6 @@
import javax.naming.NamingEnumeration;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
-import javax.naming.ldap.Control;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
@@ -47,6 +46,8 @@
import org.apache.directory.server.core.factory.DSAnnotationProcessor;
import org.apache.directory.server.core.partition.Partition;
import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.junit.Test;
@@ -77,7 +78,7 @@
env.put( Context.SECURITY_PRINCIPAL, ServerDNConstants.ADMIN_SYSTEM_DN );
env.put( Context.SECURITY_CREDENTIALS, "secret" );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
- return new InitialLdapContext( env, controls );
+ return new InitialLdapContext( env, JndiUtils.toJndiControls( controls ) );
}
Modified: directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java (original)
+++ directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java Tue Jan 26 22:55:37 2010
@@ -22,7 +22,6 @@
import java.util.Hashtable;
import javax.naming.Context;
-import javax.naming.ldap.Control;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
@@ -31,6 +30,8 @@
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.integ.IntegrationUtils;
import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -104,7 +105,7 @@
env.put( Context.SECURITY_PRINCIPAL, ServerDNConstants.ADMIN_SYSTEM_DN );
env.put( Context.SECURITY_CREDENTIALS, "secret" );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
- return new InitialLdapContext( env, controls );
+ return new InitialLdapContext( env, JndiUtils.toJndiControls( controls ) );
}
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java Tue Jan 26 22:55:37 2010
@@ -76,10 +76,9 @@
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.csn.Csn;
import org.apache.directory.shared.ldap.csn.CsnFactory;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.SchemaUtils;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
import org.apache.directory.shared.ldap.util.StringTools;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -191,7 +190,7 @@
DirContext ctx = ( DirContext ) getWiredContext( ldapServer ).lookup( BASE );
// modify object classes, add two more
- Attributes attributes = AttributeUtils.createAttributes(
+ Attributes attributes = LdifUtils.createAttributes(
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson" );
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java Tue Jan 26 22:55:37 2010
@@ -37,8 +37,8 @@
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
import org.apache.directory.server.integ.ServerIntegrationUtils;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -59,7 +59,7 @@
{
private Attributes getPersonAttributes( String sn, String cn ) throws NamingException
{
- Attributes attrs = AttributeUtils.createAttributes(
+ Attributes attrs = LdifUtils.createAttributes(
"objectClass: top",
"objectClass: person",
"cn", cn,
@@ -71,7 +71,7 @@
private Attributes getOrgUnitAttributes( String ou ) throws NamingException
{
- Attributes attrs = AttributeUtils.createAttributes(
+ Attributes attrs = LdifUtils.createAttributes(
"objectClass: top",
"objectClass: organizationalUnit",
"ou", ou );
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java Tue Jan 26 22:55:37 2010
@@ -65,7 +65,9 @@
import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
import org.apache.directory.shared.asn1.util.Asn1StringUtils;
import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.directory.shared.ldap.message.InternalControl;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
+import org.apache.directory.shared.ldap.message.control.Control;
+import org.apache.directory.shared.ldap.message.control.ControlImpl;
import org.apache.directory.shared.ldap.util.ArrayUtils;
import org.junit.After;
import org.junit.Before;
@@ -349,7 +351,7 @@
@Test
public void testFailureWithUnsupportedControl() throws Exception
{
- InternalControl unsupported = new InternalControl()
+ Control unsupported = new ControlImpl( "1.1.1.1" )
{
boolean isCritical = true;
private static final long serialVersionUID = 1L;
@@ -362,7 +364,7 @@
}
- public void setID( String oid )
+ public void setOid( String oid )
{
}
@@ -392,16 +394,10 @@
}
- public String getID()
+ public String getOid()
{
return "1.1.1.1";
}
-
-
- public byte[] getEncodedValue()
- {
- return new byte[0];
- }
};
ldapServer.getDirectoryService().setAllowAnonymousAccess( true );
@@ -425,18 +421,21 @@
user.put( oc );
user.put( "sn", "Bush" );
user.put( "userPassword", "Aerial" );
- ctx.setRequestControls( new InternalControl[]
- {unsupported} );
+ ctx.setRequestControls( JndiUtils.toJndiControls( new Control[]
+ {unsupported} ) );
try
{
ctx.createSubcontext( "cn=Kate Bush", user );
+ fail();
}
catch ( OperationNotSupportedException e )
{
}
unsupported.setCritical( false );
+ ctx.setRequestControls( JndiUtils.toJndiControls( new Control[]{unsupported} ) );
+
DirContext kate = ctx.createSubcontext( "cn=Kate Bush", user );
assertNotNull( kate );
assertTrue( ArrayUtils.isEquals( Asn1StringUtils.getBytesUtf8( "Aerial" ), kate.getAttributes( "" ).get(
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyAddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyAddIT.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyAddIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyAddIT.java Tue Jan 26 22:55:37 2010
@@ -50,7 +50,7 @@
import org.apache.directory.server.core.annotations.ApplyLdifs;
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -104,7 +104,7 @@
*/
protected Attributes getPersonAttributes( String sn, String cn ) throws NamingException
{
- Attributes attributes = AttributeUtils.createAttributes(
+ Attributes attributes = LdifUtils.createAttributes(
"objectClass: top",
"objectClass: person",
"objectClass: organizationalperson",
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java Tue Jan 26 22:55:37 2010
@@ -43,7 +43,7 @@
import org.apache.directory.server.core.annotations.CreateDS;
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -72,7 +72,7 @@
*/
private Attributes getPersonAttributes( String sn, String cn ) throws Exception
{
- Attributes attributes = AttributeUtils.createAttributes(
+ Attributes attributes = LdifUtils.createAttributes(
"objectClass: top",
"objectClass: person",
"cn", cn,
@@ -88,7 +88,7 @@
*/
private Attributes getOrganizationalUnitAttributes( String ou ) throws Exception
{
- Attributes attributes = AttributeUtils.createAttributes(
+ Attributes attributes = LdifUtils.createAttributes(
"objectClass: top",
"objectClass: organizationalUnit",
"ou", ou,
@@ -1024,7 +1024,7 @@
{
DirContext ctx = ( DirContext ) getWiredContext( ldapServer ).lookup( BASE );
- Attributes attributes = AttributeUtils.createAttributes(
+ Attributes attributes = LdifUtils.createAttributes(
"objectClass: top",
"objectClass: person",
"cn: Tori Amos",
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java Tue Jan 26 22:55:37 2010
@@ -33,7 +33,6 @@
import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
-import javax.naming.ldap.Control;
import javax.naming.ldap.LdapContext;
import javax.naming.ldap.PagedResultsResponseControl;
@@ -43,6 +42,8 @@
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.message.control.PagedSearchControl;
import org.apache.directory.shared.ldap.util.StringTools;
import org.junit.Before;
@@ -205,7 +206,7 @@
PagedSearchControl pagedSearchControl = new PagedSearchControl();
pagedSearchControl.setSize( pagedSize );
- ((LdapContext)ctx).setRequestControls( new Control[] {pagedSearchControl} );
+ ((LdapContext)ctx).setRequestControls( JndiUtils.toJndiControls( new Control[] {pagedSearchControl} ) );
return controls;
}
@@ -220,7 +221,7 @@
PagedSearchControl pagedSearchControl = new PagedSearchControl();
pagedSearchControl.setCookie( cookie );
pagedSearchControl.setSize( pagedSize );
- ((LdapContext)ctx).setRequestControls( new Control[] {pagedSearchControl} );
+ ((LdapContext)ctx).setRequestControls( JndiUtils.toJndiControls( new Control[] {pagedSearchControl} ) );
}
@@ -274,7 +275,7 @@
}
// Now read the next ones
- Control[] responseControls = ((LdapContext)ctx).getResponseControls();
+ javax.naming.ldap.Control[] responseControls = ((LdapContext)ctx).getResponseControls();
PagedResultsResponseControl responseControl =
(PagedResultsResponseControl)responseControls[0];
@@ -1001,7 +1002,7 @@
}
// Now read the next ones
- Control[] responseControls = ((LdapContext)ctx).getResponseControls();
+ javax.naming.ldap.Control[] responseControls = ((LdapContext)ctx).getResponseControls();
PagedResultsResponseControl responseControl =
(PagedResultsResponseControl)responseControls[0];
@@ -1056,7 +1057,7 @@
}
// Now read the next ones
- Control[] responseControls = ((LdapContext)ctx).getResponseControls();
+ javax.naming.ldap.Control[] responseControls = ((LdapContext)ctx).getResponseControls();
PagedResultsResponseControl responseControl =
(PagedResultsResponseControl)responseControls[0];
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java Tue Jan 26 22:55:37 2010
@@ -41,7 +41,6 @@
import javax.naming.event.NamingEvent;
import javax.naming.event.NamingExceptionEvent;
import javax.naming.event.ObjectChangeListener;
-import javax.naming.ldap.Control;
import javax.naming.ldap.HasControls;
import javax.naming.ldap.LdapContext;
@@ -55,8 +54,10 @@
import org.apache.directory.shared.ldap.codec.search.controls.ChangeType;
import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeControlCodec;
import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeControlDecoder;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.message.control.PersistentSearchControl;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -100,7 +101,7 @@
*/
private Attributes getPersonAttributes( String sn, String cn ) throws NamingException
{
- Attributes attributes = AttributeUtils.createAttributes(
+ Attributes attributes = LdifUtils.createAttributes(
"objectClass: top",
"objectClass: person",
"cn", cn,
@@ -570,13 +571,16 @@
{
LOG.debug( "PSearchListener.run() called." );
control.setCritical( true );
+
+ control.setValue( control.getValue() );
+
Control[] ctxCtls = new Control[]
{ control };
try
{
ctx = ( LdapContext ) getWiredContext( ldapServer).lookup( BASE );
- ctx.setRequestControls( ctxCtls );
+ ctx.setRequestControls( JndiUtils.toJndiControls( ctxCtls ) );
isReady = true;
LOG.debug( "PSearchListener is ready and about to issue persistent search request." );
list = ctx.search( "", "objectClass=*", null );
@@ -586,21 +590,22 @@
while ( list.hasMore() )
{
LOG.debug( "PSearchListener search request got an item." );
- Control[] controls = null;
+ javax.naming.ldap.Control[] controls = null;
SearchResult sresult = list.next();
if ( sresult instanceof HasControls )
{
controls = ( ( HasControls ) sresult ).getControls();
+
if ( controls != null )
{
- for ( int ii = 0; ii < controls.length; ii++ )
+ for ( javax.naming.ldap.Control control : controls )
{
- if ( controls[ii].getID().equals(
+ if ( control.getID().equals(
org.apache.directory.shared.ldap.message.control.EntryChangeControl.CONTROL_OID ) )
{
EntryChangeControlDecoder decoder = new EntryChangeControlDecoder();
- ecControl = ( EntryChangeControlCodec ) decoder.decode( controls[ii].getEncodedValue() );
+ ecControl = ( EntryChangeControlCodec ) decoder.decode( control.getEncodedValue() );
}
}
}
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java Tue Jan 26 22:55:37 2010
@@ -39,7 +39,6 @@
import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
-import javax.naming.ldap.Control;
import javax.naming.ldap.LdapContext;
import javax.naming.ldap.ManageReferralControl;
@@ -377,15 +376,14 @@
assertEquals( "ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system??base", referral );
}
- Control manageDsaItControl = new ManageReferralControl();
- ((LdapContext)ctx).setRequestControls( new Control[]{manageDsaItControl} );
+ ((LdapContext)ctx).setRequestControls( new javax.naming.ldap.Control[]{new ManageReferralControl()} );
// Now let's move the entry
ctx.rename( "c=america,ou=Countries,ou=system", "c=USA,ou=Countries,ou=system" );
controls.setSearchScope( SearchControls.OBJECT_SCOPE );
- ((LdapContext)ctx).setRequestControls( new Control[]{} );
+ ((LdapContext)ctx).setRequestControls( new javax.naming.ldap.Control[]{} );
try
{
@@ -428,15 +426,14 @@
assertEquals( "ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system??base", referral );
}
- Control manageDsaItControl = new ManageReferralControl();
- ((LdapContext)ctx).setRequestControls( new Control[]{manageDsaItControl} );
+ ((LdapContext)ctx).setRequestControls( new javax.naming.ldap.Control[]{new ManageReferralControl()} );
// Now let's move the entry
ctx.rename( "c=america,ou=Countries,ou=system", "c=america,ou=system" );
controls.setSearchScope( SearchControls.OBJECT_SCOPE );
- ((LdapContext)ctx).setRequestControls( new Control[]{} );
+ ((LdapContext)ctx).setRequestControls( new javax.naming.ldap.Control[]{} );
try
{
@@ -479,15 +476,14 @@
assertEquals( "ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system??base", referral );
}
- Control manageDsaItControl = new ManageReferralControl();
- ((LdapContext)ctx).setRequestControls( new Control[]{manageDsaItControl} );
+ ((LdapContext)ctx).setRequestControls( new javax.naming.ldap.Control[]{new ManageReferralControl()} );
// Now let's move the entry
ctx.rename( "c=america,ou=Countries,ou=system", "c=us,ou=system" );
controls.setSearchScope( SearchControls.OBJECT_SCOPE );
- ((LdapContext)ctx).setRequestControls( new Control[]{} );
+ ((LdapContext)ctx).setRequestControls( new javax.naming.ldap.Control[]{} );
try
{
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java Tue Jan 26 22:55:37 2010
@@ -43,7 +43,6 @@
import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
-import javax.naming.ldap.Control;
import javax.naming.ldap.LdapContext;
import netscape.ldap.LDAPAttribute;
@@ -62,6 +61,8 @@
import org.apache.directory.server.core.subtree.SubentryInterceptor;
import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.jndi.JndiUtils;
+import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.message.control.SubentriesControl;
import org.junit.Ignore;
import org.junit.Test;
@@ -821,7 +822,7 @@
SearchControls searchControls = new SearchControls();
searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
- ctx.setRequestControls( reqControls );
+ ctx.setRequestControls( JndiUtils.toJndiControls( reqControls ) );
NamingEnumeration<SearchResult> enm = ctx.search( "", "(objectClass=*)", searchControls );
Set<String> results = new HashSet<String>();
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java Tue Jan 26 22:55:37 2010
@@ -43,7 +43,7 @@
import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
import org.apache.directory.server.operations.bind.BogusNtlmProvider;
import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -109,7 +109,7 @@
public void testLdaps() throws Exception
{
// Create a person
- Attributes attributes = AttributeUtils.createAttributes(
+ Attributes attributes = LdifUtils.createAttributes(
"objectClass: top",
"objectClass: person",
"cn: The Person",
Modified: directory/apacheds/trunk/xdbm-base/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/pom.xml?rev=903472&r1=903471&r2=903472&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/pom.xml (original)
+++ directory/apacheds/trunk/xdbm-base/pom.xml Tue Jan 26 22:55:37 2010
@@ -26,6 +26,7 @@
<artifactId>apacheds-parent</artifactId>
<version>1.5.6-SNAPSHOT</version>
</parent>
+
<artifactId>apacheds-xdbm-base</artifactId>
<name>ApacheDS XDBM Base</name>
<packaging>jar</packaging>
@@ -36,9 +37,9 @@
<dependencies>
<dependency>
- <groupId>${pom.groupId}</groupId>
<artifactId>apacheds-core-api</artifactId>
- <version>${pom.version}</version>
+ <groupId>${groupId}</groupId>
+ <version>${version}</version>
</dependency>
</dependencies>
</project>