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/04/22 00:42:42 UTC
svn commit: r936554 [3/4] - in /directory:
apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/
apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/
apacheds/trunk/core-api/src/main/java/o...
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Wed Apr 21 22:42:40 2010
@@ -46,7 +46,6 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.interceptor.context.SearchingOperationContext;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Modification;
@@ -54,6 +53,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.entry.ServerEntry;
import org.apache.directory.shared.ldap.entry.ServerModification;
import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.name.AVA;
@@ -271,7 +271,7 @@ public class OperationalAttributeInterce
}
// Inject the ModifiersName AT if it's not present
- EntryAttribute attribute = new DefaultServerAttribute(
+ EntryAttribute attribute = new DefaultClientAttribute(
MODIFIERS_NAME_ATTRIBUTE_TYPE,
getPrincipal().getName());
@@ -280,7 +280,7 @@ public class OperationalAttributeInterce
mods.add( modifiersName );
// Inject the ModifyTimestamp AT if it's not present
- attribute = new DefaultServerAttribute(
+ attribute = new DefaultClientAttribute(
MODIFY_TIMESTAMP_ATTRIBUTE_TYPE,
DateUtils.getGeneralizedTime() );
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Wed Apr 21 22:42:40 2010
@@ -81,11 +81,11 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.cursor.EmptyCursor;
import org.apache.directory.shared.ldap.cursor.SingletonCursor;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.ServerEntry;
import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeTypeException;
import org.apache.directory.shared.ldap.exception.LdapNoSuchObjectException;
import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
@@ -347,7 +347,7 @@ public class DefaultPartitionNexus exte
if ( namingContexts == null )
{
- namingContexts = new DefaultServerAttribute(
+ namingContexts = new DefaultClientAttribute(
schemaManager.lookupAttributeTypeRegistry( SchemaConstants.NAMING_CONTEXTS_AT ),
system.getSuffixDn().getName() );
rootDSE.put( namingContexts );
@@ -932,7 +932,7 @@ public class DefaultPartitionNexus exte
if ( namingContexts == null )
{
- namingContexts = new DefaultServerAttribute(
+ namingContexts = new DefaultClientAttribute(
schemaManager.lookupAttributeTypeRegistry( SchemaConstants.NAMING_CONTEXTS_AT ), partitionSuffix.getName() );
rootDSE.put( namingContexts );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java Wed Apr 21 22:42:40 2010
@@ -34,12 +34,12 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.filtering.EntryFilteringCursor;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Modification;
import org.apache.directory.shared.ldap.entry.ModificationOperation;
import org.apache.directory.shared.ldap.entry.ServerEntry;
import org.apache.directory.shared.ldap.entry.ServerModification;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.message.AliasDerefMode;
@@ -272,7 +272,7 @@ public class ServerSystemPreferences ext
try
{
at = directoryService.getSchemaManager().lookupAttributeTypeRegistry( key );
- EntryAttribute attr = new DefaultServerAttribute( at );
+ EntryAttribute attr = new DefaultClientAttribute( at );
Modification mi = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attr );
addDelta( mi );
}
@@ -346,7 +346,7 @@ public class ServerSystemPreferences ext
try
{
at = directoryService.getSchemaManager().lookupAttributeTypeRegistry( key );
- EntryAttribute attr = new DefaultServerAttribute( at, value );
+ EntryAttribute attr = new DefaultClientAttribute( at, value );
Modification mi = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attr );
addDelta( mi );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java Wed Apr 21 22:42:40 2010
@@ -26,10 +26,10 @@ import org.apache.directory.server.const
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.ServerEntry;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -124,7 +124,7 @@ public class DefaultSchemaService implem
*/
private EntryAttribute generateComparators() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.COMPARATORS_AT ) );
for ( LdapComparator<?> comparator : getSchemaManager().getComparatorRegistry() )
@@ -138,7 +138,7 @@ public class DefaultSchemaService implem
private EntryAttribute generateNormalizers() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.NORMALIZERS_AT ) );
NormalizerRegistry nr = getSchemaManager().getNormalizerRegistry();
@@ -154,7 +154,7 @@ public class DefaultSchemaService implem
private EntryAttribute generateSyntaxCheckers() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.SYNTAX_CHECKERS_AT ) );
for ( SyntaxChecker syntaxChecker : getSchemaManager().getSyntaxCheckerRegistry() )
@@ -168,7 +168,7 @@ public class DefaultSchemaService implem
private EntryAttribute generateObjectClasses() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASSES_AT ) );
for ( ObjectClass objectClass : getSchemaManager().getObjectClassRegistry() )
@@ -182,7 +182,7 @@ public class DefaultSchemaService implem
private EntryAttribute generateAttributeTypes() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.ATTRIBUTE_TYPES_AT ) );
for ( AttributeType attributeType : getSchemaManager().getAttributeTypeRegistry() )
@@ -196,7 +196,7 @@ public class DefaultSchemaService implem
private EntryAttribute generateMatchingRules() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.MATCHING_RULES_AT ) );
for ( MatchingRule matchingRule : getSchemaManager().getMatchingRuleRegistry() )
@@ -210,7 +210,7 @@ public class DefaultSchemaService implem
private EntryAttribute generateMatchingRuleUses() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.MATCHING_RULE_USE_AT ) );
for ( MatchingRuleUse matchingRuleUse : getSchemaManager().getMatchingRuleUseRegistry() )
@@ -224,7 +224,7 @@ public class DefaultSchemaService implem
private EntryAttribute generateSyntaxes() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.LDAP_SYNTAXES_AT ) );
for ( LdapSyntax syntax : getSchemaManager().getLdapSyntaxRegistry() )
@@ -238,7 +238,7 @@ public class DefaultSchemaService implem
private EntryAttribute generateDitContextRules() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.DIT_CONTENT_RULES_AT ) );
for ( DITContentRule ditContentRule : getSchemaManager().getDITContentRuleRegistry() )
@@ -252,7 +252,7 @@ public class DefaultSchemaService implem
private EntryAttribute generateDitStructureRules() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.DIT_STRUCTURE_RULES_AT ) );
for ( DITStructureRule ditStructureRule : getSchemaManager().getDITStructureRuleRegistry() )
@@ -266,7 +266,7 @@ public class DefaultSchemaService implem
private EntryAttribute generateNameForms() throws LdapException
{
- EntryAttribute attr = new DefaultServerAttribute(
+ EntryAttribute attr = new DefaultClientAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.NAME_FORMS_AT ) );
for ( NameForm nameForm : getSchemaManager().getNameFormRegistry() )
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Wed Apr 21 22:42:40 2010
@@ -56,7 +56,6 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.cursor.SingletonCursor;
import org.apache.directory.shared.ldap.entry.BinaryValue;
import org.apache.directory.shared.ldap.entry.StringValue;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.Entry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Modification;
@@ -64,6 +63,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.entry.ServerEntry;
import org.apache.directory.shared.ldap.entry.ServerModification;
import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapAttributeInUseException;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeTypeException;
@@ -900,7 +900,7 @@ public class SchemaInterceptor extends B
{
if ( ( changes == null ) && ( existing == null ) )
{
- return new DefaultServerAttribute( SchemaConstants.OBJECT_CLASS_AT, OBJECT_CLASS );
+ return new DefaultClientAttribute( SchemaConstants.OBJECT_CLASS_AT, OBJECT_CLASS );
}
if ( changes == null )
@@ -914,7 +914,7 @@ public class SchemaInterceptor extends B
}
else if ( existing == null )
{
- return new DefaultServerAttribute( SchemaConstants.OBJECT_CLASS_AT, OBJECT_CLASS );
+ return new DefaultClientAttribute( SchemaConstants.OBJECT_CLASS_AT, OBJECT_CLASS );
}
switch ( modOp )
@@ -1134,7 +1134,7 @@ public class SchemaInterceptor extends B
if ( !tmpEntry.contains( type, atav.getNormValue() ) )
{
- tmpEntry.add( new DefaultServerAttribute( type, atav.getUpValue() ) );
+ tmpEntry.add( new DefaultClientAttribute( type, atav.getUpValue() ) );
}
}
@@ -1167,7 +1167,7 @@ public class SchemaInterceptor extends B
AttributeType attributeType = attribute.getAttributeType();
// Create the new Attribute
- EntryAttribute newAttribute = new DefaultServerAttribute( attribute.getUpId(), attributeType );
+ EntryAttribute newAttribute = new DefaultClientAttribute( attribute.getUpId(), attributeType );
for ( Value<?> value : attribute )
{
@@ -1469,7 +1469,7 @@ public class SchemaInterceptor extends B
entry.removeAttributes( SchemaConstants.OBJECT_CLASS_AT );
- EntryAttribute newOc = new DefaultServerAttribute( oc.getAttributeType() );
+ EntryAttribute newOc = new DefaultClientAttribute( oc.getAttributeType() );
for ( ObjectClass currentOC : objectClasses )
{
@@ -1496,12 +1496,17 @@ public class SchemaInterceptor extends B
for ( Value<?> value : attribute )
{
+ attribute.add( value );
binaries.add( new BinaryValue( attribute.getAttributeType(),
value.getBytes() ) );
}
attribute.clear();
- attribute.put( binaries );
+
+ for ( Value<?> value : binaries )
+ {
+ attribute.add( value );
+ }
}
}
}
@@ -1571,7 +1576,7 @@ public class SchemaInterceptor extends B
// In this case, we create an new one, empty
if ( objectClassAttr == null )
{
- objectClassAttr = new DefaultServerAttribute( SchemaConstants.OBJECT_CLASS_AT, OBJECT_CLASS );
+ objectClassAttr = new DefaultClientAttribute( SchemaConstants.OBJECT_CLASS_AT, OBJECT_CLASS );
}
List<ObjectClass> ocs = new ArrayList<ObjectClass>();
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Wed Apr 21 22:42:40 2010
@@ -56,7 +56,6 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.StringValue;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Modification;
@@ -64,6 +63,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.entry.ServerEntry;
import org.apache.directory.shared.ldap.entry.ServerModification;
import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
@@ -346,7 +346,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT,
+ operational = new DefaultClientAttribute( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT,
schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT ) );
subentryAttrs.put( operational );
}
@@ -359,7 +359,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( SchemaConstants.SUBSCHEMA_SUBENTRY_AT, schemaManager
+ operational = new DefaultClientAttribute( SchemaConstants.SUBSCHEMA_SUBENTRY_AT, schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ) );
subentryAttrs.put( operational );
}
@@ -372,7 +372,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
+ operational = new DefaultClientAttribute( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
schemaManager.lookupAttributeTypeRegistry( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
subentryAttrs.put( operational );
}
@@ -385,7 +385,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT,
+ operational = new DefaultClientAttribute( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT,
schemaManager.lookupAttributeTypeRegistry( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
subentryAttrs.put( operational );
}
@@ -520,7 +520,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( schemaManager
+ operational = new DefaultClientAttribute( schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT ) );
entry.put( operational );
}
@@ -534,7 +534,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( schemaManager
+ operational = new DefaultClientAttribute( schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ) );
entry.put( operational );
}
@@ -548,7 +548,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( schemaManager
+ operational = new DefaultClientAttribute( schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
entry.put( operational );
}
@@ -562,7 +562,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( schemaManager
+ operational = new DefaultClientAttribute( schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
entry.put( operational );
}
@@ -738,7 +738,7 @@ public class SubentryInterceptor extends
for ( String aSUBENTRY_OPATTRS : SUBENTRY_OPATTRS )
{
ModificationOperation op = ModificationOperation.ADD_ATTRIBUTE;
- EntryAttribute opAttr = new DefaultServerAttribute( aSUBENTRY_OPATTRS, schemaManager
+ EntryAttribute opAttr = new DefaultClientAttribute( aSUBENTRY_OPATTRS, schemaManager
.lookupAttributeTypeRegistry( aSUBENTRY_OPATTRS ) );
opAttr.add( subentryDn );
modList.add( new ServerModification( op, opAttr ) );
@@ -1158,7 +1158,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT, schemaManager
+ operational = new DefaultClientAttribute( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT, schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT ) );
operational.add( newName.toString() );
}
@@ -1177,7 +1177,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( SchemaConstants.SUBSCHEMA_SUBENTRY_AT, schemaManager
+ operational = new DefaultClientAttribute( SchemaConstants.SUBSCHEMA_SUBENTRY_AT, schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ) );
operational.add( newName.toString() );
}
@@ -1196,7 +1196,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
+ operational = new DefaultClientAttribute( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
schemaManager.lookupAttributeTypeRegistry( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
operational.add( newName.toString() );
}
@@ -1215,7 +1215,7 @@ public class SubentryInterceptor extends
if ( operational == null )
{
- operational = new DefaultServerAttribute( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT, schemaManager
+ operational = new DefaultClientAttribute( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT, schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
operational.add( newName.toString() );
}
@@ -1319,7 +1319,7 @@ public class SubentryInterceptor extends
if ( ( opAttr != null ) && opAttr.contains( dn ) )
{
AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( opAttrId );
- EntryAttribute attr = new DefaultServerAttribute( opAttrId, attributeType, dn );
+ EntryAttribute attr = new DefaultClientAttribute( opAttrId, attributeType, dn );
modList.add( new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attr ) );
}
}
@@ -1351,7 +1351,7 @@ public class SubentryInterceptor extends
for ( AttributeType attributeType : operational.getAttributeTypes() )
{
ModificationOperation op = ModificationOperation.REPLACE_ATTRIBUTE;
- EntryAttribute result = new DefaultServerAttribute( attributeType );
+ EntryAttribute result = new DefaultClientAttribute( attributeType );
EntryAttribute opAttrAdditions = operational.get( attributeType );
EntryAttribute opAttrInEntry = entry.get( attributeType );
@@ -1491,7 +1491,7 @@ public class SubentryInterceptor extends
{
ModificationOperation op = ModificationOperation.ADD_ATTRIBUTE;
AttributeType type = schemaManager.lookupAttributeTypeRegistry( attribute );
- EntryAttribute opAttr = new DefaultServerAttribute( attribute, type );
+ EntryAttribute opAttr = new DefaultClientAttribute( attribute, type );
opAttr.add( subentryDn );
modList.add( new ServerModification( op, opAttr ) );
}
Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java Wed Apr 21 22:42:40 2010
@@ -43,10 +43,10 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem;
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.entry.StringValue;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.ServerEntry;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -226,7 +226,7 @@ public class RelatedProtectedItemFilterT
public void testAttributeValue() throws Exception
{
Collection<EntryAttribute> attributes = new ArrayList<EntryAttribute>();
- attributes.add( new DefaultServerAttribute( "cn", CN_AT, "valueA" ) );
+ attributes.add( new DefaultClientAttribute( "cn", CN_AT, "valueA" ) );
Collection<ACITuple> tuples = getTuples( new ProtectedItem.AttributeValue( convert( attributes ) ) );
// Test wrong scope
Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java Wed Apr 21 22:42:40 2010
@@ -29,11 +29,11 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.ModificationOperation;
import org.apache.directory.shared.ldap.entry.ServerEntry;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -101,7 +101,7 @@ public class SchemaCheckerTest
ModificationOperation mod = ModificationOperation.REPLACE_ATTRIBUTE;
ServerEntry modifyAttributes = new DefaultServerEntry( schemaManager );
AttributeType atCN = schemaManager.lookupAttributeTypeRegistry( "cn" );
- modifyAttributes.put( new DefaultServerAttribute( atCN ) );
+ modifyAttributes.put( new DefaultClientAttribute( atCN ) );
// this should pass
SchemaChecker.preventStructuralClassRemovalOnModifyReplace( schemaManager.getObjectClassRegistry(), name, mod, modifyAttributes );
@@ -109,14 +109,14 @@ public class SchemaCheckerTest
// this should succeed since person is still in replaced set and is structural
modifyAttributes.removeAttributes( atCN );
AttributeType atOC = schemaManager.lookupAttributeTypeRegistry( "objectClass" );
- EntryAttribute objectClassesReplaced = new DefaultServerAttribute( atOC );
+ EntryAttribute objectClassesReplaced = new DefaultClientAttribute( atOC );
objectClassesReplaced.add( "top" );
objectClassesReplaced.add( "person" );
modifyAttributes.put( objectClassesReplaced );
SchemaChecker.preventStructuralClassRemovalOnModifyReplace( schemaManager.getObjectClassRegistry(), name, mod, modifyAttributes );
// this should fail since only top is left
- objectClassesReplaced = new DefaultServerAttribute( atOC );
+ objectClassesReplaced = new DefaultClientAttribute( atOC );
objectClassesReplaced.add( "top" );
modifyAttributes.put( objectClassesReplaced );
try
@@ -132,7 +132,7 @@ public class SchemaCheckerTest
// this should fail since the modify operation tries to delete all
// objectClass attribute values
modifyAttributes.removeAttributes( "cn" );
- objectClassesReplaced = new DefaultServerAttribute( atOC );
+ objectClassesReplaced = new DefaultClientAttribute( atOC );
modifyAttributes.put( objectClassesReplaced );
try
{
@@ -227,7 +227,7 @@ public class SchemaCheckerTest
// test should fail since we are removing the ou attribute
AttributeType OU_AT = schemaManager.lookupAttributeTypeRegistry( "ou" );
- attributes.put( new DefaultServerAttribute( "ou", OU_AT ) );
+ attributes.put( new DefaultClientAttribute( "ou", OU_AT ) );
try
{
@@ -247,7 +247,7 @@ public class SchemaCheckerTest
// test for failure when modifying Rdn attribute in multi attribute Rdn
AttributeType CN_AT = schemaManager.lookupAttributeTypeRegistry( "cn" );
- attributes.put( new DefaultServerAttribute( "cn", CN_AT ) );
+ attributes.put( new DefaultClientAttribute( "cn", CN_AT ) );
try
{
@@ -366,16 +366,17 @@ public class SchemaCheckerTest
// this should pass
DN name = new DN( "uid=akarasulu,ou=users,dc=example,dc=com" );
ModificationOperation mod = ModificationOperation.REPLACE_ATTRIBUTE;
- SchemaChecker.preventStructuralClassRemovalOnModifyReplace( schemaManager, name, mod, new DefaultServerAttribute( "cn", CN_AT ) );
+ SchemaChecker.preventStructuralClassRemovalOnModifyReplace( schemaManager, name, mod,
+ new DefaultClientAttribute( "cn", CN_AT ) );
// this should succeed since person is still in replaced set and is structural
- EntryAttribute objectClassesReplaced = new DefaultServerAttribute( "objectClass", OBJECT_CLASS );
+ EntryAttribute objectClassesReplaced = new DefaultClientAttribute( "objectClass", OBJECT_CLASS );
objectClassesReplaced.add( "top" );
objectClassesReplaced.add( "person" );
SchemaChecker.preventStructuralClassRemovalOnModifyReplace( schemaManager, name, mod, objectClassesReplaced );
// this should fail since only top is left
- objectClassesReplaced = new DefaultServerAttribute( "objectClass", OBJECT_CLASS );
+ objectClassesReplaced = new DefaultClientAttribute( "objectClass", OBJECT_CLASS );
objectClassesReplaced.add( "top" );
try
{
@@ -389,7 +390,7 @@ public class SchemaCheckerTest
// this should fail since the modify operation tries to delete all
// objectClass attribute values
- objectClassesReplaced = new DefaultServerAttribute( "objectClass", OBJECT_CLASS );
+ objectClassesReplaced = new DefaultClientAttribute( "objectClass", OBJECT_CLASS );
try
{
SchemaChecker.preventStructuralClassRemovalOnModifyReplace( schemaManager, name, mod, objectClassesReplaced );
@@ -413,7 +414,7 @@ public class SchemaCheckerTest
ModificationOperation mod = ModificationOperation.REMOVE_ATTRIBUTE;
AttributeType ocAt = schemaManager.lookupAttributeTypeRegistry( "objectClass" );
- EntryAttribute entryObjectClasses = new DefaultServerAttribute( "objectClass", ocAt );
+ EntryAttribute entryObjectClasses = new DefaultClientAttribute( "objectClass", ocAt );
entryObjectClasses.add( "top", "person", "organizationalPerson" );
// this should pass
@@ -421,18 +422,18 @@ public class SchemaCheckerTest
schemaManager,
name,
mod,
- new DefaultServerAttribute( "cn", schemaManager.lookupAttributeTypeRegistry( "cn" ) ),
+ new DefaultClientAttribute( "cn", schemaManager.lookupAttributeTypeRegistry( "cn" ) ),
entryObjectClasses );
// this should succeed since person is left and is structural
- EntryAttribute objectClassesRemoved = new DefaultServerAttribute(
+ EntryAttribute objectClassesRemoved = new DefaultClientAttribute(
"objectClass", ocAt );
objectClassesRemoved.add( "person" );
SchemaChecker.preventStructuralClassRemovalOnModifyRemove( schemaManager, name, mod, objectClassesRemoved,
entryObjectClasses );
// this should fail since only top is left
- objectClassesRemoved = new DefaultServerAttribute( "objectClass", ocAt );
+ objectClassesRemoved = new DefaultClientAttribute( "objectClass", ocAt );
objectClassesRemoved.add( "person", "organizationalPerson" );
try
@@ -448,7 +449,7 @@ public class SchemaCheckerTest
// this should fail since the modify operation tries to delete all
// objectClass attribute values
- objectClassesRemoved = new DefaultServerAttribute( "objectClass", ocAt );
+ objectClassesRemoved = new DefaultClientAttribute( "objectClass", ocAt );
try
{
@@ -479,13 +480,13 @@ public class SchemaCheckerTest
// postive test which should pass
SchemaChecker.preventRdnChangeOnModifyRemove( name, mod,
- new DefaultServerAttribute( "cn", cnAt, "does not matter" ), schemaManager );
+ new DefaultClientAttribute( "cn", cnAt, "does not matter" ), schemaManager );
// test should fail since we are removing the ou attribute
try
{
SchemaChecker.preventRdnChangeOnModifyRemove( name, mod,
- new DefaultServerAttribute( "ou", ouAt ), schemaManager );
+ new DefaultClientAttribute( "ou", ouAt ), schemaManager );
fail( "should never get here due to a LdapSchemaViolationException being thrown" );
}
catch ( LdapSchemaViolationException e )
@@ -497,13 +498,13 @@ public class SchemaCheckerTest
name = new DN( "ou=users+cn=system users,dc=example,dc=com" );
name.normalize( oidNormalizers );
SchemaChecker.preventRdnChangeOnModifyRemove( name, mod,
- new DefaultServerAttribute( "sn", snAt, "does not matter" ), schemaManager );
+ new DefaultClientAttribute( "sn", snAt, "does not matter" ), schemaManager );
// test for failure when modifying Rdn attribute in multi attribute Rdn
try
{
SchemaChecker.preventRdnChangeOnModifyRemove( name, mod,
- new DefaultServerAttribute( "cn", cnAt ), schemaManager );
+ new DefaultClientAttribute( "cn", cnAt ), schemaManager );
fail( "should never get here due to a LdapSchemaViolationException being thrown" );
}
catch ( LdapSchemaViolationException e )
@@ -514,13 +515,13 @@ public class SchemaCheckerTest
// should succeed since the value being deleted from the rdn attribute is
// is not used when composing the Rdn
SchemaChecker.preventRdnChangeOnModifyRemove( name, mod,
- new DefaultServerAttribute( "ou", ouAt, "container" ), schemaManager );
+ new DefaultClientAttribute( "ou", ouAt, "container" ), schemaManager );
// now let's make it fail again just by providing the right value for ou (users)
try
{
SchemaChecker.preventRdnChangeOnModifyRemove( name, mod,
- new DefaultServerAttribute( "ou", ouAt, "users" ), schemaManager );
+ new DefaultClientAttribute( "ou", ouAt, "users" ), schemaManager );
fail( "should never get here due to a LdapSchemaViolationException being thrown" );
}
catch ( LdapSchemaViolationException e )
Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java Wed Apr 21 22:42:40 2010
@@ -24,8 +24,8 @@ import static org.junit.Assert.assertTru
import static org.junit.Assert.fail;
import org.apache.directory.shared.ldap.entry.StringValue;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.filter.EqualityNode;
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.filter.FilterParser;
@@ -120,7 +120,7 @@ public class RefinementEvaluatorTest
{
try
{
- assertFalse( evaluator.evaluate( null, new DefaultServerAttribute( "objectClass", OBJECT_CLASS ) ) );
+ assertFalse( evaluator.evaluate( null, new DefaultClientAttribute( "objectClass", OBJECT_CLASS ) ) );
fail( "should never get here due to an IAE" );
}
catch ( IllegalArgumentException iae )
@@ -138,7 +138,8 @@ public class RefinementEvaluatorTest
try
{
- assertFalse( evaluator.evaluate( new EqualityNode( "", new StringValue( "" ) ), new DefaultServerAttribute( "cn", CN ) ) );
+ assertFalse( evaluator.evaluate( new EqualityNode( "", new StringValue( "" ) ),
+ new DefaultClientAttribute( "cn", CN ) ) );
fail( "should never get here due to an IAE" );
}
catch ( IllegalArgumentException iae )
@@ -153,17 +154,17 @@ public class RefinementEvaluatorTest
EntryAttribute objectClasses = null;
// positive test
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "person" ) ), objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person", "blah" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person", "blah" );
assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "person" ) ), objectClasses ) );
// negative tests
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "blah" ) ), objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "blah" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "blah" );
assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "person" ) ), objectClasses ) );
}
@@ -171,19 +172,19 @@ public class RefinementEvaluatorTest
@Test
public void testMatchByOID() throws Exception
{
- EntryAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ EntryAttribute objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
// positive test
assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "2.5.6.6" ) ), objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person", "blah" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person", "blah" );
assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "2.5.6.6" ) ), objectClasses ) );
// negative tests
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "2.5.6.5" ) ), objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "blah" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "blah" );
assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "2.5.6.5" ) ), objectClasses ) );
}
@@ -192,17 +193,17 @@ public class RefinementEvaluatorTest
public void testComplexOrRefinement() throws Exception
{
ExprNode refinement = null;
- EntryAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ EntryAttribute objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
String refStr = "(|(objectClass=person)(objectClass=organizationalUnit))";
refinement = FilterParser.parse( refStr );
assertTrue( evaluator.evaluate( refinement, objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "organizationalUnit" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "organizationalUnit" );
assertTrue( evaluator.evaluate( refinement, objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "domain" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "domain" );
assertFalse( evaluator.evaluate( refinement, objectClasses ) );
}
@@ -211,7 +212,7 @@ public class RefinementEvaluatorTest
public void testComplexAndRefinement() throws Exception
{
ExprNode refinement = null;
- EntryAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ EntryAttribute objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
objectClasses.add( "organizationalUnit" );
String refStr = "(&(objectClass=person)(objectClass=organizationalUnit))";
@@ -219,13 +220,13 @@ public class RefinementEvaluatorTest
assertTrue( evaluator.evaluate( refinement, objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "organizationalUnit" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "organizationalUnit" );
assertFalse( evaluator.evaluate( refinement, objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
assertFalse( evaluator.evaluate( refinement, objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "domain" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "domain" );
assertFalse( evaluator.evaluate( refinement, objectClasses ) );
}
@@ -234,22 +235,22 @@ public class RefinementEvaluatorTest
public void testComplexNotRefinement() throws Exception
{
ExprNode refinement = null;
- EntryAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ EntryAttribute objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
String refStr = "(!(objectClass=person))";
refinement = FilterParser.parse( refStr );
assertFalse( evaluator.evaluate( refinement, objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "organizationalUnit" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "organizationalUnit" );
assertTrue( evaluator.evaluate( refinement, objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "domain" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "domain" );
assertTrue( evaluator.evaluate( refinement, objectClasses ) );
try
{
- assertFalse( evaluator.evaluate( new NotNode(), new DefaultServerAttribute( "objectClass", OBJECT_CLASS ) ) );
+ assertFalse( evaluator.evaluate( new NotNode(), new DefaultClientAttribute( "objectClass", OBJECT_CLASS ) ) );
fail( "should never get here due to an IAE" );
}
catch ( IllegalArgumentException iae )
Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java Wed Apr 21 22:42:40 2010
@@ -25,8 +25,8 @@ import static org.junit.Assert.assertTru
import static org.junit.Assert.fail;
import org.apache.directory.shared.ldap.entry.StringValue;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.filter.EqualityNode;
import org.apache.directory.shared.ldap.filter.GreaterEqNode;
@@ -154,7 +154,7 @@ public class RefinementLeafEvaluatorTest
try
{
- objectClasses = new DefaultServerAttribute( "cn", OBJECT_CLASS );
+ objectClasses = new DefaultClientAttribute( "cn", OBJECT_CLASS );
assertFalse( evaluator.evaluate( new EqualityNode( "cn", new StringValue( "" ) ), objectClasses ) );
fail( "should never get here due to an IAE" );
}
@@ -169,19 +169,19 @@ public class RefinementLeafEvaluatorTest
public void testMatchByName() throws Exception
{
// positive test
- EntryAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ EntryAttribute objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "person" ) ), objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS );
objectClasses.add( "person" );
objectClasses.add( "blah" );
assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "person" ) ), objectClasses ) );
// negative tests
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "blah" ) ), objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "blah" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "blah" );
assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "person" ) ), objectClasses ) );
}
@@ -189,21 +189,21 @@ public class RefinementLeafEvaluatorTest
@Test
public void testMatchByOID() throws Exception
{
- EntryAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ EntryAttribute objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
// positive test
assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "2.5.6.6" ) ), objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS );
objectClasses.add( "person" );
objectClasses.add( "blah" );
assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "2.5.6.6" ) ), objectClasses ) );
// negative tests
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "person" );
assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "2.5.6.5" ) ), objectClasses ) );
- objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "blah" );
+ objectClasses = new DefaultClientAttribute( "objectClass", OBJECT_CLASS, "blah" );
assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", new StringValue( "2.5.6.5" ) ), objectClasses ) );
}
}
Modified: directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java Wed Apr 21 22:42:40 2010
@@ -62,13 +62,13 @@ import org.apache.directory.server.kerbe
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.BinaryValue;
import org.apache.directory.shared.ldap.entry.StringValue;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Modification;
import org.apache.directory.shared.ldap.entry.ModificationOperation;
import org.apache.directory.shared.ldap.entry.ServerEntry;
import org.apache.directory.shared.ldap.entry.ServerModification;
import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapAuthenticationException;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -375,14 +375,14 @@ public class KeyDerivationInterceptor ex
newModsList.add(
new ServerModification(
ModificationOperation.REPLACE_ATTRIBUTE,
- new DefaultServerAttribute(
+ new DefaultClientAttribute(
KerberosAttribute.KRB5_PRINCIPAL_NAME_AT,
schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ),
principalName ) ) );
newModsList.add(
new ServerModification(
ModificationOperation.REPLACE_ATTRIBUTE,
- new DefaultServerAttribute(
+ new DefaultClientAttribute(
KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT,
schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT ),
Integer.toString( kvno ) ) ) );
@@ -398,7 +398,7 @@ public class KeyDerivationInterceptor ex
private EntryAttribute getKeyAttribute( SchemaManager schemaManager, Map<EncryptionType, EncryptionKey> keys ) throws Exception
{
EntryAttribute keyAttribute =
- new DefaultServerAttribute( KerberosAttribute.KRB5_KEY_AT,
+ new DefaultClientAttribute( KerberosAttribute.KRB5_KEY_AT,
schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_KEY_AT ) );
Iterator<EncryptionKey> it = keys.values().iterator();
Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Wed Apr 21 22:42:40 2010
@@ -48,13 +48,13 @@ import org.apache.directory.server.xdbm.
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.csn.CsnFactory;
import org.apache.directory.shared.ldap.cursor.Cursor;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Modification;
import org.apache.directory.shared.ldap.entry.ModificationOperation;
import org.apache.directory.shared.ldap.entry.ServerEntry;
import org.apache.directory.shared.ldap.entry.ServerModification;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapNoSuchObjectException;
import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
import org.apache.directory.shared.ldap.name.DN;
@@ -658,7 +658,7 @@ public class JdbmStoreTest
dn.normalize( schemaManager.getNormalizerMapping() );
List<Modification> mods = new ArrayList<Modification>();
- EntryAttribute attrib = new DefaultServerAttribute( SchemaConstants.OU_AT, schemaManager
+ EntryAttribute attrib = new DefaultClientAttribute( SchemaConstants.OU_AT, schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.OU_AT_OID ) );
attrib.add( "Engineering" );
@@ -760,7 +760,7 @@ public class JdbmStoreTest
dn.normalize( schemaManager.getNormalizerMapping() );
List<Modification> mods = new ArrayList<Modification>();
- EntryAttribute attrib = new DefaultServerAttribute( SchemaConstants.SURNAME_AT, schemaManager
+ EntryAttribute attrib = new DefaultClientAttribute( SchemaConstants.SURNAME_AT, schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.SURNAME_AT ) );
String attribVal = "Walker";
@@ -792,7 +792,7 @@ public class JdbmStoreTest
dn.normalize( schemaManager.getNormalizerMapping() );
List<Modification> mods = new ArrayList<Modification>();
- EntryAttribute attrib = new DefaultServerAttribute( SchemaConstants.SN_AT, schemaManager
+ EntryAttribute attrib = new DefaultClientAttribute( SchemaConstants.SN_AT, schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.SN_AT_OID ) );
String attribVal = "Johnny";
@@ -825,7 +825,7 @@ public class JdbmStoreTest
dn.normalize( schemaManager.getNormalizerMapping() );
List<Modification> mods = new ArrayList<Modification>();
- EntryAttribute attrib = new DefaultServerAttribute( SchemaConstants.SN_AT, schemaManager
+ EntryAttribute attrib = new DefaultClientAttribute( SchemaConstants.SN_AT, schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.SN_AT_OID ) );
Modification add = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attrib );
@@ -865,7 +865,7 @@ public class JdbmStoreTest
store.add( entry );
List<Modification> mods = new ArrayList<Modification>();
- EntryAttribute attrib = new DefaultServerAttribute( SchemaConstants.OU_AT, schemaManager
+ EntryAttribute attrib = new DefaultClientAttribute( SchemaConstants.OU_AT, schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.OU_AT_OID ) );
String attribVal = "Marketing";
Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java Wed Apr 21 22:42:40 2010
@@ -30,10 +30,10 @@ import java.util.Map;
import org.apache.directory.server.core.partition.impl.btree.jdbm.ServerEntrySerializer;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.ServerEntry;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
@@ -251,7 +251,7 @@ public class ServerEntrySerializerTest
ServerEntry entry = new DefaultServerEntry( schemaManager, dn );
ServerEntrySerializer ses = new ServerEntrySerializer( schemaManager );
- EntryAttribute oc = new DefaultServerAttribute( "ObjectClass", schemaManager.lookupAttributeTypeRegistry( "objectclass" ) );
+ EntryAttribute oc = new DefaultClientAttribute( "ObjectClass", schemaManager.lookupAttributeTypeRegistry( "objectclass" ) );
entry.add( oc );
byte[] data = ses.serialize( entry );
Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java Wed Apr 21 22:42:40 2010
@@ -29,12 +29,12 @@ import org.apache.directory.server.core.
import org.apache.directory.server.kerberos.shared.store.KerberosAttribute;
import org.apache.directory.server.protocol.shared.store.DirectoryServiceOperation;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Modification;
import org.apache.directory.shared.ldap.entry.ModificationOperation;
import org.apache.directory.shared.ldap.entry.ServerEntry;
import org.apache.directory.shared.ldap.entry.ServerModification;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.util.StringTools;
@@ -80,11 +80,11 @@ public class ChangePassword implements D
List<Modification> mods = new ArrayList<Modification>(2);
- EntryAttribute newPasswordAttribute = new DefaultServerAttribute(
+ EntryAttribute newPasswordAttribute = new DefaultClientAttribute(
schemaManager.lookupAttributeTypeRegistry( SchemaConstants.USER_PASSWORD_AT ), StringTools.getBytesUtf8( newPassword ) );
mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, newPasswordAttribute ) );
- EntryAttribute principalAttribute = new DefaultServerAttribute(
+ EntryAttribute principalAttribute = new DefaultClientAttribute(
schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ), principal.getName() );
mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, principalAttribute ) );
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java Wed Apr 21 22:42:40 2010
@@ -291,7 +291,7 @@ public class ModifyReplaceIT extends Abs
attrs = ctx.getAttributes( rdn );
Attribute attr = attrs.get( "telephoneNumber" );
assertNotNull( attr );
- assertEquals( "telephoneNumber", attr.getID() );
+ assertEquals( "telephonenumber", attr.getID() );
assertTrue( attr.contains( newValue ) );
assertEquals( 1, attr.size() );
}
Modified: directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java (original)
+++ directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java Wed Apr 21 22:42:40 2010
@@ -25,10 +25,10 @@ import java.util.List;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.DefaultServerAttribute;
import org.apache.directory.shared.ldap.entry.DefaultServerEntry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.ServerEntry;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.DITContentRule;
@@ -113,7 +113,7 @@ public class AttributesFactory
if ( dependencies != null && dependencies.length > 0 )
{
- EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_DEPENDENCIES_AT ) );
+ EntryAttribute attr = new DefaultClientAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_DEPENDENCIES_AT ) );
for ( String dependency:dependencies )
{
@@ -336,7 +336,7 @@ public class AttributesFactory
// handle the superior objectClasses
if ( objectClass.getSuperiorOids() != null && objectClass.getSuperiorOids().size() != 0 )
{
- EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_SUP_OBJECT_CLASS_AT ) );
+ EntryAttribute attr = new DefaultClientAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_SUP_OBJECT_CLASS_AT ) );
for ( String superior:objectClass.getSuperiorOids() )
{
@@ -349,7 +349,7 @@ public class AttributesFactory
// add the must list
if ( objectClass.getMustAttributeTypeOids() != null && objectClass.getMustAttributeTypeOids().size() != 0 )
{
- EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_MUST_AT ) );
+ EntryAttribute attr = new DefaultClientAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_MUST_AT ) );
for ( String mustOid :objectClass.getMustAttributeTypeOids() )
{
@@ -362,7 +362,7 @@ public class AttributesFactory
// add the may list
if ( objectClass.getMayAttributeTypeOids() != null && objectClass.getMayAttributeTypeOids().size() != 0 )
{
- EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_MAY_AT ) );
+ EntryAttribute attr = new DefaultClientAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_MAY_AT ) );
for ( String mayOid :objectClass.getMayAttributeTypeOids() )
{
@@ -396,7 +396,7 @@ public class AttributesFactory
return;
}
- EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_NAME_AT ) );
+ EntryAttribute attr = new DefaultClientAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_NAME_AT ) );
for ( String name:names )
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java Wed Apr 21 22:42:40 2010
@@ -307,7 +307,9 @@ public abstract class AbstractValue<T> i
if ( attributeType != null )
{
- valid = attributeType.getSyntax().getSyntaxChecker().isValidSyntax( get() );
+ SyntaxChecker syntaxChecker = attributeType.getSyntax().getSyntaxChecker();
+ T value = getNormalizedValue();
+ valid = syntaxChecker.isValidSyntax( value );
}
else
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java Wed Apr 21 22:42:40 2010
@@ -31,6 +31,7 @@ import java.util.Set;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.NotImplementedException;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.name.DN;
@@ -157,7 +158,7 @@ public final class DefaultServerEntry ex
*/
private void createAttribute( String upId, AttributeType attributeType, byte[]... values )
{
- EntryAttribute attribute = new DefaultServerAttribute( attributeType, values );
+ EntryAttribute attribute = new DefaultClientAttribute( attributeType, values );
attribute.setUpId( upId, attributeType );
attributes.put( attributeType, attribute );
}
@@ -171,7 +172,7 @@ public final class DefaultServerEntry ex
*/
private void createAttribute( String upId, AttributeType attributeType, String... values )
{
- EntryAttribute attribute = new DefaultServerAttribute( attributeType, values );
+ EntryAttribute attribute = new DefaultClientAttribute( attributeType, values );
attribute.setUpId( upId, attributeType );
attributes.put( attributeType, attribute );
}
@@ -185,7 +186,7 @@ public final class DefaultServerEntry ex
*/
private void createAttribute( String upId, AttributeType attributeType, Value<?>... values )
{
- EntryAttribute attribute = new DefaultServerAttribute( attributeType, values );
+ EntryAttribute attribute = new DefaultClientAttribute( attributeType, values );
attribute.setUpId( upId, attributeType );
attributes.put( attributeType, attribute );
}
@@ -288,7 +289,7 @@ public final class DefaultServerEntry ex
}
// Create a new ServerAttribute.
- EntryAttribute serverAttribute = new DefaultServerAttribute( attributeType, attribute );
+ EntryAttribute serverAttribute = new DefaultClientAttribute( attributeType, attribute );
// And store it
add( serverAttribute );
@@ -1466,7 +1467,8 @@ public final class DefaultServerEntry ex
throw new UnsupportedOperationException( message );
}
- EntryAttribute attribute = new DefaultServerAttribute( upId, attributeType, values );
+ EntryAttribute attribute = new DefaultClientAttribute( upId, attributeType, values );
+
return attributes.put( attributeType, attribute );
}
@@ -1528,7 +1530,8 @@ public final class DefaultServerEntry ex
}
}
- EntryAttribute attribute = new DefaultServerAttribute( upId, attributeType, values );
+ EntryAttribute attribute = new DefaultClientAttribute( upId, attributeType, values );
+
return attributes.put( attributeType, attribute );
}
@@ -1581,7 +1584,8 @@ public final class DefaultServerEntry ex
upId = getUpId( upId, attributeType );
}
- EntryAttribute attribute = new DefaultServerAttribute( upId, attributeType, values );
+ EntryAttribute attribute = new DefaultClientAttribute( upId, attributeType, values );
+
return attributes.put( attributeType, attribute );
}
@@ -2148,7 +2152,7 @@ public final class DefaultServerEntry ex
continue;
}
- EntryAttribute attribute = attributes.put( attributeType, new DefaultServerAttribute( attributeType ) );
+ EntryAttribute attribute = attributes.put( attributeType, new DefaultClientAttribute( attributeType ) );
if ( attribute != null )
{
@@ -2205,7 +2209,7 @@ public final class DefaultServerEntry ex
}
EntryAttribute attribute = attributes.put( attributeType,
- new DefaultServerAttribute( upId, attributeType ));
+ new DefaultClientAttribute( upId, attributeType ));
if ( attribute != null )
{
@@ -2340,7 +2344,7 @@ public final class DefaultServerEntry ex
out.writeUTF( oid );
// Get the attribute
- DefaultServerAttribute attribute = (DefaultServerAttribute)attributes.get( attributeType );
+ DefaultClientAttribute attribute = (DefaultClientAttribute)attributes.get( attributeType );
// Write the attribute
attribute.serialize( out );
@@ -2393,7 +2397,7 @@ public final class DefaultServerEntry ex
AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid );
// Create the attribute we will read
- DefaultServerAttribute attribute = new DefaultServerAttribute( attributeType );
+ EntryAttribute attribute = new DefaultClientAttribute( attributeType );
// Read the attribute
attribute.deserialize( in );
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java Wed Apr 21 22:42:40 2010
@@ -19,6 +19,8 @@
package org.apache.directory.shared.ldap.entry;
import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
import java.util.Iterator;
import java.util.List;
@@ -241,6 +243,12 @@ public interface EntryAttribute extends
/**
+ * @see Externalizable#readExternal(ObjectInput)
+ */
+ void deserialize( ObjectInput in ) throws IOException, ClassNotFoundException;
+
+
+ /**
* <p>
* Get the first value of this attribute. If there is none,
* null is returned.
@@ -367,7 +375,7 @@ public interface EntryAttribute extends
*
* @param val some values to be put which may be null
* @return the number of added values, or 0 if none has been added
- */
+ *
int put( String... vals );
@@ -382,7 +390,7 @@ public interface EntryAttribute extends
*
* @param val some values to be put which may be null
* @return the number of added values, or 0 if none has been added
- */
+ *
int put( byte[]... vals );
@@ -397,7 +405,7 @@ public interface EntryAttribute extends
*
* @param val some values to be put which may be null
* @return the number of added values, or 0 if none has been added
- */
+ *
int put( Value<?>... vals );
@@ -414,7 +422,7 @@ public interface EntryAttribute extends
*
* @param vals the values to be put
* @return the number of added values, or 0 if none has been added
- */
+ *
int put( List<Value<?>> vals );
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ServerModification.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ServerModification.java?rev=936554&r1=936553&r2=936554&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ServerModification.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ServerModification.java Wed Apr 21 22:42:40 2010
@@ -25,6 +25,7 @@ import java.io.ObjectOutput;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.entry.client.ClientModification;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -84,18 +85,14 @@ public class ServerModification implemen
try
{
- AttributeType at = null;
+ AttributeType at = modAttribute.getAttributeType();
- if ( modAttribute instanceof DefaultServerAttribute )
- {
- at = ((EntryAttribute)modAttribute).getAttributeType();
- }
- else
+ if ( at == null )
{
at = schemaManager.lookupAttributeTypeRegistry( modAttribute.getId() );
}
- attribute = new DefaultServerAttribute( at, modAttribute );
+ attribute = new DefaultClientAttribute( at, modAttribute );
}
catch ( LdapException ne )
{
@@ -286,10 +283,10 @@ public class ServerModification implemen
// Lookup for tha associated AttributeType
AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid );
- attribute = new DefaultServerAttribute( attributeType );
+ attribute = new DefaultClientAttribute( attributeType );
// Read the attribute
- ((DefaultServerAttribute)attribute).deserialize( in );
+ ((DefaultClientAttribute)attribute).deserialize( in );
}
@@ -306,13 +303,13 @@ public class ServerModification implemen
// Write the operation
out.writeInt( operation.getValue() );
- AttributeType at = ((DefaultServerAttribute)attribute).getAttributeType();
+ AttributeType at = ((DefaultClientAttribute)attribute).getAttributeType();
// Write the attribute's oid
out.writeUTF( at.getOid() );
// Write the attribute
- ((DefaultServerAttribute)attribute).serialize( out );
+ ((DefaultClientAttribute)attribute).serialize( out );
}