Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0D78AC839 for ; Tue, 15 May 2012 10:40:35 +0000 (UTC) Received: (qmail 84494 invoked by uid 500); 15 May 2012 10:40:34 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 84370 invoked by uid 500); 15 May 2012 10:40:31 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 84344 invoked by uid 99); 15 May 2012 10:40:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 May 2012 10:40:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 May 2012 10:40:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D09042388978 for ; Tue, 15 May 2012 10:40:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1338634 - in /directory/apacheds/branches/apacheds-osgi/hub: api/src/main/java/org/apache/directory/server/hub/api/component/ api/src/main/java/org/apache/directory/server/hub/api/meta/ connectors/ipojo/core/src/main/java/org/apache/direct... Date: Tue, 15 May 2012 10:39:59 -0000 To: commits@directory.apache.org From: gokturk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120515104000.D09042388978@eris.apache.org> Author: gokturk Date: Tue May 15 10:39:57 2012 New Revision: 1338634 URL: http://svn.apache.org/viewvc?rev=1338634&view=rev Log: * Property context information is removed in configuration store, it is much more meaningfull to assign it in runtime based on component's current version. * Constants are deleted from metadata property and had their own container. * IPojo connector/handler implementation is updated to comply with those changes Modified: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCConfiguration.java directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponentConstants.java directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCMetadataDescriptor.java directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyDescription.java directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyType.java directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DCMetadataBuilder.java directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/AbstractDCHandler.java directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryComponentHandler.java directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryInterceptorHandler.java directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryPartitionHandler.java directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryServerHandler.java directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/property/DirectoryPropertyDescription.java directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/connector/collection/CollectionMetaDescriptorGenerator.java directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/meta/DCMetadataNormalizer.java directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/ApacheDSConfigStore.java directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreSchemaConstants.java directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreSchemaManager.java Modified: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCConfiguration.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCConfiguration.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCConfiguration.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCConfiguration.java Tue May 15 10:39:57 2012 @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Hashtable; import java.util.Iterator; import java.util.List; -import java.util.Properties; public class DCConfiguration implements Iterable @@ -34,7 +33,7 @@ public class DCConfiguration implements private Hashtable propertyMap; private Integer collectionIndex = null; - private Properties constantProperties = new Properties(); + private Hashtable constantProperties = new Hashtable(); public DCConfiguration( List properties ) @@ -105,13 +104,13 @@ public class DCConfiguration implements } - public void addConstant( String name, Object value ) + public void addConstant( String name, String value ) { constantProperties.put( name, value ); } - public Object getConstantProperty( String name ) + public String getConstantProperty( String name ) { return constantProperties.get( name ); } Modified: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponentConstants.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponentConstants.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponentConstants.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponentConstants.java Tue May 15 10:39:57 2012 @@ -20,9 +20,11 @@ package org.apache.directory.server.hub.api.component; + import org.apache.directory.server.hub.api.meta.DCPropertyDescription; import org.apache.directory.server.hub.api.meta.DCPropertyType; + public class DirectoryComponentConstants { public static final String DC_PROP_INNER_RECONF_NAME = "ads-inner-reconfiguration"; @@ -33,11 +35,11 @@ public class DirectoryComponentConstants public static final String DC_COLL_OC_LIST = "ads-collection-list"; public static final String DC_COLL_OC_SET = "ads-collection-set"; public static final String DC_COLL_OC_ARRAY = "ads-collection-array"; - + public static final String DC_LIST_PROP_TYPE = "ads-list-containing"; public static final String DC_SET_PROP_TYPE = "ads-set-containing"; public static final String DC_ARRAY_PROP_TYPE = "ads-array-containing"; - + public static DCPropertyDescription itemDescription = new DCPropertyDescription( DCPropertyType.REFERENCE, "item", - "", "null", "", false, "" ); + "", "null", "", false, false, "" ); } Modified: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCMetadataDescriptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCMetadataDescriptor.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCMetadataDescriptor.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCMetadataDescriptor.java Tue May 15 10:39:57 2012 @@ -40,6 +40,8 @@ public class DCMetadataDescriptor private Hashtable propertyMap; + private Hashtable constants; + private boolean factory; @@ -50,6 +52,7 @@ public class DCMetadataDescriptor String className, String[] implemented, String[] extended, + Hashtable constants, DCPropertyDescription[] properties ) { this.metadataPID = metadataPID; @@ -58,6 +61,7 @@ public class DCMetadataDescriptor this.className = className; this.implemented = implemented; this.extended = extended; + this.constants = constants; this.properties = properties; propertyMap = new Hashtable(); @@ -179,4 +183,10 @@ public class DCMetadataDescriptor return false; } + + public Hashtable getConstants() + { + return constants; + } + } Modified: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyDescription.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyDescription.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyDescription.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyDescription.java Tue May 15 10:39:57 2012 @@ -21,8 +21,6 @@ package org.apache.directory.server.hub.api.meta; - - public class DCPropertyDescription { private DCPropertyType propertyContext; @@ -31,19 +29,19 @@ public class DCPropertyDescription private String defaultValue; private String description; private boolean mandatory; + private boolean immutable; private String containerFor; public DCPropertyDescription( String name, String type, String defaultValue, String description, boolean mandatory, - String containerFor ) + boolean immutable, String containerFor ) { - this( null, name, type, defaultValue, description, mandatory, containerFor ); + this( null, name, type, defaultValue, description, mandatory, immutable, containerFor ); } public DCPropertyDescription( DCPropertyType propertyContext, String name, String type, String defaultValue, - String description, boolean mandatory, - String containerFor ) + String description, boolean mandatory, boolean immutable, String containerFor ) { this.propertyContext = propertyContext; this.name = name; @@ -51,6 +49,7 @@ public class DCPropertyDescription this.defaultValue = defaultValue; this.description = description; this.mandatory = mandatory; + this.immutable = immutable; this.containerFor = containerFor; } Modified: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyType.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyType.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyType.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyType.java Tue May 15 10:39:57 2012 @@ -27,6 +27,5 @@ public enum DCPropertyType REFERENCE, PRIMITIVE_COLLECTION, COLLECTION, - INJECTION, - CONSTANT + INJECTION } Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DCMetadataBuilder.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DCMetadataBuilder.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DCMetadataBuilder.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DCMetadataBuilder.java Tue May 15 10:39:57 2012 @@ -23,21 +23,18 @@ package org.apache.directory.server.hub. import java.lang.reflect.Array; import java.util.ArrayList; +import java.util.Hashtable; import java.util.List; - import org.apache.directory.server.component.handler.ipojo.property.DirectoryPropertyDescription; import org.apache.directory.server.hub.api.component.util.ComponentConstants; import org.apache.directory.server.hub.api.meta.DCMetadataDescriptor; import org.apache.directory.server.hub.api.meta.DCPropertyDescription; -import org.apache.directory.server.hub.api.meta.DCPropertyType; import org.apache.felix.ipojo.ComponentFactory; import org.apache.felix.ipojo.architecture.ComponentTypeDescription; import org.apache.felix.ipojo.architecture.PropertyDescription; import org.apache.felix.ipojo.metadata.Element; import org.osgi.framework.Version; -import com.sun.org.apache.bcel.internal.generic.CPInstruction; - public class DCMetadataBuilder { @@ -48,11 +45,15 @@ public class DCMetadataBuilder List properties = new ArrayList(); + Hashtable constants = new Hashtable(); + for ( PropertyDescription property : factory.getComponentDescription().getProperties() ) { String name = property.getName(); String defaultValue = property.getValue(); boolean mandatory = property.isMandatory(); + boolean immutable = property.isImmutable(); + boolean constant = false; String type = normalizeType( property.getType() ); String description = ""; String containerFor = ""; @@ -67,17 +68,17 @@ public class DCMetadataBuilder { description = dpd.getDesc(); containerFor = normalizeType( dpd.getContainerType() ); + constant = dpd.isConstant(); } - if ( property.isImmutable() ) + if ( constant ) { - properties.add( new DCPropertyDescription( DCPropertyType.CONSTANT, name, type, - defaultValue, description, mandatory, containerFor ) ); + constants.put( name, defaultValue ); } else { properties.add( new DCPropertyDescription( name, type, - defaultValue, description, mandatory, containerFor ) ); + defaultValue, description, mandatory, immutable, containerFor ) ); } } @@ -95,7 +96,7 @@ public class DCMetadataBuilder String[] extended = parseArray( sclasses ); DCMetadataDescriptor metadata = new DCMetadataDescriptor( metadataPID, true, metaVersion, className, - implemented, extended, properties.toArray( new DCPropertyDescription[0] ) ); + implemented, extended, constants, properties.toArray( new DCPropertyDescription[0] ) ); return metadata; } Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/AbstractDCHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/AbstractDCHandler.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/AbstractDCHandler.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/AbstractDCHandler.java Tue May 15 10:39:57 2012 @@ -24,6 +24,7 @@ package org.apache.directory.server.comp import java.util.ArrayList; import java.util.Dictionary; import java.util.Enumeration; +import java.util.Hashtable; import java.util.List; import java.util.Properties; @@ -206,18 +207,15 @@ public abstract class AbstractDCHandler desc.addProperty( pd ); } - desc.addProperty( new PropertyDescription( ComponentConstants.DC_NATURE_INDICATOR, "string", "true", true ) ); + desc.addProperty( new DirectoryPropertyDescription( true, ComponentConstants.DC_NATURE_INDICATOR, "true" ) ); - Properties constantProperties = extractConstantProperties( metadata ); + Hashtable constantProperties = extractConstantProperties( metadata ); if ( constantProperties != null ) { - for ( Object key : constantProperties.keySet() ) + for ( String key : constantProperties.keySet() ) { - String propName = ( String ) key; - Object object = constantProperties.get( key ); - - DirectoryPropertyDescription pd = new DirectoryPropertyDescription( propName, String.class.getName(), - object.toString(), "", "", true ); + DirectoryPropertyDescription pd = new DirectoryPropertyDescription( true, key, + constantProperties.get( key ) ); desc.addProperty( pd ); } @@ -672,5 +670,5 @@ public abstract class AbstractDCHandler protected abstract String getHandlerNamespaceName(); - protected abstract Properties extractConstantProperties( Element ipojoMetadata ); + protected abstract Hashtable extractConstantProperties( Element ipojoMetadata ); } Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryComponentHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryComponentHandler.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryComponentHandler.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryComponentHandler.java Tue May 15 10:39:57 2012 @@ -21,6 +21,7 @@ package org.apache.directory.server.component.handler.ipojo; +import java.util.Hashtable; import java.util.Properties; import org.apache.felix.ipojo.annotations.Handler; @@ -45,7 +46,7 @@ public class DirectoryComponentHandler e @Override - protected Properties extractConstantProperties( Element ipojoMetadata ) + protected Hashtable extractConstantProperties( Element ipojoMetadata ) { return null; } Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryInterceptorHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryInterceptorHandler.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryInterceptorHandler.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryInterceptorHandler.java Tue May 15 10:39:57 2012 @@ -21,6 +21,7 @@ package org.apache.directory.server.component.handler.ipojo; +import java.util.Hashtable; import java.util.Properties; import org.apache.directory.server.hub.api.component.util.InterceptorConstants; @@ -47,7 +48,7 @@ public class DirectoryInterceptorHandler @Override - protected Properties extractConstantProperties( Element ipojoMetadata ) + protected Hashtable extractConstantProperties( Element ipojoMetadata ) { Element[] interceptors = ipojoMetadata.getElements( getHandlerName(), getHandlerNamespaceName() ); // Only one interceptor per class is allowed @@ -56,7 +57,7 @@ public class DirectoryInterceptorHandler String interceptionPoint = interceptor.getAttribute( InterceptorConstants.PROP_INTERCEPTION_POINT ); String interceptorOperations = interceptor.getAttribute( InterceptorConstants.PROP_INTERCEPTOR_OPERATIONS ); - Properties constants = new Properties(); + Hashtable constants = new Hashtable(); constants.put( InterceptorConstants.PROP_INTERCEPTION_POINT, interceptionPoint ); constants.put( InterceptorConstants.PROP_INTERCEPTOR_OPERATIONS, interceptorOperations ); Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryPartitionHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryPartitionHandler.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryPartitionHandler.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryPartitionHandler.java Tue May 15 10:39:57 2012 @@ -21,6 +21,7 @@ package org.apache.directory.server.component.handler.ipojo; +import java.util.Hashtable; import java.util.Properties; import org.apache.felix.ipojo.annotations.Handler; @@ -46,7 +47,7 @@ public class DirectoryPartitionHandler e @Override - protected Properties extractConstantProperties( Element ipojoMetadata ) + protected Hashtable extractConstantProperties( Element ipojoMetadata ) { return null; } Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryServerHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryServerHandler.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryServerHandler.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryServerHandler.java Tue May 15 10:39:57 2012 @@ -21,6 +21,7 @@ package org.apache.directory.server.component.handler.ipojo; +import java.util.Hashtable; import java.util.Properties; import org.apache.felix.ipojo.annotations.Handler; @@ -46,7 +47,7 @@ public class DirectoryServerHandler exte @Override - protected Properties extractConstantProperties( Element ipojoMetadata ) + protected Hashtable extractConstantProperties( Element ipojoMetadata ) { return null; } Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/property/DirectoryPropertyDescription.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/property/DirectoryPropertyDescription.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/property/DirectoryPropertyDescription.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/property/DirectoryPropertyDescription.java Tue May 15 10:39:57 2012 @@ -34,6 +34,7 @@ public class DirectoryPropertyDescriptio private String m_containertype; private String m_description; + private boolean m_constant; public DirectoryPropertyDescription( String name, String type, String value, String desc, String spec, @@ -54,6 +55,13 @@ public class DirectoryPropertyDescriptio } + public DirectoryPropertyDescription( boolean constant, String name, String value ) + { + super( name, String.class.getName(), value ); + m_constant = constant; + } + + /** * Gets the container type parameter of property. * @@ -75,4 +83,15 @@ public class DirectoryPropertyDescriptio return m_description; } + + /** + * Gets whether the property is constant + * + * @return true if property is constant + */ + public boolean isConstant() + { + return m_constant; + } + } Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java Tue May 15 10:39:57 2012 @@ -24,7 +24,9 @@ package org.apache.directory.server.hub. import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; +import java.util.Hashtable; import java.util.List; +import java.util.Properties; import java.util.Set; import org.apache.directory.server.core.api.interceptor.Interceptor; @@ -467,7 +469,6 @@ public class ComponentHubImpl implements switch ( pd.getPropertyContext() ) { - case CONSTANT: case PRIMITIVE: case PRIMITIVE_COLLECTION: break; @@ -560,11 +561,12 @@ public class ComponentHubImpl implements DCMetadataDescriptor metadata = metadatasReg.getMetadataDescriptor( component.getComponentManagerPID() ); // Loading meta-constant properties into component - for ( DCPropertyDescription pd : metadata.getPropertyDescriptons() ) + Hashtable constants = metadata.getConstants(); + if ( constants != null ) { - if ( pd.getPropertyContext() == DCPropertyType.CONSTANT ) + for ( String key : constants.keySet() ) { - component.getConfiguration().addConstant( pd.getName(), pd.getDefaultValue() ); + component.getConfiguration().addConstant( key, constants.get( key ) ); } } @@ -581,15 +583,8 @@ public class ComponentHubImpl implements continue; } - if ( pd.getPropertyContext() == DCPropertyType.CONSTANT ) - { - property.setObject( propertyValue ); - continue; - } - switch ( pd.getPropertyContext() ) { - case CONSTANT: case PRIMITIVE: case PRIMITIVE_COLLECTION: @@ -845,7 +840,7 @@ public class ComponentHubImpl implements DCMetadataDescriptor configuratorMeta = new DCMetadataDescriptor( "configuratorMeta", false, new Version( "2.0.0" ), ConfiguratorInterceptor.class.getName(), new String[] - { Interceptor.class.getName() }, new String[0], new DCPropertyDescription[0] ); + { Interceptor.class.getName() }, new String[0], null, new DCPropertyDescription[0] ); metadatasReg.addMetadataDescriptor( configuratorMeta ); componentsReg.addDirectoryComponent( component ); Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/connector/collection/CollectionMetaDescriptorGenerator.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/connector/collection/CollectionMetaDescriptorGenerator.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/connector/collection/CollectionMetaDescriptorGenerator.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/connector/collection/CollectionMetaDescriptorGenerator.java Tue May 15 10:39:57 2012 @@ -68,9 +68,9 @@ public class CollectionMetaDescriptorGen DCPropertyDescription[] properties = new DCPropertyDescription[] { new DCPropertyDescription( DirectoryComponentConstants.DC_LIST_PROP_TYPE, ComponentConstants.PRIMITIVE_STR, Object.class.getName(), "Specifies collection's container type", - true, DirectoryComponentConstants.DC_VAL_NULL ) }; + true, false, DirectoryComponentConstants.DC_VAL_NULL ) }; - return new DCMetadataDescriptor( metaPid, true, metaVersion, className, implemented, extended, properties ); + return new DCMetadataDescriptor( metaPid, true, metaVersion, className, implemented, extended, null, properties ); } @@ -86,9 +86,9 @@ public class CollectionMetaDescriptorGen DCPropertyDescription[] properties = new DCPropertyDescription[] { new DCPropertyDescription( DirectoryComponentConstants.DC_SET_PROP_TYPE, ComponentConstants.PRIMITIVE_STR, Object.class.getName(), "Specifies collection's container type", - true, DirectoryComponentConstants.DC_VAL_NULL ) }; + true, false, DirectoryComponentConstants.DC_VAL_NULL ) }; - return new DCMetadataDescriptor( metaPid, true, metaVersion, className, implemented, extended, properties ); + return new DCMetadataDescriptor( metaPid, true, metaVersion, className, implemented, extended, null, properties ); } @@ -102,9 +102,9 @@ public class CollectionMetaDescriptorGen DCPropertyDescription[] properties = new DCPropertyDescription[] { new DCPropertyDescription( DirectoryComponentConstants.DC_ARRAY_PROP_TYPE, ComponentConstants.PRIMITIVE_STR, Object.class.getName(), "Specifies collection's container type", - true, DirectoryComponentConstants.DC_VAL_NULL ) }; + true, false, DirectoryComponentConstants.DC_VAL_NULL ) }; - return new DCMetadataDescriptor( metaPid, true, metaVersion, className, implemented, extended, properties ); + return new DCMetadataDescriptor( metaPid, true, metaVersion, className, implemented, extended, null, properties ); } } Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/meta/DCMetadataNormalizer.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/meta/DCMetadataNormalizer.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/meta/DCMetadataNormalizer.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/meta/DCMetadataNormalizer.java Tue May 15 10:39:57 2012 @@ -43,11 +43,6 @@ public class DCMetadataNormalizer { for ( DCPropertyDescription pd : metadata.getPropertyDescriptons() ) { - if ( pd.getPropertyContext() == DCPropertyType.CONSTANT ) - { - continue; - } - if ( isPrimitive( pd.getType() ) ) { pd.setPropertyContext( DCPropertyType.PRIMITIVE ); Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/ApacheDSConfigStore.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/ApacheDSConfigStore.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/ApacheDSConfigStore.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/ApacheDSConfigStore.java Tue May 15 10:39:57 2012 @@ -290,11 +290,6 @@ public class ApacheDSConfigStore impleme continue; } - if ( pd.getPropertyContext() == DCPropertyType.CONSTANT ) - { - continue; - } - pds.add( pd ); } Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java Tue May 15 10:39:57 2012 @@ -95,11 +95,6 @@ public class StoreConfigManager for ( DCPropertyDescription pd : metadata.getPropertyDescriptons() ) { - if ( pd.getPropertyContext() == DCPropertyType.CONSTANT ) - { - continue; - } - installPropertyDescription( pd ); } @@ -112,11 +107,6 @@ public class StoreConfigManager { for ( DCPropertyDescription pd : metadata.getPropertyDescriptons() ) { - if ( pd.getPropertyContext() == DCPropertyType.CONSTANT ) - { - continue; - } - uninstallPropertyDescription( pd.getName() ); } @@ -177,8 +167,7 @@ public class StoreConfigManager pdEntry.add( schemaManager.getAttributeType( "objectclass" ), "ads-property-descriptor" ); pdEntry.add( schemaManager.getAttributeType( "ads-pd-name" ), propertyDescription.getName() ); pdEntry.add( schemaManager.getAttributeType( "ads-pd-type" ), propertyDescription.getType() ); - pdEntry.add( schemaManager.getAttributeType( "ads-pd-context" ), propertyDescription.getPropertyContext() - .name() ); + pdEntry.add( schemaManager.getAttributeType( "ads-pd-defaultvalue" ), propertyDescription.getDefaultValue() ); pdEntry.add( schemaManager.getAttributeType( "ads-pd-description" ), propertyDescription.getDescription() ); pdEntry.add( schemaManager.getAttributeType( "ads-pd-containerFor" ), propertyDescription.getContainerFor() ); @@ -209,11 +198,6 @@ public class StoreConfigManager for ( DCPropertyDescription pd : metadata.getPropertyDescriptons() ) { - if ( pd.getPropertyContext() == DCPropertyType.CONSTANT ) - { - continue; - } - mdEntry.add( schemaManager.getAttributeType( "ads-meta-property" ), pd.getName() ); } @@ -277,8 +261,7 @@ public class StoreConfigManager continue; } - if ( pd.getPropertyContext() == DCPropertyType.INJECTION - || pd.getPropertyContext() == DCPropertyType.CONSTANT ) + if ( pd.getPropertyContext() == DCPropertyType.INJECTION ) { continue; } @@ -480,7 +463,7 @@ public class StoreConfigManager filter = new PresenceNode( schemaManager.getAttributeType( StoreSchemaConstants.HUB_AT_MD_PID ) ); cursor = se.cursor( new Dn( schemaManager, CONFIG_MD_BASE ), AliasDerefMode.NEVER_DEREF_ALIASES, filter, - SearchScope.SUBTREE ); + SearchScope.SUBTREE ); while ( cursor.next() ) { @@ -529,7 +512,6 @@ public class StoreConfigManager Attribute desc = entry.get( schemaManager.getAttributeType( StoreSchemaConstants.HUB_AT_PD_DESCRIPTION ) ); Attribute mandatory = entry.get( schemaManager.getAttributeType( StoreSchemaConstants.HUB_AT_PD_MANDATORY ) ); Attribute container = entry.get( schemaManager.getAttributeType( StoreSchemaConstants.HUB_AT_PD_CONTAINERFOR ) ); - Attribute context = entry.get( schemaManager.getAttributeType( StoreSchemaConstants.HUB_AT_PD_CONTEXT ) ); try { @@ -552,12 +534,9 @@ public class StoreConfigManager } boolean isMandatory = Boolean.parseBoolean( mandatory.getString() ); - DCPropertyType pdtype = DCPropertyType.valueOf( context.getString() ); DCPropertyDescription pd = new DCPropertyDescription( name.getString(), type.getString(), - pdDefaultValue, pdDescription, isMandatory, containerFor ); - - pd.setPropertyContext( pdtype ); + pdDefaultValue, pdDescription, isMandatory, false, containerFor ); return pd; } @@ -616,7 +595,7 @@ public class StoreConfigManager return new DCMetadataDescriptor( pid.getString(), isFactory, new Version( version.getString() ), classname.getString(), - implementedList.toArray( new String[0] ), extendedList.toArray( new String[0] ), + implementedList.toArray( new String[0] ), extendedList.toArray( new String[0] ), null, pds.toArray( new DCPropertyDescription[0] ) ); } catch ( Exception e ) Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreSchemaConstants.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreSchemaConstants.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreSchemaConstants.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreSchemaConstants.java Tue May 15 10:39:57 2012 @@ -37,7 +37,6 @@ public class StoreSchemaConstants public static final String HUB_AT_MD_FACTORY = "ads-meta-factory"; public static final String HUB_AT_MD_PROP = "ads-meta-property"; - public static final String HUB_AT_PD_CONTEXT = "ads-pd-context"; public static final String HUB_AT_PD_NAME = "ads-pd-name"; public static final String HUB_AT_PD_TYPE = "ads-pd-type"; public static final String HUB_AT_PD_DEFAULTVAL = "ads-pd-defaultvalue"; Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreSchemaManager.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreSchemaManager.java?rev=1338634&r1=1338633&r2=1338634&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreSchemaManager.java (original) +++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreSchemaManager.java Tue May 15 10:39:57 2012 @@ -116,11 +116,6 @@ public class StoreSchemaManager continue; } - if ( pd.getPropertyContext() == DCPropertyType.CONSTANT ) - { - continue; - } - installAttribute( pd ); } @@ -329,11 +324,6 @@ public class StoreSchemaManager continue; } - if ( pd.getPropertyContext() == DCPropertyType.CONSTANT ) - { - continue; - } - if ( pd.isMandatory() ) { ocEntry.add( sm.getAttributeType( "m-must" ), pd.getName() ); @@ -411,9 +401,9 @@ public class StoreSchemaManager public void updateOC( DCMetadataDescriptor metadata ) throws LdapException { uninstallOC( metadata.getMetadataPID() ); - + Entry ocEntry = generateOC( metadata, installNamers( metadata ) ); - + installOCEntry( ocEntry ); } }