You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2015/09/27 00:48:51 UTC
svn commit: r1705497 [2/2] - in /directory/apacheds/trunk:
core-api/src/main/java/org/apache/directory/server/core/api/
core-api/src/main/java/org/apache/directory/server/core/api/interceptor/
core-api/src/main/java/org/apache/directory/server/core/api...
Modified: directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Sat Sep 26 22:48:49 2015
@@ -237,7 +237,8 @@ public class CollectiveAttributeIntercep
// If the modified entry contains the CollectiveAttributeSubentry, then the modification
// is accepted, no matter what
- if ( targetEntry.contains( OBJECT_CLASS_AT, SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRY_OC ) )
+ if ( targetEntry.contains( directoryService.getAtProvider().getObjectClass(),
+ SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRY_OC ) )
{
return;
}
@@ -331,7 +332,7 @@ public class CollectiveAttributeIntercep
CoreSession session = opContext.getSession();
Attribute collectiveAttributeSubentries = ( ( ClonedServerEntry ) entry ).getOriginalEntry().get(
- COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+ directoryService.getAtProvider().getCollectiveAttributeSubentries() );
/*
* If there are no collective attribute subentries referenced then we
@@ -351,7 +352,7 @@ public class CollectiveAttributeIntercep
* variance.
*/
Attribute collectiveExclusions = ( ( ClonedServerEntry ) entry ).getOriginalEntry().get(
- COLLECTIVE_EXCLUSIONS_AT );
+ directoryService.getAtProvider().getCollectiveExclusions() );
Set<AttributeType> exclusions = new HashSet<AttributeType>();
if ( collectiveExclusions != null )
Modified: directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Sat Sep 26 22:48:49 2015
@@ -103,7 +103,7 @@ public class ExceptionInterceptor extend
{
super.init( directoryService );
nexus = directoryService.getPartitionNexus();
- Value<?> attr = nexus.getRootDseValue( SUBSCHEMA_SUBENTRY_AT );
+ Value<?> attr = nexus.getRootDseValue( directoryService.getAtProvider().getSubschemaSubentry() );
subschemSubentryDn = dnFactory.create( attr.getString() );
}
@@ -167,7 +167,7 @@ public class ExceptionInterceptor extend
}
Attribute objectClass = ( ( ClonedServerEntry ) attrs ).getOriginalEntry().get(
- OBJECT_CLASS_AT );
+ directoryService.getAtProvider().getObjectClass() );
if ( objectClass.contains( SchemaConstants.ALIAS_OC ) )
{
Modified: directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java Sat Sep 26 22:48:49 2015
@@ -401,7 +401,7 @@ public class NormalizationInterceptor ex
{
LeafNode leafNode = ( LeafNode ) node;
- if ( leafNode.getAttributeType() == OBJECT_CLASS_AT )
+ if ( leafNode.getAttributeType() == directoryService.getAtProvider().getObjectClass() )
{
if ( leafNode instanceof PresenceNode )
{
Modified: directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Sat Sep 26 22:48:49 2015
@@ -128,7 +128,8 @@ public class OperationalAttributeInterce
super.init( directoryService );
// stuff for dealing with subentries (garbage for now)
- Value<?> subschemaSubentry = directoryService.getPartitionNexus().getRootDseValue( SUBSCHEMA_SUBENTRY_AT );
+ Value<?> subschemaSubentry = directoryService.getPartitionNexus().getRootDseValue(
+ directoryService.getAtProvider().getSubschemaSubentry() );
subschemaSubentryDn = dnFactory.create( subschemaSubentry.getString() );
// Create the Admin Dn
@@ -192,41 +193,42 @@ public class OperationalAttributeInterce
ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
// The EntryUUID attribute
- if ( !checkAddOperationalAttribute( isAdmin, entry, ENTRY_UUID_AT ) )
+ if ( !checkAddOperationalAttribute( isAdmin, entry, directoryService.getAtProvider().getEntryUUID() ) )
{
- entry.put( ENTRY_UUID_AT, UUID.randomUUID().toString() );
+ entry.put( directoryService.getAtProvider().getEntryUUID(), UUID.randomUUID().toString() );
}
// The EntryCSN attribute
- if ( !checkAddOperationalAttribute( isAdmin, entry, ENTRY_CSN_AT ) )
+ if ( !checkAddOperationalAttribute( isAdmin, entry, directoryService.getAtProvider().getEntryCSN() ) )
{
- entry.put( ENTRY_CSN_AT, directoryService.getCSN().toString() );
+ entry.put( directoryService.getAtProvider().getEntryCSN(), directoryService.getCSN().toString() );
}
// The CreatorsName attribute
- if ( !checkAddOperationalAttribute( isAdmin, entry, CREATORS_NAME_AT ) )
+ if ( !checkAddOperationalAttribute( isAdmin, entry, directoryService.getAtProvider().getCreatorsName() ) )
{
- entry.put( CREATORS_NAME_AT, principal );
+ entry.put( directoryService.getAtProvider().getCreatorsName(), principal );
}
// The CreateTimeStamp attribute
- if ( !checkAddOperationalAttribute( isAdmin, entry, CREATE_TIMESTAMP_AT ) )
+ if ( !checkAddOperationalAttribute( isAdmin, entry, directoryService.getAtProvider().getCreateTimestamp() ) )
{
- entry.put( CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+ entry.put( directoryService.getAtProvider().getCreateTimestamp(), DateUtils.getGeneralizedTime() );
}
// Now, check that the user does not add operational attributes
// The accessControlSubentries attribute
- checkAddOperationalAttribute( isAdmin, entry, ACCESS_CONTROL_SUBENTRIES_AT );
+ checkAddOperationalAttribute( isAdmin, entry, directoryService.getAtProvider().getAccessControlSubentries() );
// The CollectiveAttributeSubentries attribute
- checkAddOperationalAttribute( isAdmin, entry, COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+ checkAddOperationalAttribute( isAdmin, entry, directoryService.getAtProvider()
+ .getCollectiveAttributeSubentries() );
// The TriggerExecutionSubentries attribute
- checkAddOperationalAttribute( isAdmin, entry, TRIGGER_EXECUTION_SUBENTRIES_AT );
+ checkAddOperationalAttribute( isAdmin, entry, directoryService.getAtProvider().getTriggerExecutionSubentries() );
// The SubSchemaSybentry attribute
- checkAddOperationalAttribute( isAdmin, entry, SUBSCHEMA_SUBENTRY_AT );
+ checkAddOperationalAttribute( isAdmin, entry, directoryService.getAtProvider().getSubschemaSubentry() );
next( addContext );
}
@@ -278,7 +280,7 @@ public class OperationalAttributeInterce
{
AttributeType attributeType = modification.getAttribute().getAttributeType();
- if ( attributeType.equals( MODIFIERS_NAME_AT ) )
+ if ( attributeType.equals( directoryService.getAtProvider().getModifiersName() ) )
{
if ( !isAdmin )
{
@@ -292,7 +294,7 @@ public class OperationalAttributeInterce
}
}
- if ( attributeType.equals( MODIFY_TIMESTAMP_AT ) )
+ if ( attributeType.equals( directoryService.getAtProvider().getModifyTimestamp() ) )
{
if ( !isAdmin )
{
@@ -306,7 +308,7 @@ public class OperationalAttributeInterce
}
}
- if ( attributeType.equals( ENTRY_CSN_AT ) )
+ if ( attributeType.equals( directoryService.getAtProvider().getEntryCSN() ) )
{
if ( !isAdmin )
{
@@ -334,8 +336,8 @@ public class OperationalAttributeInterce
if ( !modifierAtPresent )
{
// Inject the ModifiersName AT if it's not present
- Attribute attribute = new DefaultAttribute( MODIFIERS_NAME_AT, getPrincipal( modifyContext )
- .getName() );
+ Attribute attribute = new DefaultAttribute( directoryService.getAtProvider().getModifiersName(),
+ getPrincipal( modifyContext ).getName() );
Modification modifiersName = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
attribute );
@@ -346,8 +348,8 @@ public class OperationalAttributeInterce
if ( !modifiedTimeAtPresent )
{
// Inject the ModifyTimestamp AT if it's not present
- Attribute attribute = new DefaultAttribute( MODIFY_TIMESTAMP_AT, DateUtils
- .getGeneralizedTime() );
+ Attribute attribute = new DefaultAttribute( directoryService.getAtProvider().getModifyTimestamp(),
+ DateUtils.getGeneralizedTime() );
Modification timestamp = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
@@ -357,7 +359,7 @@ public class OperationalAttributeInterce
if ( !entryCsnAtPresent )
{
String csn = directoryService.getCSN().toString();
- Attribute attribute = new DefaultAttribute( ENTRY_CSN_AT, csn );
+ Attribute attribute = new DefaultAttribute( directoryService.getAtProvider().getEntryCSN(), csn );
Modification updatedCsn = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
mods.add( updatedCsn );
}
@@ -377,7 +379,8 @@ public class OperationalAttributeInterce
modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( moveContext ).getName() );
modifiedEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
- Attribute csnAt = new DefaultAttribute( ENTRY_CSN_AT, directoryService.getCSN().toString() );
+ Attribute csnAt = new DefaultAttribute( directoryService.getAtProvider().getEntryCSN(), directoryService
+ .getCSN().toString() );
modifiedEntry.put( csnAt );
modifiedEntry.setDn( moveContext.getNewDn() );
@@ -397,7 +400,8 @@ public class OperationalAttributeInterce
modifiedEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
modifiedEntry.setDn( moveAndRenameContext.getNewDn() );
- Attribute csnAt = new DefaultAttribute( ENTRY_CSN_AT, directoryService.getCSN().toString() );
+ Attribute csnAt = new DefaultAttribute( directoryService.getAtProvider().getEntryCSN(), directoryService
+ .getCSN().toString() );
modifiedEntry.put( csnAt );
moveAndRenameContext.setModifiedEntry( modifiedEntry );
@@ -419,7 +423,8 @@ public class OperationalAttributeInterce
modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( renameContext ).getName() );
modifiedEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
- Attribute csnAt = new DefaultAttribute( ENTRY_CSN_AT, directoryService.getCSN().toString() );
+ Attribute csnAt = new DefaultAttribute( directoryService.getAtProvider().getEntryCSN(), directoryService
+ .getCSN().toString() );
modifiedEntry.put( csnAt );
renameContext.setModifiedEntry( modifiedEntry );
@@ -455,7 +460,8 @@ public class OperationalAttributeInterce
{
// insert a new CSN into the entry, this is for replication
Entry entry = deleteContext.getEntry();
- Attribute csnAt = new DefaultAttribute( ENTRY_CSN_AT, directoryService.getCSN().toString() );
+ Attribute csnAt = new DefaultAttribute( directoryService.getAtProvider().getEntryCSN(), directoryService
+ .getCSN().toString() );
entry.put( csnAt );
next( deleteContext );
Modified: directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Sat Sep 26 22:48:49 2015
@@ -136,7 +136,7 @@ public class ReferralInterceptor extends
// This will suppress PMD.EmptyCatchBlock warnings in this method
@SuppressWarnings("PMD.EmptyCatchBlock")
- private static boolean isReferral( Entry entry ) throws LdapException
+ private boolean isReferral( Entry entry ) throws LdapException
{
// Check that the entry is not null, otherwise return FALSE.
// This is typically to cover the case where the entry has not
@@ -146,7 +146,7 @@ public class ReferralInterceptor extends
return false;
}
- Attribute oc = entry.get( OBJECT_CLASS_AT );
+ Attribute oc = entry.get( directoryService.getAtProvider().getObjectClass() );
if ( oc == null )
{
@@ -211,7 +211,7 @@ public class ReferralInterceptor extends
referralManager = new ReferralManagerImpl( directoryService );
directoryService.setReferralManager( referralManager );
- Value<?> subschemaSubentry = nexus.getRootDseValue( SUBSCHEMA_SUBENTRY_AT );
+ Value<?> subschemaSubentry = nexus.getRootDseValue( directoryService.getAtProvider().getSubschemaSubentry() );
subschemaSubentryDn = dnFactory.create( subschemaSubentry.getString() );
}
Modified: directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Sat Sep 26 22:48:49 2015
@@ -176,7 +176,7 @@ public class SchemaInterceptor extends B
schemaBaseDn = dnFactory.create( SchemaConstants.OU_SCHEMA );
// stuff for dealing with subentries (garbage for now)
- Value<?> subschemaSubentry = nexus.getRootDseValue( SUBSCHEMA_SUBENTRY_AT );
+ Value<?> subschemaSubentry = nexus.getRootDseValue( directoryService.getAtProvider().getSubschemaSubentry() );
subschemaSubentryDn = dnFactory.create( subschemaSubentry.getString() );
subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();
@@ -871,9 +871,9 @@ public class SchemaInterceptor extends B
return;
}
- if ( ( !attributeType.equals( MODIFIERS_NAME_AT )
- && ( !attributeType.equals( MODIFY_TIMESTAMP_AT ) )
- && ( !attributeType.equals( ENTRY_CSN_AT ) )
+ if ( ( !attributeType.equals( directoryService.getAtProvider().getModifiersName() )
+ && ( !attributeType.equals( directoryService.getAtProvider().getModifyTimestamp() ) )
+ && ( !attributeType.equals( directoryService.getAtProvider().getEntryCSN() ) )
&& ( !PWD_POLICY_STATE_ATTRIBUTE_TYPES.contains( attributeType ) ) ) )
{
String msg = I18n.err( I18n.ERR_52, attributeType );
@@ -937,14 +937,14 @@ public class SchemaInterceptor extends B
// 3-1) Except if the extensibleObject ObjectClass is used
// 3-2) or if the AttributeType is COLLECTIVE
// 4) We also check that for H-R attributes, we have a valid String in the values
- Attribute objectClassAttr = entry.get( OBJECT_CLASS_AT );
+ Attribute objectClassAttr = entry.get( directoryService.getAtProvider().getObjectClass() );
// Protect the server against a null objectClassAttr
// It can be the case if the user forgot to add it to the entry ...
// In this case, we create an new one, empty
if ( objectClassAttr == null )
{
- objectClassAttr = new DefaultAttribute( OBJECT_CLASS_AT );
+ objectClassAttr = new DefaultAttribute( directoryService.getAtProvider().getObjectClass() );
}
List<ObjectClass> ocs = new ArrayList<ObjectClass>();
@@ -1064,7 +1064,7 @@ public class SchemaInterceptor extends B
// get the schema name
String schemaName = getSchemaName( name );
- if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.META_SCHEMA_OC ) )
+ if ( entry.contains( directoryService.getAtProvider().getObjectClass(), SchemaConstants.META_SCHEMA_OC ) )
{
next( addContext );
@@ -1074,7 +1074,8 @@ public class SchemaInterceptor extends B
computeSuperiors();
}
}
- else if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.META_OBJECT_CLASS_OC ) )
+ else if ( entry.contains( directoryService.getAtProvider().getObjectClass(),
+ SchemaConstants.META_OBJECT_CLASS_OC ) )
{
// This is an ObjectClass addition
checkOcSuperior( addContext.getEntry() );
@@ -1093,7 +1094,8 @@ public class SchemaInterceptor extends B
computeSuperior( addedOC );
}
}
- else if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.META_ATTRIBUTE_TYPE_OC ) )
+ else if ( entry.contains( directoryService.getAtProvider().getObjectClass(),
+ SchemaConstants.META_ATTRIBUTE_TYPE_OC ) )
{
// This is an AttributeType addition
next( addContext );
@@ -1184,7 +1186,9 @@ public class SchemaInterceptor extends B
{
AttributeType at = ( ( DefaultModification ) mod ).getAttribute().getAttributeType();
- if ( !MODIFIERS_NAME_AT.equals( at ) && !MODIFY_TIMESTAMP_AT.equals( at ) && !ENTRY_CSN_AT.equals( at ) )
+ if ( !directoryService.getAtProvider().getModifiersName().equals( at )
+ && !directoryService.getAtProvider().getModifyTimestamp().equals( at )
+ && !directoryService.getAtProvider().getEntryCSN().equals( at ) )
{
cleanMods.add( mod );
}
@@ -1323,7 +1327,7 @@ public class SchemaInterceptor extends B
AttributeType nodeAt = node.getAttributeType();
// see if node attribute is objectClass
- if ( nodeAt.equals( OBJECT_CLASS_AT )
+ if ( nodeAt.equals( directoryService.getAtProvider().getObjectClass() )
&& ( objectClassOid.equals( SchemaConstants.TOP_OC_OID ) || objectClassOid
.equals( SchemaConstants.SUBSCHEMA_OC_OID ) ) && ( node instanceof EqualityNode ) )
{
@@ -1382,7 +1386,7 @@ public class SchemaInterceptor extends B
{
// Never check the attributes if the extensibleObject objectClass is
// declared for this entry
- Attribute objectClass = entry.get( OBJECT_CLASS_AT );
+ Attribute objectClass = entry.get( directoryService.getAtProvider().getObjectClass() );
if ( objectClass.contains( SchemaConstants.EXTENSIBLE_OBJECT_OC ) )
{
Modified: directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java (original)
+++ directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java Sat Sep 26 22:48:49 2015
@@ -98,8 +98,6 @@ public class SchemaSubentryManager
private static final String CASCADING_ERROR =
"Cascading has not yet been implemented: standard operation is in effect.";
- private static AttributeType ENTRY_CSN_ATTRIBUTE_TYPE;
-
static
{
VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.NORMALIZERS_AT ) );
@@ -163,8 +161,6 @@ public class SchemaSubentryManager
String nameFormsOid = schemaManager.getAttributeTypeRegistry().getOidByName( SchemaConstants.NAME_FORMS_AT );
opAttr2handlerIndex.put( nameFormsOid, NAME_FORM_INDEX );
-
- ENTRY_CSN_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.ENTRY_CSN_AT );
}
@@ -276,7 +272,7 @@ public class SchemaSubentryManager
case REPLACE_ATTRIBUTE:
// a hack to allow entryCSN modification
- if ( ENTRY_CSN_ATTRIBUTE_TYPE.equals( serverAttribute.getAttributeType() ) )
+ if ( directoryService.getAtProvider().getEntryCSN().equals( serverAttribute.getAttributeType() ) )
{
break;
}
Modified: directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Sat Sep 26 22:48:49 2015
@@ -60,7 +60,6 @@ import org.apache.directory.api.ldap.mod
import org.apache.directory.api.ldap.model.subtree.SubtreeSpecification;
import org.apache.directory.api.ldap.model.subtree.SubtreeSpecificationParser;
import org.apache.directory.server.constants.ApacheSchemaConstants;
-import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
import org.apache.directory.server.core.api.InterceptorEnum;
@@ -99,10 +98,7 @@ public class SubentryInterceptor extends
/** the subentry control OID */
private static final String SUBENTRY_CONTROL = Subentries.OID;
- private static Value<String> SUBENTRY_OC;
-
- /** The set of Subentry operational attributes */
- private static AttributeType[] SUBENTRY_OPATTRS;
+ private Value<String> subentryOC;
/** The SubTree specification parser instance */
private SubtreeSpecificationParser ssParser;
@@ -147,7 +143,7 @@ public class SubentryInterceptor extends
}
// see if we can use objectclass if present
- return !entry.contains( OBJECT_CLASS_AT, SUBENTRY_OC );
+ return !entry.contains( directoryService.getAtProvider().getObjectClass(), subentryOC );
}
@@ -178,7 +174,7 @@ public class SubentryInterceptor extends
}
// see if we can use objectclass if present
- return entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC );
+ return entry.contains( directoryService.getAtProvider().getObjectClass(), SchemaConstants.SUBENTRY_OC );
}
@@ -206,27 +202,18 @@ public class SubentryInterceptor extends
nexus = directoryService.getPartitionNexus();
- SUBENTRY_OPATTRS = new AttributeType[]
- {
- ACCESS_CONTROL_SUBENTRIES_AT,
- SUBSCHEMA_SUBENTRY_AT,
- COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
- TRIGGER_EXECUTION_SUBENTRIES_AT
- };
-
ssParser = new SubtreeSpecificationParser( schemaManager );
// prepare to find all subentries in all namingContexts
Set<String> suffixes = nexus.listSuffixes();
- ExprNode filter = new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
+ ExprNode filter = new EqualityNode<String>( directoryService.getAtProvider().getObjectClass(), new StringValue(
SchemaConstants.SUBENTRY_OC ) );
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
controls.setReturningAttributes( new String[]
{ SchemaConstants.SUBTREE_SPECIFICATION_AT, SchemaConstants.OBJECT_CLASS_AT } );
- Dn adminDn = dnFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN );
- SUBENTRY_OC = new StringValue( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC );
+ subentryOC = new StringValue( directoryService.getAtProvider().getObjectClass(), SchemaConstants.SUBENTRY_OC );
// search each namingContext for subentries
for ( String suffix : suffixes )
@@ -250,7 +237,8 @@ public class SubentryInterceptor extends
Entry subentry = subentries.get();
Dn subentryDn = subentry.getDn();
- String subtree = subentry.get( SUBTREE_SPECIFICATION_AT ).getString();
+ String subtree = subentry.get( directoryService.getAtProvider().getSubtreeSpecification() )
+ .getString();
SubtreeSpecification ss;
try
@@ -300,7 +288,7 @@ public class SubentryInterceptor extends
{
Set<AdministrativeRole> adminRoles = new HashSet<AdministrativeRole>();
- Attribute oc = subentry.get( OBJECT_CLASS_AT );
+ Attribute oc = subentry.get( directoryService.getAtProvider().getObjectClass() );
if ( oc == null )
{
@@ -454,7 +442,8 @@ public class SubentryInterceptor extends
Entry administrationPoint = directoryService.getPartitionNexus().lookup( lookupContext );
// The administrativeRole AT must exist and not be null
- Attribute administrativeRole = administrationPoint.get( ADMINISTRATIVE_ROLE_AT );
+ Attribute administrativeRole = administrationPoint.get( directoryService.getAtProvider()
+ .getAdministrativeRole() );
// check that administrativeRole has something valid in it for us
if ( ( administrativeRole == null ) || ( administrativeRole.size() <= 0 ) )
@@ -470,7 +459,7 @@ public class SubentryInterceptor extends
*/
private void setSubtreeSpecification( Subentry subentry, Entry entry ) throws LdapException
{
- String subtree = entry.get( SUBTREE_SPECIFICATION_AT ).getString();
+ String subtree = entry.get( directoryService.getAtProvider().getSubtreeSpecification() ).getString();
SubtreeSpecification ss;
try
@@ -499,7 +488,7 @@ public class SubentryInterceptor extends
*/
private boolean hasAdministrativeDescendant( OperationContext opContext, Dn name ) throws LdapException
{
- ExprNode filter = new PresenceNode( ADMINISTRATIVE_ROLE_AT );
+ ExprNode filter = new PresenceNode( directoryService.getAtProvider().getAdministrativeRole() );
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
@@ -571,7 +560,8 @@ public class SubentryInterceptor extends
// need to remove references to the subentry
if ( isOldNameSelected && !isNewNameSelected )
{
- for ( AttributeType operationalAttribute : SUBENTRY_OPATTRS )
+ for ( AttributeType operationalAttribute : directoryService.getAtProvider()
+ .getSubentryOperationalAttributes() )
{
ModificationOperation op = ModificationOperation.REPLACE_ATTRIBUTE;
Attribute opAttr = entry.get( operationalAttribute );
@@ -593,7 +583,8 @@ public class SubentryInterceptor extends
// need to add references to the subentry
else if ( isNewNameSelected && !isOldNameSelected )
{
- for ( AttributeType operationalAttribute : SUBENTRY_OPATTRS )
+ for ( AttributeType operationalAttribute : directoryService.getAtProvider()
+ .getSubentryOperationalAttributes() )
{
ModificationOperation op = ModificationOperation.ADD_ATTRIBUTE;
Attribute opAttr = new DefaultAttribute( operationalAttribute );
@@ -613,7 +604,7 @@ public class SubentryInterceptor extends
private Set<AdministrativeRole> getSubentryTypes( Entry entry, List<Modification> mods ) throws LdapException
{
- Attribute ocFinalState = entry.get( OBJECT_CLASS_AT ).clone();
+ Attribute ocFinalState = entry.get( directoryService.getAtProvider().getObjectClass() ).clone();
for ( Modification mod : mods )
{
@@ -692,14 +683,14 @@ public class SubentryInterceptor extends
{
List<Modification> modifications = new ArrayList<Modification>();
- getOperationalModForReplace( subentry.isAccessControlAdminRole(), ACCESS_CONTROL_SUBENTRIES_AT, entry, oldDn,
- newDn, modifications );
- getOperationalModForReplace( subentry.isSchemaAdminRole(), SUBSCHEMA_SUBENTRY_AT, entry, oldDn, newDn,
- modifications );
- getOperationalModForReplace( subentry.isCollectiveAdminRole(), COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT, entry,
- oldDn, newDn, modifications );
- getOperationalModForReplace( subentry.isTriggersAdminRole(), TRIGGER_EXECUTION_SUBENTRIES_AT, entry, oldDn,
- newDn, modifications );
+ getOperationalModForReplace( subentry.isAccessControlAdminRole(), directoryService.getAtProvider()
+ .getAccessControlSubentries(), entry, oldDn, newDn, modifications );
+ getOperationalModForReplace( subentry.isSchemaAdminRole(), directoryService.getAtProvider()
+ .getSubschemaSubentry(), entry, oldDn, newDn, modifications );
+ getOperationalModForReplace( subentry.isCollectiveAdminRole(), directoryService.getAtProvider()
+ .getCollectiveAttributeSubentries(), entry, oldDn, newDn, modifications );
+ getOperationalModForReplace( subentry.isTriggersAdminRole(), directoryService.getAtProvider()
+ .getTriggerExecutionSubentries(), entry, oldDn, newDn, modifications );
return modifications;
}
@@ -715,27 +706,29 @@ public class SubentryInterceptor extends
if ( subentry.isAccessControlAdminRole() )
{
- Attribute accessControlSubentries = new DefaultAttribute( ACCESS_CONTROL_SUBENTRIES_AT, dn.getNormName() );
+ Attribute accessControlSubentries = new DefaultAttribute( directoryService.getAtProvider()
+ .getAccessControlSubentries(), dn.getNormName() );
attributes.add( accessControlSubentries );
}
if ( subentry.isSchemaAdminRole() )
{
- Attribute subschemaSubentry = new DefaultAttribute( SUBSCHEMA_SUBENTRY_AT, dn.getNormName() );
+ Attribute subschemaSubentry = new DefaultAttribute(
+ directoryService.getAtProvider().getSubschemaSubentry(), dn.getNormName() );
attributes.add( subschemaSubentry );
}
if ( subentry.isCollectiveAdminRole() )
{
- Attribute collectiveAttributeSubentries = new DefaultAttribute( COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
- dn.getNormName() );
+ Attribute collectiveAttributeSubentries = new DefaultAttribute( directoryService.getAtProvider()
+ .getCollectiveAttributeSubentries(), dn.getNormName() );
attributes.add( collectiveAttributeSubentries );
}
if ( subentry.isTriggersAdminRole() )
{
- Attribute tiggerExecutionSubentries = new DefaultAttribute( TRIGGER_EXECUTION_SUBENTRIES_AT,
- dn.getNormName() );
+ Attribute tiggerExecutionSubentries = new DefaultAttribute( directoryService.getAtProvider()
+ .getTriggerExecutionSubentries(), dn.getNormName() );
attributes.add( tiggerExecutionSubentries );
}
@@ -761,7 +754,7 @@ public class SubentryInterceptor extends
List<Modification> modifications = new ArrayList<Modification>();
String dn = subentryDn.getNormName();
- for ( AttributeType operationalAttribute : SUBENTRY_OPATTRS )
+ for ( AttributeType operationalAttribute : directoryService.getAtProvider().getSubentryOperationalAttributes() )
{
Attribute opAttr = candidate.get( operationalAttribute );
@@ -841,7 +834,8 @@ public class SubentryInterceptor extends
// need to remove references to the subentry
if ( isOldEntrySelected && !isNewEntrySelected )
{
- for ( AttributeType operationalAttribute : SUBENTRY_OPATTRS )
+ for ( AttributeType operationalAttribute : directoryService.getAtProvider()
+ .getSubentryOperationalAttributes() )
{
ModificationOperation op = ModificationOperation.REPLACE_ATTRIBUTE;
Attribute opAttr = oldEntry.get( operationalAttribute );
@@ -863,7 +857,8 @@ public class SubentryInterceptor extends
// need to add references to the subentry
else if ( isNewEntrySelected && !isOldEntrySelected )
{
- for ( AttributeType operationalAttribute : SUBENTRY_OPATTRS )
+ for ( AttributeType operationalAttribute : directoryService.getAtProvider()
+ .getSubentryOperationalAttributes() )
{
ModificationOperation op = ModificationOperation.ADD_ATTRIBUTE;
Attribute opAttr = new DefaultAttribute( operationalAttribute );
@@ -906,7 +901,7 @@ public class SubentryInterceptor extends
Entry entry = addContext.getEntry();
// Check if the added entry is a subentry
- if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
+ if ( entry.contains( directoryService.getAtProvider().getObjectClass(), SchemaConstants.SUBENTRY_OC ) )
{
// get the name of the administrative point and its administrativeRole attributes
// The AP must be the parent Dn, but we also have to check that the given Dn
@@ -990,22 +985,26 @@ public class SubentryInterceptor extends
if ( subentry.isAccessControlAdminRole() )
{
- setOperationalAttribute( entry, subentryDn, ACCESS_CONTROL_SUBENTRIES_AT );
+ setOperationalAttribute( entry, subentryDn, directoryService.getAtProvider()
+ .getAccessControlSubentries() );
}
if ( subentry.isSchemaAdminRole() )
{
- setOperationalAttribute( entry, subentryDn, SUBSCHEMA_SUBENTRY_AT );
+ setOperationalAttribute( entry, subentryDn, directoryService.getAtProvider()
+ .getSubschemaSubentry() );
}
if ( subentry.isCollectiveAdminRole() )
{
- setOperationalAttribute( entry, subentryDn, COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+ setOperationalAttribute( entry, subentryDn, directoryService.getAtProvider()
+ .getCollectiveAttributeSubentries() );
}
if ( subentry.isTriggersAdminRole() )
{
- setOperationalAttribute( entry, subentryDn, TRIGGER_EXECUTION_SUBENTRIES_AT );
+ setOperationalAttribute( entry, subentryDn, directoryService.getAtProvider()
+ .getTriggerExecutionSubentries() );
}
}
}
@@ -1031,7 +1030,7 @@ public class SubentryInterceptor extends
// If the entry has a "subentry" Objectclass, we can process the entry.
// We first remove the re
- if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
+ if ( entry.contains( directoryService.getAtProvider().getObjectClass(), SchemaConstants.SUBENTRY_OC ) )
{
Subentry removedSubentry = directoryService.getSubentryCache().getSubentry( dn );
@@ -1088,7 +1087,8 @@ public class SubentryInterceptor extends
// Find the subtreeSpecification
for ( Modification mod : modifications )
{
- if ( mod.getAttribute().getAttributeType().equals( SUBTREE_SPECIFICATION_AT ) )
+ if ( mod.getAttribute().getAttributeType()
+ .equals( directoryService.getAtProvider().getSubtreeSpecification() ) )
{
isSubtreeSpecificationModification = true;
subtreeMod = mod;
@@ -1096,7 +1096,8 @@ public class SubentryInterceptor extends
}
}
- boolean containsSubentryOC = entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC );
+ boolean containsSubentryOC = entry.contains( directoryService.getAtProvider().getObjectClass(),
+ SchemaConstants.SUBENTRY_OC );
// Check if we have a modified subentry attribute in a Subentry entry
if ( containsSubentryOC && isSubtreeSpecificationModification )
@@ -1127,7 +1128,7 @@ public class SubentryInterceptor extends
Dn oldBaseDn = apName;
oldBaseDn = oldBaseDn.add( ssOld.getBase() );
- ExprNode filter = new PresenceNode( OBJECT_CLASS_AT );
+ ExprNode filter = new PresenceNode( directoryService.getAtProvider().getObjectClass() );
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
controls.setReturningAttributes( new String[]
@@ -1268,7 +1269,7 @@ public class SubentryInterceptor extends
Entry entry = moveContext.getOriginalEntry();
- if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
+ if ( entry.contains( directoryService.getAtProvider().getObjectClass(), SchemaConstants.SUBENTRY_OC ) )
{
// This is a subentry. Moving a subentry means we have to:
// o Check that there is a new AP where we move the subentry
@@ -1294,7 +1295,7 @@ public class SubentryInterceptor extends
subentry = directoryService.getSubentryCache().getSubentry( newName );
- ExprNode filter = new PresenceNode( OBJECT_CLASS_AT );
+ ExprNode filter = new PresenceNode( directoryService.getAtProvider().getObjectClass() );
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
controls.setReturningAttributes( new String[]
@@ -1382,7 +1383,7 @@ public class SubentryInterceptor extends
Entry entry = moveAndRenameContext.getOriginalEntry();
- if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
+ if ( entry.contains( directoryService.getAtProvider().getObjectClass(), SchemaConstants.SUBENTRY_OC ) )
{
Subentry subentry = directoryService.getSubentryCache().removeSubentry( oldDn );
SubtreeSpecification ss = subentry.getSubtreeSpecification();
@@ -1400,7 +1401,7 @@ public class SubentryInterceptor extends
subentry = directoryService.getSubentryCache().getSubentry( newName );
- ExprNode filter = new PresenceNode( OBJECT_CLASS_AT );
+ ExprNode filter = new PresenceNode( directoryService.getAtProvider().getObjectClass() );
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
controls.setReturningAttributes( new String[]
@@ -1478,7 +1479,7 @@ public class SubentryInterceptor extends
Entry entry = ( ( ClonedServerEntry ) renameContext.getEntry() ).getClonedEntry();
- if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
+ if ( entry.contains( directoryService.getAtProvider().getObjectClass(), SchemaConstants.SUBENTRY_OC ) )
{
// @Todo To be reviewed !!!
Subentry subentry = directoryService.getSubentryCache().removeSubentry( oldDn );
@@ -1495,7 +1496,7 @@ public class SubentryInterceptor extends
next( renameContext );
subentry = directoryService.getSubentryCache().getSubentry( newName );
- ExprNode filter = new PresenceNode( OBJECT_CLASS_AT );
+ ExprNode filter = new PresenceNode( directoryService.getAtProvider().getObjectClass() );
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
controls.setReturningAttributes( new String[]
Modified: directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java Sat Sep 26 22:48:49 2015
@@ -134,7 +134,7 @@ public class TriggerInterceptor extends
* to be in the same naming context as their access point so the subentries
* effecting their parent entry applies to them as well.
*/
- if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
+ if ( entry.contains( directoryService.getAtProvider().getObjectClass(), SchemaConstants.SUBENTRY_OC ) )
{
Dn parentDn = dn.getParent();
Modified: directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java (original)
+++ directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java Sat Sep 26 22:48:49 2015
@@ -146,7 +146,7 @@ public final class LdapApiIntegrationUti
{
config.setLdapHost( InetAddress.getLocalHost().getHostName() );
}
- catch( UnknownHostException uhe )
+ catch ( UnknownHostException uhe )
{
config.setLdapHost( DEFAULT_HOST );
}
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java Sat Sep 26 22:48:49 2015
@@ -99,12 +99,6 @@ public class SearchRequestHandler extend
/** Speedup for logs */
private static final boolean IS_DEBUG = LOG.isDebugEnabled();
- /** cached to save redundant lookups into registries */
- private AttributeType OBJECT_CLASS_AT;
-
- /** cached to save redundant lookups into registries */
- private AttributeType SUBSCHEMA_SUBENTRY_AT;
-
/** The replication handler */
protected ReplicationRequestHandler replicationReqHandler;
@@ -119,14 +113,10 @@ public class SearchRequestHandler extend
*/
private EqualityNode<String> newIsReferralEqualityNode( LdapSession session ) throws Exception
{
- if ( OBJECT_CLASS_AT == null )
- {
- OBJECT_CLASS_AT = session.getCoreSession().getDirectoryService().getSchemaManager().getAttributeType(
- SchemaConstants.OBJECT_CLASS_AT );
- }
+ AttributeType objectClassAT = session.getCoreSession().getDirectoryService().getAtProvider().getObjectClass();
- EqualityNode<String> ocIsReferral = new EqualityNode<String>( OBJECT_CLASS_AT,
- new org.apache.directory.api.ldap.model.entry.StringValue( OBJECT_CLASS_AT, SchemaConstants.REFERRAL_OC ) );
+ EqualityNode<String> ocIsReferral = new EqualityNode<String>( objectClassAT,
+ new org.apache.directory.api.ldap.model.entry.StringValue( objectClassAT, SchemaConstants.REFERRAL_OC ) );
return ocIsReferral;
}
@@ -999,7 +989,8 @@ public class SearchRequestHandler extend
{
AttributeType attributeType = presenceNode.getAttributeType();
- if ( attributeType.equals( OBJECT_CLASS_AT ) )
+ AttributeType objectClassAT = session.getCoreSession().getDirectoryService().getAtProvider().getObjectClass();
+ if ( attributeType.equals( objectClassAT ) )
{
return;
}
@@ -1046,7 +1037,8 @@ public class SearchRequestHandler extend
if ( filter.isSchemaAware() )
{
AttributeType attributeType = ( ( PresenceNode ) req.getFilter() ).getAttributeType();
- isObjectClassFilter = attributeType.equals( OBJECT_CLASS_AT );
+ isObjectClassFilter = attributeType.equals( session.getCoreSession().getDirectoryService()
+ .getAtProvider().getObjectClass() );
}
else
{
@@ -1459,13 +1451,7 @@ public class SearchRequestHandler extend
DirectoryService ds = session.getCoreSession().getDirectoryService();
PartitionNexus nexus = ds.getPartitionNexus();
- if ( SUBSCHEMA_SUBENTRY_AT == null )
- {
- SUBSCHEMA_SUBENTRY_AT = session.getCoreSession().getDirectoryService().getSchemaManager().getAttributeType(
- SchemaConstants.SUBSCHEMA_SUBENTRY_AT );
- }
-
- Value<?> subschemaSubentry = nexus.getRootDseValue( SUBSCHEMA_SUBENTRY_AT );
+ Value<?> subschemaSubentry = nexus.getRootDseValue( ds.getAtProvider().getSubschemaSubentry() );
Dn subschemaSubentryDn = ds.getDnFactory().create( subschemaSubentry.getString() );
String subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java Sat Sep 26 22:48:49 2015
@@ -155,9 +155,8 @@ public class ReplicationConsumerImpl imp
private Modification ridMod;
/** AttributeTypes used for replication */
- private static AttributeType REPL_COOKIE_AT;
- private static AttributeType ENTRY_UUID_AT;
- private static AttributeType RID_AT_TYPE;
+ private AttributeType adsReplCookieAT;
+ private AttributeType adsDsReplicaIdAT;
private static final Map<String, Object> UUID_LOCK_MAP = new LRUMap( 1000 );
@@ -183,14 +182,13 @@ public class ReplicationConsumerImpl imp
schemaManager = directoryservice.getSchemaManager();
- ENTRY_UUID_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_UUID_AT );
- REPL_COOKIE_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ADS_REPL_COOKIE );
- RID_AT_TYPE = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ADS_DS_REPLICA_ID );
+ adsReplCookieAT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ADS_REPL_COOKIE );
+ adsDsReplicaIdAT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ADS_DS_REPLICA_ID );
- Attribute cookieAttr = new DefaultAttribute( REPL_COOKIE_AT );
+ Attribute cookieAttr = new DefaultAttribute( adsReplCookieAT );
cookieMod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, cookieAttr );
- Attribute ridAttr = new DefaultAttribute( RID_AT_TYPE );
+ Attribute ridAttr = new DefaultAttribute( adsDsReplicaIdAT );
ridMod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, ridAttr );
prepareSyncSearchRequest();
@@ -349,7 +347,7 @@ public class ReplicationConsumerImpl imp
try
{
Entry remoteEntry = new DefaultEntry( schemaManager, syncResult.getEntry() );
- String uuid = remoteEntry.get( ENTRY_UUID_AT ).getString();
+ String uuid = remoteEntry.get( directoryService.getAtProvider().getEntryUUID() ).getString();
// lock on UUID to serialize the updates when there are multiple consumers
// connected to several producers and to the *same* base/partition
Object lock = getLockFor( uuid );
@@ -954,7 +952,7 @@ public class ReplicationConsumerImpl imp
if ( entry != null )
{
- Attribute attr = entry.get( REPL_COOKIE_AT );
+ Attribute attr = entry.get( adsReplCookieAT );
if ( attr != null )
{
@@ -992,7 +990,7 @@ public class ReplicationConsumerImpl imp
{
try
{
- Attribute cookieAttr = new DefaultAttribute( REPL_COOKIE_AT );
+ Attribute cookieAttr = new DefaultAttribute( adsReplCookieAT );
Modification deleteCookieMod = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
cookieAttr );
session.modify( config.getConfigEntryDn(), deleteCookieMod );
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java Sat Sep 26 22:48:49 2015
@@ -86,11 +86,8 @@ public class ReplConsumerManager
/** The consumers' ou value */
private static final String CONSUMERS = "consumers";
- /** An ObjectClass AT instance */
- private static AttributeType OBJECT_CLASS_AT;
-
/** An AdsReplLastSentCsn AT instance */
- private static AttributeType ADS_REPL_LAST_SENT_CSN_AT;
+ private AttributeType adsReplLastSentCsn;
/** A map containing the last sent CSN for every connected consumer */
private Map<Integer, Modification> modMap = new ConcurrentHashMap<Integer, Modification>();
@@ -108,8 +105,7 @@ public class ReplConsumerManager
adminSession = directoryService.getAdminSession();
schemaManager = directoryService.getSchemaManager();
replConsumerDn = directoryService.getDnFactory().create( REPL_CONSUMER_DN_STR );
- OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
- ADS_REPL_LAST_SENT_CSN_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ADS_REPL_LAST_SENT_CSN );
+ adsReplLastSentCsn = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ADS_REPL_LAST_SENT_CSN );
PROVIDER_LOG.debug( "Starting the replication consumer manager" );
createConsumersBranch();
@@ -235,7 +231,7 @@ public class ReplConsumerManager
if ( mod == null )
{
- mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, ADS_REPL_LAST_SENT_CSN_AT,
+ mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, adsReplLastSentCsn,
replica.getLastSentCsn() );
modMap.put( replica.getId(), mod );
@@ -267,7 +263,7 @@ public class ReplConsumerManager
List<ReplicaEventLog> replicas = new ArrayList<ReplicaEventLog>();
// Search for all the consumers
- ExprNode filter = new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
+ ExprNode filter = new EqualityNode<String>( directoryService.getAtProvider().getObjectClass(), new StringValue(
SchemaConstants.ADS_REPL_EVENT_LOG ) );
SearchRequest searchRequest = new SearchRequestImpl();
searchRequest.setBase( replConsumerDn );
Modified: directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/listener/ConfigChangeListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/listener/ConfigChangeListener.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/listener/ConfigChangeListener.java (original)
+++ directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/listener/ConfigChangeListener.java Sat Sep 26 22:48:49 2015
@@ -23,7 +23,6 @@ package org.apache.directory.server.conf
import static org.apache.directory.server.core.api.InterceptorEnum.AUTHENTICATION_INTERCEPTOR;
-import org.apache.directory.api.ldap.model.constants.SchemaConstants;
import org.apache.directory.api.ldap.model.entry.Attribute;
import org.apache.directory.api.ldap.model.entry.DefaultAttribute;
import org.apache.directory.api.ldap.model.entry.Entry;
@@ -70,7 +69,7 @@ public class ConfigChangeListener extend
private static final String PPOLICY_OC_NAME = "ads-passwordPolicy";
// attribute holding the value of #PPOLICY_OC_NAME
- private Attribute AT_PWDPOLICY;
+ private Attribute passwordPolicyObjectClassAttribute;
/** The logger for this class */
@@ -100,8 +99,8 @@ public class ConfigChangeListener extend
.getInterceptor( AUTHENTICATION_INTERCEPTOR.getName() );
ppolicyConfigContainer = authInterceptor.getPwdPolicyContainer();
- AttributeType ocType = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
- AT_PWDPOLICY = new DefaultAttribute( ocType, PPOLICY_OC_NAME );
+ AttributeType ocType = directoryService.getAtProvider().getObjectClass();
+ passwordPolicyObjectClassAttribute = new DefaultAttribute( ocType, PPOLICY_OC_NAME );
}
@@ -144,7 +143,7 @@ public class ConfigChangeListener extend
return;
}
- if ( !entry.contains( AT_PWDPOLICY ) )
+ if ( !entry.contains( passwordPolicyObjectClassAttribute ) )
{
return;
}
Added: directory/apacheds/trunk/service/src/checkstyle/suppressions.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/checkstyle/suppressions.xml?rev=1705497&view=auto
==============================================================================
--- directory/apacheds/trunk/service/src/checkstyle/suppressions.xml (added)
+++ directory/apacheds/trunk/service/src/checkstyle/suppressions.xml Sat Sep 26 22:48:49 2015
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!DOCTYPE suppressions PUBLIC
+ "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+ "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+
+<suppressions>
+ <!-- Large files -->
+ <suppress files="org.apache.directory.server.UberjarMain" checks="EmptyBlock"/>
+</suppressions>
Propchange: directory/apacheds/trunk/service/src/checkstyle/suppressions.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/apacheds/trunk/service/src/checkstyle/suppressions.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java (original)
+++ directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java Sat Sep 26 22:48:49 2015
@@ -135,7 +135,7 @@ public class ApacheDsService
private GeneralizedTimeSyntaxChecker timeChecker = new GeneralizedTimeSyntaxChecker();
private static final Map<String, AttributeTypeOptions> MANDATORY_ENTRY_ATOP_MAP = new HashMap<String, AttributeTypeOptions>();
- private static String[] MANDATORY_ENTRY_ATOP_AT;
+ private static final String[] MANDATORY_ENTRY_ATOP_AT = new String[5];
private boolean isSchemaPartitionFirstExtraction = false;
@@ -317,23 +317,21 @@ public class ApacheDsService
directoryService.startup();
- AttributeType ocAt = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
+ AttributeType ocAt = directoryService.getAtProvider().getObjectClass();
MANDATORY_ENTRY_ATOP_MAP.put( ocAt.getName(), new AttributeTypeOptions( ocAt ) );
- AttributeType uuidAt = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_UUID_AT );
+ AttributeType uuidAt = directoryService.getAtProvider().getEntryUUID();
MANDATORY_ENTRY_ATOP_MAP.put( uuidAt.getName(), new AttributeTypeOptions( uuidAt ) );
- AttributeType csnAt = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_CSN_AT );
+ AttributeType csnAt = directoryService.getAtProvider().getEntryCSN();
MANDATORY_ENTRY_ATOP_MAP.put( csnAt.getName(), new AttributeTypeOptions( csnAt ) );
- AttributeType creatorAt = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.CREATORS_NAME_AT );
+ AttributeType creatorAt = directoryService.getAtProvider().getCreatorsName();
MANDATORY_ENTRY_ATOP_MAP.put( creatorAt.getName(), new AttributeTypeOptions( creatorAt ) );
- AttributeType createdTimeAt = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.CREATE_TIMESTAMP_AT );
+ AttributeType createdTimeAt = directoryService.getAtProvider().getCreateTimestamp();
MANDATORY_ENTRY_ATOP_MAP.put( createdTimeAt.getName(), new AttributeTypeOptions( createdTimeAt ) );
- MANDATORY_ENTRY_ATOP_AT = new String[MANDATORY_ENTRY_ATOP_MAP.size()];
-
int pos = 0;
for ( AttributeTypeOptions attributeTypeOptions : MANDATORY_ENTRY_ATOP_MAP.values() )
Modified: directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java?rev=1705497&r1=1705496&r2=1705497&view=diff
==============================================================================
--- directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java (original)
+++ directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java Sat Sep 26 22:48:49 2015
@@ -181,7 +181,7 @@ public class UberjarMain
public void run()
{
// bind to localhost only to prevent connections from outside the box
- try ( ServerSocket shutdownSocket = new ServerSocket( shutdownPort, 1, InetAddress.getLocalHost()) )
+ try ( ServerSocket shutdownSocket = new ServerSocket( shutdownPort, 1, InetAddress.getLocalHost() ) )
{
writeShutdownPort( layout, shutdownSocket.getLocalPort() );
@@ -202,7 +202,10 @@ public class UberjarMain
InputStreamReader reader = new InputStreamReader( socket.getInputStream() );
CharBuffer buffer = CharBuffer.allocate( 2048 );
- while ( reader.read( buffer ) >= 0 );
+ while ( reader.read( buffer ) >= 0 )
+ {
+ // read till end of stream
+ }
buffer.flip();
String password = buffer.toString();