directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gokt...@apache.org
Subject svn commit: r1338664 - in /directory/apacheds/branches/apacheds-osgi/hub: connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/ ...
Date Tue, 15 May 2012 12:07:52 GMT
Author: gokturk
Date: Tue May 15 12:07:52 2012
New Revision: 1338664

URL: http://svn.apache.org/viewvc?rev=1338664&view=rev
Log:
* DcMetadataNormalizer is called on newly fetched metadatas, based on new constants management

* ipojo-handler is updated to define 'immutable' property in DirectoryProperty

Modified:
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryProperty.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/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/meta/DcMetadataNormalizer.java

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryProperty.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/DirectoryProperty.java?rev=1338664&r1=1338663&r2=1338664&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryProperty.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryProperty.java
Tue May 15 12:07:52 2012
@@ -24,6 +24,9 @@ package org.apache.directory.server.comp
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Target;
 
+import javax.lang.model.type.NullType;
+import javax.lang.model.type.PrimitiveType;
+
 
 /**
  * DirectoryProperty property annotation.
@@ -62,4 +65,10 @@ public @interface DirectoryProperty
      */
     Class containertype() default Object.class;
 
+
+    /*
+     * Whether property will be immutable
+     */
+    boolean immutable() default false;
+
 }

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=1338664&r1=1338663&r2=1338664&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 12:07:52 2012
@@ -187,6 +187,10 @@ public abstract class AbstractDcHandler 
             String man = configurables[i].getAttribute( "mandatory" );
             mandatory = man != null && man.equalsIgnoreCase( "true" );
 
+            boolean immutable = false;
+            String imm = configurables[i].getAttribute( "immutable" );
+            immutable = imm != null && imm.equalsIgnoreCase( "true" );
+
             // If property is constructor index then it must be mandatory.
             if ( paramIndex != null )
             {
@@ -197,7 +201,7 @@ public abstract class AbstractDcHandler 
             String containertype = configurables[i].getAttribute( "containertype" );
 
             DirectoryPropertyDescription pd = new DirectoryPropertyDescription( name, type,
null, description,
-                containertype, false );
+                containertype, immutable );
 
             if ( mandatory )
             {

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=1338664&r1=1338663&r2=1338664&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 12:07:52 2012
@@ -106,6 +106,11 @@ public class ComponentHubImpl implements
             List<DcMetadataDescriptor> metadatas = store.getMetadataDescriptors();
             metadatasReg.addMetadataDescriptor( metadatas );
 
+            for ( DcMetadataDescriptor metadata : metadatas )
+            {
+                DcMetadataNormalizer.normalizeDCMetadata( metadata );
+            }
+
             List<DirectoryComponent> components = store.getComponents();
             for ( DirectoryComponent component : components )
             {

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=1338664&r1=1338663&r2=1338664&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 12:07:52 2012
@@ -57,7 +57,7 @@ public class DcMetadataNormalizer
             }
             else if ( isCollection( pd.getType() ) )
             {
-                if ( isPrimitive( pd.getContainerFor() ) )
+                if ( pd.getContainerFor() == null || isPrimitive( pd.getContainerFor() )
)
                 {
                     pd.setPropertyContext( DcPropertyType.PRIMITIVE_COLLECTION );
                     if ( pd.getDefaultValue() == null )



Mime
View raw message