You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2008/05/10 22:19:41 UTC
svn commit: r655151 [3/3] - in /directory/sandbox/akarasulu/bigbang:
apacheds/btree-base/src/main/java/org/apache/directory/server/xdbm/
apacheds/core-entry/src/main/java/org/apache/directory/server/core/entry/
apacheds/jdbm-store/src/main/java/org/apa...
Modified: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java?rev=655151&r1=655150&r2=655151&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java Sat May 10 13:19:40 2008
@@ -32,10 +32,11 @@
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.filter.ScopeNode;
import org.apache.directory.shared.ldap.message.AliasDerefMode;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
@@ -46,7 +47,6 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertEquals;
-import javax.naming.directory.Attributes;
import javax.naming.directory.SearchControls;
import java.io.File;
import java.util.Set;
@@ -65,7 +65,7 @@
File wkdir;
- Store<Attributes> store;
+ Store<ServerEntry> store;
Registries registries = null;
AttributeTypeRegistry attributeRegistry;
@@ -102,7 +102,7 @@
wkdir.mkdirs();
// initialize the store
- store = new JdbmStore<Attributes>();
+ store = new JdbmStore<ServerEntry>();
store.setName( "example" );
store.setCacheSize( 10 );
store.setWorkingDirectory( wkdir );
@@ -139,7 +139,7 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- OneLevelScopeEvaluator<Attributes> evaluator = new OneLevelScopeEvaluator<Attributes>( store, node );
+ OneLevelScopeEvaluator<ServerEntry> evaluator = new OneLevelScopeEvaluator<ServerEntry>( store, node );
OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
assertTrue( cursor.isElementReused() );
@@ -152,7 +152,7 @@
assertTrue( cursor.next() );
assertTrue( cursor.available() );
- IndexEntry<Long,Attributes> indexEntry = cursor.get();
+ IndexEntry<Long,ServerEntry> indexEntry = cursor.get();
assertNotNull( indexEntry );
assertEquals( 5L, ( long ) indexEntry.getId() );
assertEquals( 2L, ( long ) indexEntry.getValue() );
@@ -286,7 +286,7 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=engineering," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- OneLevelScopeEvaluator<Attributes> evaluator = new OneLevelScopeEvaluator<Attributes>( store, node );
+ OneLevelScopeEvaluator<ServerEntry> evaluator = new OneLevelScopeEvaluator<ServerEntry>( store, node );
OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
assertTrue( cursor.isElementReused() );
@@ -299,7 +299,7 @@
assertTrue( cursor.next() );
assertTrue( cursor.available() );
- IndexEntry<Long,Attributes> indexEntry = cursor.get();
+ IndexEntry<Long,ServerEntry> indexEntry = cursor.get();
assertNotNull( indexEntry );
assertEquals( 8L, ( long ) indexEntry.getId() );
assertEquals( 4L, ( long ) indexEntry.getValue() );
@@ -433,7 +433,7 @@
ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING,
SchemaConstants.OU_AT_OID + "=board of directors," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- OneLevelScopeEvaluator<Attributes> evaluator = new OneLevelScopeEvaluator<Attributes>( store, node );
+ OneLevelScopeEvaluator<ServerEntry> evaluator = new OneLevelScopeEvaluator<ServerEntry>( store, node );
OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
assertTrue( cursor.isElementReused() );
@@ -446,7 +446,7 @@
assertTrue( cursor.next() );
assertTrue( cursor.available() );
- IndexEntry<Long,Attributes> indexEntry = cursor.get();
+ IndexEntry<Long,ServerEntry> indexEntry = cursor.get();
assertNotNull( indexEntry );
assertEquals( 7L, ( long ) indexEntry.getId() );
assertEquals( 3L, ( long ) indexEntry.getValue() );
@@ -559,7 +559,7 @@
SchemaConstants.OU_AT_OID + "=apache," +
SchemaConstants.OU_AT_OID + "=board of directors," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- OneLevelScopeEvaluator<Attributes> evaluator = new OneLevelScopeEvaluator<Attributes>( store, node );
+ OneLevelScopeEvaluator<ServerEntry> evaluator = new OneLevelScopeEvaluator<ServerEntry>( store, node );
OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
assertTrue( cursor.isElementReused() );
@@ -572,7 +572,7 @@
assertTrue( cursor.next() );
assertTrue( cursor.available() );
- IndexEntry<Long,Attributes> indexEntry = cursor.get();
+ IndexEntry<Long,ServerEntry> indexEntry = cursor.get();
assertNotNull( indexEntry );
assertEquals( 6L, ( long ) indexEntry.getId() );
assertEquals( 7L, ( long ) indexEntry.getValue() );
@@ -651,10 +651,10 @@
SchemaConstants.OU_AT_OID + "=board of directors," +
SchemaConstants.O_AT_OID + "=good times co."
);
- AttributesImpl attrs = new AttributesImpl( "objectClass", "alias", true );
- attrs.get( "objectClass" ).add( "extensibleObject" );
- attrs.put( "cn", "jd" );
- attrs.put( "aliasedObjectName", "cn=Jack Daniels,ou=Engineering,o=Good Times Co." );
+ ServerEntry attrs = new DefaultServerEntry( registries, dn );
+ attrs.add( "objectClass", "alias", "extensibleObject" );
+ attrs.add( "cn", "jd" );
+ attrs.add( "aliasedObjectName", "cn=Jack Daniels,ou=Engineering,o=Good Times Co." );
store.add( dn, attrs );
dn = new LdapDN(
@@ -662,15 +662,16 @@
SchemaConstants.OU_AT_OID + "=board of directors," +
SchemaConstants.O_AT_OID + "=good times co."
);
- attrs = new AttributesImpl( "objectClass", "person", true );
- attrs.put( "cn", "jdoe" );
- attrs.put( "sn", "doe" );
+ attrs = new DefaultServerEntry( registries, dn );
+ attrs.add( "objectClass", "person" );
+ attrs.add( "cn", "jdoe" );
+ attrs.add( "sn", "doe" );
store.add( dn, attrs );
ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING,
SchemaConstants.OU_AT_OID + "=board of directors," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- OneLevelScopeEvaluator<Attributes> evaluator = new OneLevelScopeEvaluator<Attributes>( store, node );
+ OneLevelScopeEvaluator<ServerEntry> evaluator = new OneLevelScopeEvaluator<ServerEntry>( store, node );
OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
assertTrue( cursor.isElementReused() );
@@ -683,7 +684,7 @@
assertTrue( cursor.next() );
assertTrue( cursor.available() );
- IndexEntry<Long,Attributes> indexEntry = cursor.get();
+ IndexEntry<Long,ServerEntry> indexEntry = cursor.get();
assertNotNull( indexEntry );
assertEquals( 7L, ( long ) indexEntry.getId() );
assertEquals( 3L, ( long ) indexEntry.getValue() );
@@ -901,9 +902,9 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- OneLevelScopeEvaluator<Attributes> evaluator = new OneLevelScopeEvaluator<Attributes>( store, node );
+ OneLevelScopeEvaluator<ServerEntry> evaluator = new OneLevelScopeEvaluator<ServerEntry>( store, node );
- ForwardIndexEntry<Long,Attributes> indexEntry = new ForwardIndexEntry<Long,Attributes>();
+ ForwardIndexEntry<Long,ServerEntry> indexEntry = new ForwardIndexEntry<Long,ServerEntry>();
indexEntry.setId( 6L );
assertTrue( evaluator.evaluate( indexEntry ) );
}
@@ -915,7 +916,7 @@
ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_ALWAYS,
SchemaConstants.OU_AT_OID + "=engineering," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- OneLevelScopeEvaluator<Attributes> evaluator = new OneLevelScopeEvaluator<Attributes>( store, node );
+ OneLevelScopeEvaluator<ServerEntry> evaluator = new OneLevelScopeEvaluator<ServerEntry>( store, node );
assertEquals( node, evaluator.getExpression() );
/*
@@ -923,19 +924,19 @@
* will not accept an alias candidate because aliases are not returned
* when alias dereferencing while searching is enabled.
*/
- ForwardIndexEntry<Long,Attributes> indexEntry = new ForwardIndexEntry<Long,Attributes>();
+ ForwardIndexEntry<Long,ServerEntry> indexEntry = new ForwardIndexEntry<Long,ServerEntry>();
indexEntry.setId( 11L );
assertFalse( evaluator.evaluate( indexEntry ) );
- indexEntry = new ForwardIndexEntry<Long,Attributes>();
+ indexEntry = new ForwardIndexEntry<Long,ServerEntry>();
indexEntry.setId( 8L );
assertTrue( evaluator.evaluate( indexEntry ) );
- indexEntry = new ForwardIndexEntry<Long,Attributes>();
+ indexEntry = new ForwardIndexEntry<Long,ServerEntry>();
indexEntry.setId( 5L );
assertTrue( evaluator.evaluate( indexEntry ) );
- indexEntry = new ForwardIndexEntry<Long,Attributes>();
+ indexEntry = new ForwardIndexEntry<Long,ServerEntry>();
indexEntry.setId( 6L );
assertFalse( evaluator.evaluate( indexEntry ) );
}
@@ -947,7 +948,7 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- OneLevelScopeEvaluator<Attributes> evaluator = new OneLevelScopeEvaluator<Attributes>( store, node );
+ OneLevelScopeEvaluator<ServerEntry> evaluator = new OneLevelScopeEvaluator<ServerEntry>( store, node );
OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
cursor.get();
}
@@ -959,11 +960,11 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- OneLevelScopeEvaluator<Attributes> evaluator = new OneLevelScopeEvaluator<Attributes>( store, node );
+ OneLevelScopeEvaluator<ServerEntry> evaluator = new OneLevelScopeEvaluator<ServerEntry>( store, node );
OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
// test before()
- ForwardIndexEntry<Long,Attributes> entry = new ForwardIndexEntry<Long,Attributes>();
+ ForwardIndexEntry<Long,ServerEntry> entry = new ForwardIndexEntry<Long,ServerEntry>();
entry.setValue( 3L );
cursor.before( entry );
}
@@ -975,11 +976,11 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- OneLevelScopeEvaluator<Attributes> evaluator = new OneLevelScopeEvaluator<Attributes>( store, node );
+ OneLevelScopeEvaluator<ServerEntry> evaluator = new OneLevelScopeEvaluator<ServerEntry>( store, node );
OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
// test after()
- ForwardIndexEntry<Long,Attributes> entry = new ForwardIndexEntry<Long,Attributes>();
+ ForwardIndexEntry<Long,ServerEntry> entry = new ForwardIndexEntry<Long,ServerEntry>();
entry.setValue( 3L );
cursor.after( entry );
}
@@ -991,6 +992,6 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.SUBTREE_SCOPE );
- new OneLevelScopeEvaluator<Attributes>( store, node );
+ new OneLevelScopeEvaluator<ServerEntry>( store, node );
}
}
\ No newline at end of file
Modified: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java?rev=655151&r1=655150&r2=655151&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java Sat May 10 13:19:40 2008
@@ -27,13 +27,12 @@
import java.util.List;
import java.util.Set;
-import javax.naming.directory.Attributes;
-
import org.apache.commons.io.FileUtils;
import org.apache.directory.server.core.cursor.Cursor;
import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore;
+import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.schema.SerializableComparator;
import org.apache.directory.server.schema.bootstrap.ApacheSchema;
import org.apache.directory.server.schema.bootstrap.ApachemetaSchema;
@@ -57,9 +56,11 @@
import org.apache.directory.shared.ldap.filter.OrNode;
import org.apache.directory.shared.ldap.filter.SubstringNode;
import org.junit.*;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
/**
*
* Test class for OrCursor.
@@ -76,7 +77,7 @@
private static final Logger LOG = LoggerFactory.getLogger( OrCursorTest.class.getSimpleName() );
File wkdir;
- Store<Attributes> store;
+ Store<ServerEntry> store;
Registries registries = null;
AttributeTypeRegistry attributeRegistry;
EvaluatorBuilder evaluatorBuilder;
@@ -114,7 +115,7 @@
wkdir.mkdirs();
// initialize the store
- store = new JdbmStore<Attributes>();
+ store = new JdbmStore<ServerEntry>();
store.setName( "example" );
store.setCacheSize( 10 );
store.setWorkingDirectory( wkdir );
@@ -157,7 +158,7 @@
ExprNode exprNode = FilterParser.parse( filter );
- Cursor<IndexEntry<?,Attributes>> cursor = ( Cursor<IndexEntry<?,Attributes>> ) cursorBuilder.build( exprNode );
+ Cursor<IndexEntry<?,ServerEntry>> cursor = cursorBuilder.build( exprNode );
cursor.afterLast();
@@ -238,10 +239,10 @@
@SuppressWarnings( "unchecked" )
public void testOrCursor() throws Exception
{
- List<Evaluator<? extends ExprNode,Attributes>> evaluators = new ArrayList<Evaluator<? extends ExprNode,Attributes>>();
- List<Cursor<IndexEntry<?,Attributes>>> cursors = new ArrayList<Cursor<IndexEntry<?,Attributes>>>();
- Evaluator<? extends ExprNode, Attributes> eval;
- Cursor<IndexEntry<?,Attributes>> cursor;
+ List<Evaluator<? extends ExprNode,ServerEntry>> evaluators = new ArrayList<Evaluator<? extends ExprNode,ServerEntry>>();
+ List<Cursor<IndexEntry<?,ServerEntry>>> cursors = new ArrayList<Cursor<IndexEntry<?,ServerEntry>>>();
+ Evaluator<? extends ExprNode, ServerEntry> eval;
+ Cursor<IndexEntry<?,ServerEntry>> cursor;
OrNode orNode = new OrNode();
@@ -254,8 +255,8 @@
try
{
- cursor = ( Cursor<IndexEntry<?,Attributes>> ) new OrCursor( cursors, evaluators );
- fail("should throw IllegalArgumentException");
+ new OrCursor( cursors, evaluators );
+ fail( "should throw IllegalArgumentException" );
}
catch( IllegalArgumentException ie ){ }
@@ -267,7 +268,7 @@
orNode.addNode( exprNode );
- cursor = ( Cursor<IndexEntry<?,Attributes>> ) new OrCursor( cursors, evaluators );
+ cursor = new OrCursor( cursors, evaluators );
cursor.beforeFirst();
assertFalse( cursor.available() );
Modified: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java?rev=655151&r1=655150&r2=655151&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java Sat May 10 13:19:40 2008
@@ -31,6 +31,7 @@
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore;
import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
+import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.filter.PresenceNode;
import org.apache.commons.io.FileUtils;
@@ -39,7 +40,6 @@
import org.junit.Test;
import static org.junit.Assert.*;
-import javax.naming.directory.Attributes;
import java.io.File;
import java.util.Set;
import java.util.HashSet;
@@ -56,7 +56,7 @@
private static final Logger LOG = LoggerFactory.getLogger( PresenceTest.class.getSimpleName() );
File wkdir;
- Store<Attributes> store;
+ Store<ServerEntry> store;
Registries registries = null;
AttributeTypeRegistry attributeRegistry;
@@ -93,7 +93,7 @@
wkdir.mkdirs();
// initialize the store
- store = new JdbmStore<Attributes>();
+ store = new JdbmStore<ServerEntry>();
store.setName( "example" );
store.setCacheSize( 10 );
store.setWorkingDirectory( wkdir );
@@ -125,7 +125,7 @@
@Test
- public void testIndexedAttributes() throws Exception
+ public void testIndexedServerEntry() throws Exception
{
PresenceNode node = new PresenceNode( SchemaConstants.CN_AT_OID );
PresenceEvaluator evaluator = new PresenceEvaluator( node, store, registries );
@@ -181,7 +181,7 @@
assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getValue() );
// test before()
- ForwardIndexEntry<String,Attributes> entry = new ForwardIndexEntry<String,Attributes>();
+ ForwardIndexEntry<String,ServerEntry> entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.CN_AT_OID );
cursor.before( entry );
assertTrue( cursor.next() );
@@ -189,7 +189,7 @@
assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getValue() );
// test after()
- entry = new ForwardIndexEntry<String,Attributes>();
+ entry = new ForwardIndexEntry<String,ServerEntry>();
cursor.after( entry );
assertTrue( cursor.previous() );
assertTrue( cursor.available() );
@@ -239,7 +239,7 @@
@Test
- public void testNonIndexedAttributes() throws Exception
+ public void testNonIndexedServerEntry() throws Exception
{
PresenceNode node = new PresenceNode( SchemaConstants.SN_AT_OID );
PresenceEvaluator evaluator = new PresenceEvaluator( node, store, registries );
@@ -326,11 +326,11 @@
{
PresenceNode node = new PresenceNode( SchemaConstants.CN_AT_OID );
PresenceEvaluator evaluator = new PresenceEvaluator( node, store, registries );
- ForwardIndexEntry<String,Attributes> entry = new ForwardIndexEntry<String,Attributes>();
+ ForwardIndexEntry<String,ServerEntry> entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.CN_AT_OID );
entry.setId( ( long ) 3 );
assertFalse( evaluator.evaluate( entry ) );
- entry = new ForwardIndexEntry<String,Attributes>();
+ entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.CN_AT_OID );
entry.setId( ( long ) 5 );
assertTrue( evaluator.evaluate( entry ) );
@@ -342,22 +342,22 @@
{
PresenceNode node = new PresenceNode( SchemaConstants.NAME_AT_OID );
PresenceEvaluator evaluator = new PresenceEvaluator( node, store, registries );
- ForwardIndexEntry<String,Attributes> entry = new ForwardIndexEntry<String,Attributes>();
+ ForwardIndexEntry<String,ServerEntry> entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.NAME_AT_OID );
entry.setId( ( long ) 3 );
assertTrue( evaluator.evaluate( entry ) );
- entry = new ForwardIndexEntry<String,Attributes>();
+ entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.NAME_AT_OID );
entry.setId( ( long ) 5 );
assertTrue( evaluator.evaluate( entry ) );
node = new PresenceNode( SchemaConstants.SEARCHGUIDE_AT_OID );
evaluator = new PresenceEvaluator( node, store, registries );
- entry = new ForwardIndexEntry<String,Attributes>();
+ entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.SEARCHGUIDE_AT_OID );
entry.setId( ( long ) 3 );
assertFalse( evaluator.evaluate( entry ) );
- entry = new ForwardIndexEntry<String,Attributes>();
+ entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.SEARCHGUIDE_AT_OID );
entry.setId( ( long ) 5 );
entry.setObject( store.lookup( ( long ) 5 ));
@@ -365,11 +365,11 @@
node = new PresenceNode( SchemaConstants.ST_AT_OID );
evaluator = new PresenceEvaluator( node, store, registries );
- entry = new ForwardIndexEntry<String,Attributes>();
+ entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.ST_AT_OID );
entry.setId( ( long ) 3 );
assertFalse( evaluator.evaluate( entry ) );
- entry = new ForwardIndexEntry<String,Attributes>();
+ entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.ST_AT_OID );
entry.setId( ( long ) 5 );
entry.setObject( store.lookup( ( long ) 5 ));
@@ -405,7 +405,7 @@
PresenceCursor cursor = new PresenceCursor( store, evaluator );
// test before()
- ForwardIndexEntry<String,Attributes> entry = new ForwardIndexEntry<String,Attributes>();
+ ForwardIndexEntry<String,ServerEntry> entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.SN_AT_OID );
cursor.before( entry );
}
@@ -419,7 +419,7 @@
PresenceCursor cursor = new PresenceCursor( store, evaluator );
// test before()
- ForwardIndexEntry<String,Attributes> entry = new ForwardIndexEntry<String,Attributes>();
+ ForwardIndexEntry<String,ServerEntry> entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.SN_AT_OID );
cursor.after( entry );
}
Modified: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java?rev=655151&r1=655150&r2=655151&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java Sat May 10 13:19:40 2008
@@ -31,6 +31,7 @@
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
+import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.filter.SubstringNode;
import org.apache.commons.io.FileUtils;
@@ -41,7 +42,6 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
-import javax.naming.directory.Attributes;
import java.io.File;
import java.util.Set;
import java.util.HashSet;
@@ -58,7 +58,7 @@
private static final Logger LOG = LoggerFactory.getLogger( SubstringTest.class.getSimpleName() );
File wkdir;
- Store<Attributes> store;
+ Store<ServerEntry> store;
Registries registries = null;
AttributeTypeRegistry attributeRegistry;
@@ -95,7 +95,7 @@
wkdir.mkdirs();
// initialize the store
- store = new JdbmStore<Attributes>();
+ store = new JdbmStore<ServerEntry>();
store.setName( "example" );
store.setCacheSize( 10 );
store.setWorkingDirectory( wkdir );
@@ -595,7 +595,7 @@
{
SubstringNode node = new SubstringNode( SchemaConstants.SN_AT_OID, "walk", null );
SubstringEvaluator evaluator = new SubstringEvaluator( node, store, registries );
- ForwardIndexEntry<String,Attributes> indexEntry = new ForwardIndexEntry<String,Attributes>();
+ ForwardIndexEntry<String,ServerEntry> indexEntry = new ForwardIndexEntry<String,ServerEntry>();
indexEntry.setId( 5L );
assertTrue( evaluator.evaluate( indexEntry ) );
indexEntry.setId( 3L );
@@ -607,35 +607,35 @@
node = new SubstringNode( SchemaConstants.SN_AT_OID, "wa", null );
evaluator = new SubstringEvaluator( node, store, registries );
- indexEntry = new ForwardIndexEntry<String,Attributes>();
+ indexEntry = new ForwardIndexEntry<String,ServerEntry>();
indexEntry.setId( 5L );
indexEntry.setObject( store.lookup( 5L ) );
assertTrue( evaluator.evaluate( indexEntry ) );
node = new SubstringNode( SchemaConstants.SEARCHGUIDE_AT_OID, "j", null );
evaluator = new SubstringEvaluator( node, store, registries );
- indexEntry = new ForwardIndexEntry<String,Attributes>();
+ indexEntry = new ForwardIndexEntry<String,ServerEntry>();
indexEntry.setId( 6L );
indexEntry.setObject( store.lookup( 6L ) );
assertFalse( evaluator.evaluate( indexEntry ) );
node = new SubstringNode( SchemaConstants.ST_AT_OID, "j", null );
evaluator = new SubstringEvaluator( node, store, registries );
- indexEntry = new ForwardIndexEntry<String,Attributes>();
+ indexEntry = new ForwardIndexEntry<String,ServerEntry>();
indexEntry.setId( 6L );
indexEntry.setObject( store.lookup( 6L ) );
assertFalse( evaluator.evaluate( indexEntry ) );
node = new SubstringNode( SchemaConstants.NAME_AT_OID, "j", null );
evaluator = new SubstringEvaluator( node, store, registries );
- indexEntry = new ForwardIndexEntry<String,Attributes>();
+ indexEntry = new ForwardIndexEntry<String,ServerEntry>();
indexEntry.setId( 6L );
indexEntry.setObject( store.lookup( 6L ) );
assertTrue( evaluator.evaluate( indexEntry ) );
node = new SubstringNode( SchemaConstants.NAME_AT_OID, "s", null );
evaluator = new SubstringEvaluator( node, store, registries );
- indexEntry = new ForwardIndexEntry<String,Attributes>();
+ indexEntry = new ForwardIndexEntry<String,ServerEntry>();
indexEntry.setId( 6L );
indexEntry.setObject( store.lookup( 6L ) );
assertTrue( evaluator.evaluate( indexEntry ) );
@@ -647,7 +647,7 @@
{
SubstringNode node = new SubstringNode( SchemaConstants.CN_AT_OID, "jim", null );
SubstringEvaluator evaluator = new SubstringEvaluator( node, store, registries );
- ForwardIndexEntry<String,Attributes> indexEntry = new ForwardIndexEntry<String,Attributes>();
+ ForwardIndexEntry<String,ServerEntry> indexEntry = new ForwardIndexEntry<String,ServerEntry>();
indexEntry.setId( 6L );
assertTrue( evaluator.evaluate( indexEntry ) );
indexEntry.setId( 3L );
@@ -656,14 +656,14 @@
node = new SubstringNode( SchemaConstants.CN_AT_OID, "j", null );
evaluator = new SubstringEvaluator( node, store, registries );
- indexEntry = new ForwardIndexEntry<String,Attributes>();
+ indexEntry = new ForwardIndexEntry<String,ServerEntry>();
indexEntry.setId( 6L );
indexEntry.setObject( store.lookup( 6L ) );
assertTrue( evaluator.evaluate( indexEntry ) );
node = new SubstringNode( SchemaConstants.CN_AT_OID, "s", null );
evaluator = new SubstringEvaluator( node, store, registries );
- indexEntry = new ForwardIndexEntry<String,Attributes>();
+ indexEntry = new ForwardIndexEntry<String,ServerEntry>();
indexEntry.setId( 6L );
indexEntry.setObject( store.lookup( 6L ) );
assertFalse( evaluator.evaluate( indexEntry ) );
@@ -704,7 +704,7 @@
SubstringCursor cursor = new SubstringCursor( store, evaluator );
// test before()
- ForwardIndexEntry<String,Attributes> entry = new ForwardIndexEntry<String,Attributes>();
+ ForwardIndexEntry<String,ServerEntry> entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.SN_AT_OID );
cursor.before( entry );
}
@@ -718,7 +718,7 @@
SubstringCursor cursor = new SubstringCursor( store, evaluator );
// test before()
- ForwardIndexEntry<String,Attributes> entry = new ForwardIndexEntry<String,Attributes>();
+ ForwardIndexEntry<String,ServerEntry> entry = new ForwardIndexEntry<String,ServerEntry>();
entry.setValue( SchemaConstants.SN_AT_OID );
cursor.after( entry );
}
Modified: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java?rev=655151&r1=655150&r2=655151&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java Sat May 10 13:19:40 2008
@@ -32,10 +32,11 @@
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.filter.ScopeNode;
import org.apache.directory.shared.ldap.message.AliasDerefMode;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
@@ -47,7 +48,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import javax.naming.directory.Attributes;
import javax.naming.directory.SearchControls;
import java.io.File;
import java.util.Set;
@@ -66,7 +66,7 @@
File wkdir;
- Store<Attributes> store;
+ Store<ServerEntry> store;
Registries registries = null;
AttributeTypeRegistry attributeRegistry;
@@ -103,7 +103,7 @@
wkdir.mkdirs();
// initialize the store
- store = new JdbmStore<Attributes>();
+ store = new JdbmStore<ServerEntry>();
store.setName( "example" );
store.setCacheSize( 10 );
store.setWorkingDirectory( wkdir );
@@ -140,7 +140,7 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.SUBTREE_SCOPE );
- SubtreeScopeEvaluator<Attributes> evaluator = new SubtreeScopeEvaluator<Attributes>( store, node );
+ SubtreeScopeEvaluator<ServerEntry> evaluator = new SubtreeScopeEvaluator<ServerEntry>( store, node );
SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
assertTrue( cursor.isElementReused() );
@@ -153,7 +153,7 @@
assertTrue( cursor.next() );
assertTrue( cursor.available() );
- IndexEntry<Long,Attributes> indexEntry = cursor.get();
+ IndexEntry<Long,ServerEntry> indexEntry = cursor.get();
assertNotNull( indexEntry );
assertEquals( 5L, ( long ) indexEntry.getId() );
assertEquals( 2L, ( long ) indexEntry.getValue() );
@@ -265,7 +265,7 @@
ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING,
SchemaConstants.OU_AT_OID + "=board of directors," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.SUBTREE_SCOPE );
- SubtreeScopeEvaluator<Attributes> evaluator = new SubtreeScopeEvaluator<Attributes>( store, node );
+ SubtreeScopeEvaluator<ServerEntry> evaluator = new SubtreeScopeEvaluator<ServerEntry>( store, node );
SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
assertTrue( cursor.isElementReused() );
@@ -278,7 +278,7 @@
assertTrue( cursor.next() );
assertTrue( cursor.available() );
- IndexEntry<Long,Attributes> indexEntry = cursor.get();
+ IndexEntry<Long,ServerEntry> indexEntry = cursor.get();
assertNotNull( indexEntry );
assertEquals( 7L, ( long ) indexEntry.getId() );
assertEquals( 3L, ( long ) indexEntry.getValue() );
@@ -415,7 +415,7 @@
SchemaConstants.OU_AT_OID + "=apache," +
SchemaConstants.OU_AT_OID + "=board of directors," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.SUBTREE_SCOPE );
- SubtreeScopeEvaluator<Attributes> evaluator = new SubtreeScopeEvaluator<Attributes>( store, node );
+ SubtreeScopeEvaluator<ServerEntry> evaluator = new SubtreeScopeEvaluator<ServerEntry>( store, node );
SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
assertTrue( cursor.isElementReused() );
@@ -428,7 +428,7 @@
assertTrue( cursor.next() );
assertTrue( cursor.available() );
- IndexEntry<Long,Attributes> indexEntry = cursor.get();
+ IndexEntry<Long,ServerEntry> indexEntry = cursor.get();
assertNotNull( indexEntry );
assertEquals( 6L, ( long ) indexEntry.getId() );
assertEquals( 7L, ( long ) indexEntry.getValue() );
@@ -507,10 +507,10 @@
SchemaConstants.OU_AT_OID + "=board of directors," +
SchemaConstants.O_AT_OID + "=good times co."
);
- AttributesImpl attrs = new AttributesImpl( "objectClass", "alias", true );
- attrs.get( "objectClass" ).add( "extensibleObject" );
- attrs.put( "cn", "jd" );
- attrs.put( "aliasedObjectName", "cn=Jack Daniels,ou=Engineering,o=Good Times Co." );
+ ServerEntry attrs = new DefaultServerEntry( registries, dn );
+ attrs.add( "objectClass", "alias", "extensibleObject" );
+ attrs.add( "cn", "jd" );
+ attrs.add( "aliasedObjectName", "cn=Jack Daniels,ou=Engineering,o=Good Times Co." );
store.add( dn, attrs );
dn = new LdapDN(
@@ -518,15 +518,16 @@
SchemaConstants.OU_AT_OID + "=board of directors," +
SchemaConstants.O_AT_OID + "=good times co."
);
- attrs = new AttributesImpl( "objectClass", "person", true );
- attrs.put( "cn", "jdoe" );
- attrs.put( "sn", "doe" );
+ attrs = new DefaultServerEntry( registries, dn );
+ attrs.add( "objectClass", "person" );
+ attrs.add( "cn", "jdoe" );
+ attrs.add( "sn", "doe" );
store.add( dn, attrs );
ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING,
SchemaConstants.OU_AT_OID + "=board of directors," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.SUBTREE_SCOPE );
- SubtreeScopeEvaluator<Attributes> evaluator = new SubtreeScopeEvaluator<Attributes>( store, node );
+ SubtreeScopeEvaluator<ServerEntry> evaluator = new SubtreeScopeEvaluator<ServerEntry>( store, node );
SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
assertTrue( cursor.isElementReused() );
@@ -539,7 +540,7 @@
assertTrue( cursor.next() );
assertTrue( cursor.available() );
- IndexEntry<Long,Attributes> indexEntry = cursor.get();
+ IndexEntry<Long,ServerEntry> indexEntry = cursor.get();
assertNotNull( indexEntry );
assertEquals( 7L, ( long ) indexEntry.getId() );
assertEquals( 3L, ( long ) indexEntry.getValue() );
@@ -751,9 +752,9 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.SUBTREE_SCOPE );
- SubtreeScopeEvaluator<Attributes> evaluator = new SubtreeScopeEvaluator<Attributes>( store, node );
+ SubtreeScopeEvaluator<ServerEntry> evaluator = new SubtreeScopeEvaluator<ServerEntry>( store, node );
- ForwardIndexEntry<Long,Attributes> indexEntry = new ForwardIndexEntry<Long,Attributes>();
+ ForwardIndexEntry<Long,ServerEntry> indexEntry = new ForwardIndexEntry<Long,ServerEntry>();
indexEntry.setId( 6L );
assertTrue( evaluator.evaluate( indexEntry ) );
}
@@ -765,22 +766,22 @@
ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_ALWAYS,
SchemaConstants.OU_AT_OID + "=engineering," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.SUBTREE_SCOPE );
- SubtreeScopeEvaluator<Attributes> evaluator = new SubtreeScopeEvaluator<Attributes>( store, node );
+ SubtreeScopeEvaluator<ServerEntry> evaluator = new SubtreeScopeEvaluator<ServerEntry>( store, node );
assertEquals( node, evaluator.getExpression() );
/*
* With dereferencing the evaluator does not accept candidates that
* are aliases. This is done to filter out aliases from the results.
*/
- ForwardIndexEntry<Long,Attributes> indexEntry = new ForwardIndexEntry<Long,Attributes>();
+ ForwardIndexEntry<Long,ServerEntry> indexEntry = new ForwardIndexEntry<Long,ServerEntry>();
indexEntry.setId( 11L );
assertFalse( evaluator.evaluate( indexEntry ) );
- indexEntry = new ForwardIndexEntry<Long,Attributes>();
+ indexEntry = new ForwardIndexEntry<Long,ServerEntry>();
indexEntry.setId( 8L );
assertTrue( evaluator.evaluate( indexEntry ) );
- indexEntry = new ForwardIndexEntry<Long,Attributes>();
+ indexEntry = new ForwardIndexEntry<Long,ServerEntry>();
indexEntry.setId( 6L );
assertFalse( evaluator.evaluate( indexEntry ) );
}
@@ -792,7 +793,7 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.SUBTREE_SCOPE );
- SubtreeScopeEvaluator<Attributes> evaluator = new SubtreeScopeEvaluator<Attributes>( store, node );
+ SubtreeScopeEvaluator<ServerEntry> evaluator = new SubtreeScopeEvaluator<ServerEntry>( store, node );
SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
cursor.get();
}
@@ -804,11 +805,11 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.SUBTREE_SCOPE );
- SubtreeScopeEvaluator<Attributes> evaluator = new SubtreeScopeEvaluator<Attributes>( store, node );
+ SubtreeScopeEvaluator<ServerEntry> evaluator = new SubtreeScopeEvaluator<ServerEntry>( store, node );
SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
// test before()
- ForwardIndexEntry<Long,Attributes> entry = new ForwardIndexEntry<Long,Attributes>();
+ ForwardIndexEntry<Long,ServerEntry> entry = new ForwardIndexEntry<Long,ServerEntry>();
entry.setValue( 3L );
cursor.before( entry );
}
@@ -820,11 +821,11 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.SUBTREE_SCOPE );
- SubtreeScopeEvaluator<Attributes> evaluator = new SubtreeScopeEvaluator<Attributes>( store, node );
+ SubtreeScopeEvaluator<ServerEntry> evaluator = new SubtreeScopeEvaluator<ServerEntry>( store, node );
SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
// test after()
- ForwardIndexEntry<Long,Attributes> entry = new ForwardIndexEntry<Long,Attributes>();
+ ForwardIndexEntry<Long,ServerEntry> entry = new ForwardIndexEntry<Long,ServerEntry>();
entry.setValue( 3L );
cursor.after( entry );
}
@@ -836,7 +837,7 @@
ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES,
SchemaConstants.OU_AT_OID + "=sales," +
SchemaConstants.O_AT_OID + "=good times co.", SearchControls.ONELEVEL_SCOPE );
- SubtreeScopeEvaluator<Attributes> evaluator = new SubtreeScopeEvaluator<Attributes>( store, node );
+ SubtreeScopeEvaluator<ServerEntry> evaluator = new SubtreeScopeEvaluator<ServerEntry>( store, node );
assertNull( evaluator );
}
}
Modified: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java?rev=655151&r1=655150&r2=655151&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java Sat May 10 13:19:40 2008
@@ -27,7 +27,6 @@
import org.apache.directory.server.core.cursor.Cursor;
import org.apache.directory.server.core.entry.DefaultServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
@@ -72,8 +71,8 @@
store.setContextEntry( contextEntry );
AttributeTypeRegistry attributeRegistry = registries.getAttributeTypeRegistry();
-
- store.init( registries.getOidRegistry(), attributeRegistry );
+
+ store.init( registries );
// Entry #2
LdapDN dn = new LdapDN( "ou=Sales,o=Good Times Co." );
@@ -83,7 +82,7 @@
entry.add( "ou", "Sales" );
entry.add( "postalCode", "1" );
entry.add( "postOfficeBox", "1" );
- store.add( dn, ServerEntryUtils.toAttributesImpl( entry ) );
+ store.add( dn, entry );
// Entry #3
dn = new LdapDN( "ou=Board of Directors,o=Good Times Co." );
@@ -93,7 +92,7 @@
entry.add( "ou", "Board of Directors" );
entry.add( "postalCode", "1" );
entry.add( "postOfficeBox", "1" );
- store.add( dn, ServerEntryUtils.toAttributesImpl( entry ) );
+ store.add( dn, entry );
// Entry #4
dn = new LdapDN( "ou=Engineering,o=Good Times Co." );
@@ -103,7 +102,7 @@
entry.add( "ou", "Engineering" );
entry.add( "postalCode", "2" );
entry.add( "postOfficeBox", "2" );
- store.add( dn, ServerEntryUtils.toAttributesImpl( entry ) );
+ store.add( dn, entry );
// Entry #5
dn = new LdapDN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
@@ -115,7 +114,7 @@
entry.add( "sn", "WAlkeR");
entry.add( "postalCode", "3" );
entry.add( "postOfficeBox", "3" );
- store.add( dn, ServerEntryUtils.toAttributesImpl( entry ) );
+ store.add( dn, entry );
// Entry #6
dn = new LdapDN( "cn=JIM BEAN,ou=Sales,o=Good Times Co." );
@@ -127,7 +126,7 @@
entry.add( "surName", "BEAN");
entry.add( "postalCode", "4" );
entry.add( "postOfficeBox", "4" );
- store.add( dn, ServerEntryUtils.toAttributesImpl( entry ) );
+ store.add( dn, entry );
// Entry #7
dn = new LdapDN( "ou=Apache,ou=Board of Directors,o=Good Times Co." );
@@ -137,7 +136,7 @@
entry.add( "ou", "Apache" );
entry.add( "postalCode", "5" );
entry.add( "postOfficeBox", "5" );
- store.add( dn, ServerEntryUtils.toAttributesImpl( entry ) );
+ store.add( dn, entry );
// Entry #8
dn = new LdapDN( "cn=Jack Daniels,ou=Engineering,o=Good Times Co." );
@@ -149,7 +148,7 @@
entry.add( "SN", "Daniels");
entry.add( "postalCode", "6" );
entry.add( "postOfficeBox", "6" );
- store.add( dn, ServerEntryUtils.toAttributesImpl( entry ) );
+ store.add( dn, entry );
// aliases -------------
@@ -161,7 +160,7 @@
entry.add( "ou", "Apache" );
entry.add( "commonName", "Jim Bean");
entry.add( "aliasedObjectName", "cn=Jim Bean,ou=Sales,o=Good Times Co." );
- store.add( dn, ServerEntryUtils.toAttributesImpl( entry ) );
+ store.add( dn, entry );
// Entry #10
dn = new LdapDN( "commonName=Jim Bean,ou=Board of Directors,o=Good Times Co." );
@@ -170,7 +169,7 @@
entry.add( "objectClass", "top", "alias", "extensibleObject" );
entry.add( "commonName", "Jim Bean");
entry.add( "aliasedObjectName", "cn=Jim Bean,ou=Sales,o=Good Times Co." );
- store.add( dn, ServerEntryUtils.toAttributesImpl( entry ) );
+ store.add( dn, entry );
// Entry #11
dn = new LdapDN( "2.5.4.3=Johnny Walker,ou=Engineering,o=Good Times Co." );
@@ -180,7 +179,7 @@
entry.add( "ou", "Engineering" );
entry.add( "2.5.4.3", "Johnny Walker");
entry.add( "aliasedObjectName", "cn=Johnny Walker,ou=Sales,o=Good Times Co." );
- store.add( dn, ServerEntryUtils.toAttributesImpl( entry ) );
+ store.add( dn, entry );
}
Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LessEqNode.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LessEqNode.java?rev=655151&r1=655150&r2=655151&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LessEqNode.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LessEqNode.java Sat May 10 13:19:40 2008
@@ -33,7 +33,7 @@
{
/**
* Creates a new LessEqNode object.
- *
+ *
* @param attribute the attribute name
* @param value the value to test for
*/
Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java?rev=655151&r1=655150&r2=655151&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java Sat May 10 13:19:40 2008
@@ -171,7 +171,7 @@
* @throws NamingException
* if there is a failure to resolve the superior
*/
- AttributeType getSuperior() throws NamingException;
+ AttributeType getSuperior() throws NamingException, NamingException;
/**