You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by go...@apache.org on 2012/05/10 15:24:43 UTC
svn commit: r1336669 - in
/directory/apacheds/branches/apacheds-osgi/hub/api: ./ src/ src/main/
src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/directory/
src/main/java/org/apache/directory/server/ src/main/java/org...
Author: gokturk
Date: Thu May 10 13:24:41 2012
New Revision: 1336669
URL: http://svn.apache.org/viewvc?rev=1336669&view=rev
Log:
Component-Hub API for Core implementation and framework connectors
Added:
directory/apacheds/branches/apacheds-osgi/hub/api/
directory/apacheds/branches/apacheds-osgi/hub/api/pom.xml
directory/apacheds/branches/apacheds-osgi/hub/api/src/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/AbstractHubClient.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/ComponentHub.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/HubConnector.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/HubStore.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/
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/DCProperty.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCRuntime.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponent.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/component/util/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/ComponentConstants.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptionPoint.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptorConstants.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptorOperation.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/BadConfigurationException.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/ComponentInstantiationException.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/ComponentReconfigurationException.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/HubAbortException.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/HubStoreException.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/StoreNotValidException.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/
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/DCOperationsManager.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/api/src/main/java/org/apache/directory/server/hub/api/registry/
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/DCMetadataRegistry.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/DirectoryComponentRegistry.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/InjectionRegistry.java
directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/PIDHandlerRegistry.java
Added: directory/apacheds/branches/apacheds-osgi/hub/api/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/pom.xml?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/pom.xml (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/pom.xml Thu May 10 13:24:41 2012
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-hub</artifactId>
+ <version>2.0.0-M7-SNAPSHOT</version>
+ </parent>
+ <artifactId>apacheds-hub-api</artifactId>
+ <name>Component Hub API</name>
+ <description>Component Hub API</description>
+
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>4.3.0</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <inherited>true</inherited>
+ <extensions>true</extensions>
+ <configuration>
+ <manifestLocation>META-INF</manifestLocation>
+ <unpackBundle>true</unpackBundle>
+ <instructions>
+ <Bundle-SymbolicName>${project.groupId}.hub.api</Bundle-SymbolicName>
+ <Export-Package>
+ {local-packages};version=${project.version};-noimport:=true
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/AbstractHubClient.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/AbstractHubClient.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/AbstractHubClient.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/AbstractHubClient.java Thu May 10 13:24:41 2012
@@ -0,0 +1,33 @@
+package org.apache.directory.server.hub.api;
+
+import org.apache.directory.server.hub.api.component.DirectoryComponent;
+import org.apache.directory.server.hub.api.exception.HubAbortException;
+
+
+
+
+public class AbstractHubClient
+{
+ public void componentActivated( DirectoryComponent component )
+ {
+
+ }
+
+
+ public void componentDeactivating( DirectoryComponent component )
+ {
+
+ }
+
+
+ public void componentRemoving( DirectoryComponent component ) throws HubAbortException
+ {
+
+ }
+
+
+ public void componentReconfigured( DirectoryComponent component )
+ {
+
+ }
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/ComponentHub.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/ComponentHub.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/ComponentHub.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/ComponentHub.java Thu May 10 13:24:41 2012
@@ -0,0 +1,66 @@
+package org.apache.directory.server.hub.api;
+
+import org.apache.directory.server.hub.api.component.DCConfiguration;
+import org.apache.directory.server.hub.api.component.DirectoryComponent;
+import org.apache.directory.server.hub.api.exception.HubAbortException;
+import org.apache.directory.server.hub.api.exception.StoreNotValidException;
+import org.apache.directory.server.hub.api.meta.DCMetadataDescriptor;
+import org.apache.directory.server.hub.api.meta.DCOperationsManager;
+import org.apache.directory.server.hub.api.registry.DCMetadataRegistry;
+import org.apache.directory.server.hub.api.registry.DirectoryComponentRegistry;
+import org.apache.directory.server.hub.api.registry.InjectionRegistry;
+import org.apache.directory.server.hub.api.registry.PIDHandlerRegistry;
+
+
+
+
+public interface ComponentHub
+{
+
+ public abstract void init() throws StoreNotValidException;
+
+
+ public abstract void connectHandler( DCMetadataDescriptor metadata, DCOperationsManager operationsManager )
+ throws HubAbortException;
+
+
+ public abstract void disconnectHandler( String handlerPID );
+
+
+ public abstract void updateComponentName( DirectoryComponent component, String newPID ) throws HubAbortException;
+
+
+ public abstract void updateComponent( DirectoryComponent component, DCConfiguration newConfiguration )
+ throws HubAbortException;
+
+
+ public abstract void addComponent( DirectoryComponent component ) throws HubAbortException;
+
+
+ public abstract void removeComponent( DirectoryComponent component ) throws HubAbortException;
+
+
+ public abstract void addInjection( String injectionType, Object injection );
+
+
+ public abstract void removeInjection( String injectionType );
+
+
+ public abstract void registerClient( AbstractHubClient hubClient, String type );
+
+
+ public abstract void unregisterClient( AbstractHubClient hubClient, String type );
+
+
+ public abstract DirectoryComponentRegistry getDCRegistry();
+
+
+ public abstract DCMetadataRegistry getMetaRegistry();
+
+
+ public abstract InjectionRegistry getInjectionRegistry();
+
+
+ public abstract PIDHandlerRegistry getPIDHandlerRegistry();
+
+}
\ No newline at end of file
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/HubConnector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/HubConnector.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/HubConnector.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/HubConnector.java Thu May 10 13:24:41 2012
@@ -0,0 +1,7 @@
+package org.apache.directory.server.hub.api;
+
+
+public interface HubConnector
+{
+ void init( ComponentHub hub );
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/HubStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/HubStore.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/HubStore.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/HubStore.java Thu May 10 13:24:41 2012
@@ -0,0 +1,43 @@
+package org.apache.directory.server.hub.api;
+
+
+import java.util.List;
+
+import org.apache.directory.server.hub.api.component.DCConfiguration;
+import org.apache.directory.server.hub.api.component.DirectoryComponent;
+import org.apache.directory.server.hub.api.exception.HubStoreException;
+import org.apache.directory.server.hub.api.exception.StoreNotValidException;
+import org.apache.directory.server.hub.api.meta.DCMetadataDescriptor;
+
+
+
+public interface HubStore
+{
+
+ public void init( ComponentHub hub ) throws StoreNotValidException;
+
+
+ List<DCMetadataDescriptor> getMetadataDescriptors() throws HubStoreException;
+
+
+ List<DirectoryComponent> getComponents() throws HubStoreException;
+
+
+ void installMetadataDescriptor( DCMetadataDescriptor metadata ) throws HubStoreException;
+
+
+ void updateMetadataDescriptor( DCMetadataDescriptor oldMetadata, DCMetadataDescriptor newMetadata )
+ throws HubStoreException;
+
+
+ void uninstallMetadataDescriptor( DCMetadataDescriptor metadata ) throws HubStoreException;
+
+
+ void installComponent( DirectoryComponent component ) throws HubStoreException;
+
+
+ void updateComponent( DirectoryComponent component, DCConfiguration newConfiguration ) throws HubStoreException;
+
+
+ void uninstallComponent( DirectoryComponent component ) throws HubStoreException;
+}
Added: 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=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCConfiguration.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCConfiguration.java Thu May 10 13:24:41 2012
@@ -0,0 +1,85 @@
+package org.apache.directory.server.hub.api.component;
+
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+
+
+public class DCConfiguration implements Iterable<DCProperty>
+{
+ private List<DCProperty> properties;
+ private Hashtable<String, DCProperty> propertyMap;
+ private Integer collectionIndex = null;
+
+
+ public DCConfiguration( List<DCProperty> properties )
+ {
+ this.properties = properties;
+ propertyMap = new Hashtable<String, DCProperty>();
+
+ for ( DCProperty property : properties )
+ {
+ propertyMap.put( property.getName(), property );
+ }
+ }
+
+
+ public DCConfiguration( DCConfiguration configuration )
+ {
+ properties = new ArrayList<DCProperty>();
+ propertyMap = new Hashtable<String, DCProperty>();
+
+ for ( DCProperty prop : configuration )
+ {
+ addProperty( new DCProperty( prop.getName(), prop.getValue() ) );
+ }
+
+ collectionIndex = configuration.getCollectionIndex();
+ }
+
+
+ @Override
+ public Iterator<DCProperty> iterator()
+ {
+ return properties.iterator();
+ }
+
+
+ public void addProperty( DCProperty property )
+ {
+ properties.add( property );
+ propertyMap.put( property.getName(), property );
+ }
+
+
+ public void removeProperty( String propertyName )
+ {
+ DCProperty removing = propertyMap.remove( propertyName );
+ if ( removing != null )
+ {
+ properties.remove( removing );
+ }
+ }
+
+
+ public DCProperty getProperty( String propertyName )
+ {
+ return propertyMap.get( propertyName );
+ }
+
+
+ public Integer getCollectionIndex()
+ {
+ return collectionIndex;
+ }
+
+
+ public void setCollectionIndex( Integer collectionIndex )
+ {
+ this.collectionIndex = collectionIndex;
+ }
+
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCProperty.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCProperty.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCProperty.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCProperty.java Thu May 10 13:24:41 2012
@@ -0,0 +1,47 @@
+package org.apache.directory.server.hub.api.component;
+
+
+public class DCProperty
+{
+ private String name;
+ private String value;
+ private Object object;
+
+
+ public DCProperty( String name, String value )
+ {
+ this.name = name;
+ this.value = value;
+ }
+
+
+ public String getName()
+ {
+ return name;
+ }
+
+
+ public String getValue()
+ {
+ return value;
+ }
+
+
+ public void setValue( String value )
+ {
+ this.value = value;
+ }
+
+
+ public Object getObject()
+ {
+ return object;
+ }
+
+
+ public void setObject( Object object )
+ {
+ this.object = object;
+ }
+
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCRuntime.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCRuntime.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCRuntime.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DCRuntime.java Thu May 10 13:24:41 2012
@@ -0,0 +1,39 @@
+package org.apache.directory.server.hub.api.component;
+
+
+public class DCRuntime
+{
+ private Object pojo;
+ private Object specialObject;
+
+
+ public DCRuntime( Object specialObject, Object pojo )
+ {
+ this.specialObject = specialObject;
+ this.pojo = pojo;
+ }
+
+
+ public void setPojo( Object pojo )
+ {
+ this.pojo = pojo;
+ }
+
+
+ public Object getPojo()
+ {
+ return pojo;
+ }
+
+
+ public void setSpecialObject( Object specialObject )
+ {
+ this.specialObject = specialObject;
+ }
+
+
+ public Object getSpecialObject()
+ {
+ return specialObject;
+ }
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponent.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponent.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponent.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponent.java Thu May 10 13:24:41 2012
@@ -0,0 +1,150 @@
+package org.apache.directory.server.hub.api.component;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+
+public class DirectoryComponent
+{
+ private String componentManagerPID;
+ private String componentName;
+ private String configLocation;
+ private DCConfiguration configuration;
+
+ private List<String> errors = new ArrayList<String>();
+ private List<String> warnings = new ArrayList<String>();
+
+ private boolean instantiationFailure;
+
+ private boolean dirty;
+
+ private DCRuntime runtimeInfo;
+
+
+ public DirectoryComponent( String componentManagerPID, String componentName,
+ DCConfiguration configuration )
+ {
+ this.componentManagerPID = componentManagerPID;
+ this.componentName = componentName;
+ this.configuration = configuration;
+ }
+
+
+ public String getComponentManagerPID()
+ {
+ return componentManagerPID;
+ }
+
+
+ public void setComponentName( String componentPID )
+ {
+ this.componentName = componentPID;
+ }
+
+
+ public String getComponentName()
+ {
+ return componentName;
+ }
+
+
+ public void setConfiguration( DCConfiguration configuration )
+ {
+ this.configuration = configuration;
+ }
+
+
+ public DCConfiguration getConfiguration()
+ {
+ return configuration;
+ }
+
+
+ public void setRuntimeInfo( DCRuntime runtieInfo )
+ {
+ this.runtimeInfo = runtieInfo;
+ }
+
+
+ public DCRuntime getRuntimeInfo()
+ {
+ return runtimeInfo;
+ }
+
+
+ public String getComponentPID()
+ {
+ return componentManagerPID + "-" + getComponentName();
+ }
+
+
+ public String getConfigLocation()
+ {
+ return configLocation;
+ }
+
+
+ public void setConfigLocation( String configLocation )
+ {
+ this.configLocation = configLocation;
+ }
+
+
+ public boolean instantiationFailed()
+ {
+ return instantiationFailure;
+ }
+
+
+ public void setFailFlag( boolean dirty )
+ {
+ this.instantiationFailure = dirty;
+ }
+
+
+ public boolean isDirty()
+ {
+ return dirty;
+ }
+
+
+ public void setDirty( boolean dirty )
+ {
+ this.dirty = dirty;
+ }
+
+
+ public void clearErrorsAndWarns()
+ {
+ errors.clear();
+ warnings.clear();
+ }
+
+
+ public void addError( String error )
+ {
+ errors.add( error );
+ }
+
+
+ public void addWarn( String warn )
+ {
+ warnings.add( warn );
+ }
+
+
+ public List<String> getErrors()
+ {
+ return errors;
+ }
+
+
+ public List<String> getWarnings()
+ {
+ return warnings;
+ }
+
+}
Added: 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=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponentConstants.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponentConstants.java Thu May 10 13:24:41 2012
@@ -0,0 +1,23 @@
+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";
+ public static final String DC_VAL_NULL = "null";
+ public static final String DC_PROP_ITEM_PREFIX = "__id_";
+ public static final String DC_PROP_ITEM_INDEX_NAME = "ads-collectionindex";
+
+ 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, "" );
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/ComponentConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/ComponentConstants.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/ComponentConstants.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/ComponentConstants.java Thu May 10 13:24:41 2012
@@ -0,0 +1,12 @@
+package org.apache.directory.server.hub.api.component.util;
+
+
+public class ComponentConstants
+{
+ public static final String DC_NATURE_INDICATOR = "ads-bound";
+
+ public static final String PRIMITIVE_STR = "DS_STRING";
+ public static final String PRIMITIVE_INT = "DS_INT";
+ public static final String PRIMITIVE_FLOAT = "DS_FLOAT";
+ public static final String PRIMITIVE_BOOL = "DS_BOOL";
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptionPoint.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptionPoint.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptionPoint.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptionPoint.java Thu May 10 13:24:41 2012
@@ -0,0 +1,50 @@
+package org.apache.directory.server.hub.api.component.util;
+
+
+public enum InterceptionPoint
+{
+ START,
+ PRE_NORM,
+ NORM,
+ POST_NORM,
+ PRE_AUTHN,
+ AUTHN,
+ POST_AUTHN,
+ PRE_REFERRAL,
+ REFERRAL,
+ POST_REFERRAL,
+ PRE_ACI,
+ ACI,
+ POST_ACI,
+ PRE_AUTHZ,
+ AUTHZ,
+ POST_AUTHZ,
+ PRE_EXCEPTION,
+ EXCEPTION,
+ POST_EXCEPTION,
+ PRE_KEYDRV,
+ KEYDRV,
+ POST_KEYDRV,
+ PRE_PASSHASH,
+ PASSHASH,
+ POST_PASSHASH,
+ PRE_SCHEMA,
+ SCHEMA,
+ POST_SCHEMA,
+ PRE_OPERAT,
+ OPERAT,
+ POST_OPERAT,
+ PRE_COLLAT,
+ COLLAT,
+ POST_COLLAT,
+ PRE_SUBENTRY,
+ SUBENTRY,
+ POST_SUBENTRY,
+ PRE_EVENT,
+ EVENT,
+ POST_EVENT,
+ PRE_TRIGGER,
+ TRIGGER,
+ POST_TRIGGER,
+ END
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptorConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptorConstants.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptorConstants.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptorConstants.java Thu May 10 13:24:41 2012
@@ -0,0 +1,10 @@
+package org.apache.directory.server.hub.api.component.util;
+
+
+public class InterceptorConstants
+{
+ public static final String PROP_INTERCEPTION_POINT = "interceptionPoint";
+
+ public static final String PROP_INTERCEPTOR_OPERATIONS = "operations";
+
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptorOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptorOperation.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptorOperation.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/util/InterceptorOperation.java Thu May 10 13:24:41 2012
@@ -0,0 +1,18 @@
+package org.apache.directory.server.hub.api.component.util;
+
+
+public class InterceptorOperation
+{
+ public static final String ADD = "ADD";
+ public static final String BIND = "BIND";
+ public static final String COMPARE = "COMPARE";
+ public static final String DELETE = "DELETE";
+ public static final String GETROOTDSE = "GETROOTDSE";
+ public static final String HASENTRY = "HASENTRY";
+ public static final String LIST = "LIST";
+ public static final String LOOKUP = "LOOKUP";
+ public static final String MODIFY = "MODIFY";
+ public static final String MOVE = "MOVE";
+ public static final String MOVEANDRENAME = "MOVEANDRENAME";
+ public static final String RENAME = "RENAME";
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/BadConfigurationException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/BadConfigurationException.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/BadConfigurationException.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/BadConfigurationException.java Thu May 10 13:24:41 2012
@@ -0,0 +1,11 @@
+package org.apache.directory.server.hub.api.exception;
+
+
+@SuppressWarnings("serial")
+public class BadConfigurationException extends Exception
+{
+ public BadConfigurationException( String msg )
+ {
+ super( msg );
+ }
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/ComponentInstantiationException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/ComponentInstantiationException.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/ComponentInstantiationException.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/ComponentInstantiationException.java Thu May 10 13:24:41 2012
@@ -0,0 +1,11 @@
+package org.apache.directory.server.hub.api.exception;
+
+
+@SuppressWarnings("serial")
+public class ComponentInstantiationException extends Exception
+{
+ public ComponentInstantiationException( String msg, Throwable cause )
+ {
+ super( msg, cause );
+ }
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/ComponentReconfigurationException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/ComponentReconfigurationException.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/ComponentReconfigurationException.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/ComponentReconfigurationException.java Thu May 10 13:24:41 2012
@@ -0,0 +1,17 @@
+package org.apache.directory.server.hub.api.exception;
+
+
+@SuppressWarnings("serial")
+public class ComponentReconfigurationException extends Exception
+{
+ public ComponentReconfigurationException( String msg )
+ {
+ this( msg, null );
+ }
+
+
+ public ComponentReconfigurationException( String msg, Throwable cause )
+ {
+ super( msg, cause );
+ }
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/HubAbortException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/HubAbortException.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/HubAbortException.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/HubAbortException.java Thu May 10 13:24:41 2012
@@ -0,0 +1,17 @@
+package org.apache.directory.server.hub.api.exception;
+
+
+@SuppressWarnings("serial")
+public class HubAbortException extends Exception
+{
+ public HubAbortException( String msg )
+ {
+ super( msg );
+ }
+
+
+ public HubAbortException( String msg, Throwable cause )
+ {
+ super( msg, cause );
+ }
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/HubStoreException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/HubStoreException.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/HubStoreException.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/HubStoreException.java Thu May 10 13:24:41 2012
@@ -0,0 +1,16 @@
+package org.apache.directory.server.hub.api.exception;
+
+
+public class HubStoreException extends Exception
+{
+ public HubStoreException( String msg )
+ {
+ this( msg, null );
+ }
+
+
+ public HubStoreException( String msg, Throwable cause )
+ {
+ super( msg, cause );
+ }
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/StoreNotValidException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/StoreNotValidException.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/StoreNotValidException.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/exception/StoreNotValidException.java Thu May 10 13:24:41 2012
@@ -0,0 +1,17 @@
+package org.apache.directory.server.hub.api.exception;
+
+
+public class StoreNotValidException extends Exception
+{
+
+ public StoreNotValidException( String msg )
+ {
+ super( msg );
+ }
+
+
+ public StoreNotValidException( String msg, Throwable cause )
+ {
+ super( msg, cause );
+ }
+}
Added: 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=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCMetadataDescriptor.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCMetadataDescriptor.java Thu May 10 13:24:41 2012
@@ -0,0 +1,162 @@
+package org.apache.directory.server.hub.api.meta;
+
+
+import java.util.Hashtable;
+
+import org.apache.directory.server.hub.api.component.DirectoryComponentConstants;
+import org.osgi.framework.Version;
+
+
+public class DCMetadataDescriptor
+{
+ private String metadataPID;
+ private Version metaVersion;
+
+ private String className = "";
+ private String[] implemented = new String[0];
+ private String[] extended = new String[0];
+
+ private DCPropertyDescription[] properties;
+
+ private Hashtable<String, DCPropertyDescription> propertyMap;
+
+ private boolean factory;
+
+
+ public DCMetadataDescriptor(
+ String metadataPID,
+ boolean isFactory,
+ Version metaVersion,
+ String className,
+ String[] implemented,
+ String[] extended,
+ DCPropertyDescription[] properties )
+ {
+ this.metadataPID = metadataPID;
+ this.factory = isFactory;
+ this.metaVersion = metaVersion;
+ this.className = className;
+ this.implemented = implemented;
+ this.extended = extended;
+ this.properties = properties;
+
+ propertyMap = new Hashtable<String, DCPropertyDescription>();
+
+ if ( properties != null )
+ {
+ for ( DCPropertyDescription p : properties )
+ {
+ propertyMap.put( p.getName(), p );
+ }
+ }
+ }
+
+
+ public String getMetadataPID()
+ {
+ return metadataPID;
+ }
+
+
+ public boolean isFactory()
+ {
+ return factory;
+ }
+
+
+ public Version getMetaVersion()
+ {
+ return metaVersion;
+ }
+
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+
+ public String[] getExtendedClasses()
+ {
+ return extended;
+ }
+
+
+ public String[] getImplementedInterfaces()
+ {
+ return implemented;
+ }
+
+
+ public DCPropertyDescription[] getPropertyDescriptons()
+ {
+ return properties;
+ }
+
+
+ public DCPropertyDescription getPropertyDescription( String propertyName )
+ {
+ if ( propertyName.startsWith( DirectoryComponentConstants.DC_PROP_ITEM_PREFIX ) )
+ {
+ return DirectoryComponentConstants.itemDescription;
+ }
+
+ return propertyMap.get( propertyName );
+ }
+
+
+ public boolean compatibleWith( DCMetadataDescriptor metadata )
+ {
+ Version version = metadata.getMetaVersion();
+
+ if ( version.getQualifier().contains( "SNAPSHOT" ) || metaVersion.getQualifier().contains( "SNAPSHOT" ) )
+ {
+ return false;
+ }
+
+ if ( metaVersion.compareTo( version ) == 0 )
+ {
+ return true;
+ }
+ else
+ {
+ if ( metaVersion.getMajor() == version.getMajor() )
+ {
+ if ( metaVersion.getMinor() == version.getMinor() )
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+
+ public boolean is( String type )
+ {
+ if ( className.equals( type ) )
+ {
+ return true;
+ }
+
+ for ( String sClass : extended )
+ {
+ if ( sClass.equals( type ) )
+ {
+ return true;
+ }
+ }
+
+ for ( String iface : implemented )
+ {
+ if ( iface.equals( type ) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCOperationsManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCOperationsManager.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCOperationsManager.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCOperationsManager.java Thu May 10 13:24:41 2012
@@ -0,0 +1,19 @@
+package org.apache.directory.server.hub.api.meta;
+
+import org.apache.directory.server.hub.api.component.DirectoryComponent;
+import org.apache.directory.server.hub.api.exception.ComponentInstantiationException;
+import org.apache.directory.server.hub.api.exception.ComponentReconfigurationException;
+
+
+
+
+public interface DCOperationsManager
+{
+ void instantiateComponent( DirectoryComponent component ) throws ComponentInstantiationException;
+
+
+ void reconfigureComponent( DirectoryComponent component ) throws ComponentReconfigurationException;
+
+
+ void disposeComponent( DirectoryComponent component );
+}
Added: 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=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyDescription.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyDescription.java Thu May 10 13:24:41 2012
@@ -0,0 +1,91 @@
+package org.apache.directory.server.hub.api.meta;
+
+
+
+
+public class DCPropertyDescription
+{
+ private DCPropertyType propertyContext;
+ private String name;
+ private String type;
+ private String defaultValue;
+ private String description;
+ private boolean mandatory;
+ private String containerFor;
+
+
+ public DCPropertyDescription( String name, String type, String defaultValue, String description, boolean mandatory,
+ String containerFor )
+ {
+ this( null, name, type, defaultValue, description, mandatory, containerFor );
+ }
+
+
+ public DCPropertyDescription( DCPropertyType propertyContext, String name, String type, String defaultValue,
+ String description, boolean mandatory,
+ String containerFor )
+ {
+ this.propertyContext = propertyContext;
+ this.name = name;
+ this.type = type;
+ this.defaultValue = defaultValue;
+ this.description = description;
+ this.mandatory = mandatory;
+ this.containerFor = containerFor;
+ }
+
+
+ public String getName()
+ {
+ return name;
+ }
+
+
+ public String getType()
+ {
+ return type;
+ }
+
+
+ public String getDefaultValue()
+ {
+ return defaultValue;
+ }
+
+
+ public void setDefaultValue( String value )
+ {
+ this.defaultValue = value;
+ }
+
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+
+ public boolean isMandatory()
+ {
+ return mandatory;
+ }
+
+
+ public String getContainerFor()
+ {
+ return containerFor;
+ }
+
+
+ public DCPropertyType getPropertyContext()
+ {
+ return propertyContext;
+ }
+
+
+ public void setPropertyContext( DCPropertyType propertyContext )
+ {
+ this.propertyContext = propertyContext;
+ }
+
+}
Added: 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=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyType.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DCPropertyType.java Thu May 10 13:24:41 2012
@@ -0,0 +1,12 @@
+package org.apache.directory.server.hub.api.meta;
+
+
+public enum DCPropertyType
+{
+ PRIMITIVE,
+ REFERENCE,
+ PRIMITIVE_COLLECTION,
+ COLLECTION,
+ INJECTION,
+ CONSTANT
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/DCMetadataRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/DCMetadataRegistry.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/DCMetadataRegistry.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/DCMetadataRegistry.java Thu May 10 13:24:41 2012
@@ -0,0 +1,41 @@
+package org.apache.directory.server.hub.api.registry;
+
+
+import java.util.Hashtable;
+import java.util.List;
+
+import org.apache.directory.server.hub.api.meta.DCMetadataDescriptor;
+
+
+
+public class DCMetadataRegistry
+{
+ private Hashtable<String, DCMetadataDescriptor> metadatas = new Hashtable<String, DCMetadataDescriptor>();
+
+
+ public void addMetadataDescriptor( DCMetadataDescriptor meta )
+ {
+ metadatas.put( meta.getMetadataPID(), meta );
+ }
+
+
+ public void addMetadataDescriptor( List<DCMetadataDescriptor> metas )
+ {
+ for ( DCMetadataDescriptor meta : metas )
+ {
+ addMetadataDescriptor( meta );
+ }
+ }
+
+
+ public void removeMetadataDescriptor( String metaPID )
+ {
+ metadatas.remove( metaPID );
+ }
+
+
+ public DCMetadataDescriptor getMetadataDescriptor( String metaPID )
+ {
+ return metadatas.get( metaPID );
+ }
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/DirectoryComponentRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/DirectoryComponentRegistry.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/DirectoryComponentRegistry.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/DirectoryComponentRegistry.java Thu May 10 13:24:41 2012
@@ -0,0 +1,102 @@
+package org.apache.directory.server.hub.api.registry;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Hashtable;
+import java.util.List;
+
+import org.apache.commons.collections.MultiMap;
+import org.apache.commons.collections.map.MultiValueMap;
+import org.apache.directory.server.hub.api.component.DirectoryComponent;
+
+
+public class DirectoryComponentRegistry
+{
+ private Hashtable<String, DirectoryComponent> pidMap = new Hashtable<String, DirectoryComponent>();
+ private MultiMap handlerPIDMap = new MultiValueMap();
+ private Hashtable<String, DirectoryComponent> dnMap = new Hashtable<String, DirectoryComponent>();
+
+
+ public void addDirectoryComponent( DirectoryComponent component )
+ {
+ pidMap.put( component.getComponentPID(), component );
+ handlerPIDMap.put( component.getComponentManagerPID(), component );
+ dnMap.put( component.getConfigLocation(), component );
+ }
+
+
+ public void addDirectoryComponent( List<DirectoryComponent> components )
+ {
+ for ( DirectoryComponent component : components )
+ {
+ addDirectoryComponent( component );
+ }
+ }
+
+
+ public void removeDirectoryComponent( DirectoryComponent component )
+ {
+ pidMap.remove( component.getComponentPID() );
+ dnMap.remove( component.getConfigLocation() );
+ handlerPIDMap.remove( component.getComponentManagerPID(), component );
+ }
+
+
+ public DirectoryComponent getComponentByReference( String componentPID )
+ {
+ return pidMap.get( componentPID );
+ }
+
+
+ public DirectoryComponent getComponentByLocation( String location )
+ {
+ return dnMap.get( location );
+ }
+
+
+ public List<DirectoryComponent> getComponents( String handlerPID )
+ {
+ Collection<DirectoryComponent> components = ( Collection ) handlerPIDMap.get( handlerPID );
+ if ( components != null )
+ {
+ return new ArrayList<DirectoryComponent>( components );
+ }
+ else
+ {
+ return null;
+ }
+
+ }
+
+
+ public List<DirectoryComponent> getComponents()
+ {
+ Collection<DirectoryComponent> components = ( Collection ) pidMap.values();
+ if ( components != null )
+ {
+ return new ArrayList<DirectoryComponent>( components );
+ }
+ else
+ {
+ return null;
+ }
+
+ }
+
+
+ public void changeComponentReference( DirectoryComponent component, String newName )
+ {
+ removeDirectoryComponent( component );
+ component.setComponentName( newName );
+ addDirectoryComponent( component );
+ }
+
+
+ public void changeComponentLocation( DirectoryComponent component, String newLocation )
+ {
+ removeDirectoryComponent( component );
+ component.setConfigLocation( newLocation );
+ addDirectoryComponent( component );
+ }
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/InjectionRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/InjectionRegistry.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/InjectionRegistry.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/InjectionRegistry.java Thu May 10 13:24:41 2012
@@ -0,0 +1,27 @@
+package org.apache.directory.server.hub.api.registry;
+
+
+import java.util.Hashtable;
+
+
+public class InjectionRegistry
+{
+ private Hashtable<String, Object> injections = new Hashtable<String, Object>();
+
+ public void addInjection( String type, Object object )
+ {
+ injections.put( type, object );
+ }
+
+
+ public void removeInjection( String type )
+ {
+ injections.remove( type );
+ }
+
+
+ public Object getInjection( String type )
+ {
+ return injections.get( type );
+ }
+}
Added: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/PIDHandlerRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/PIDHandlerRegistry.java?rev=1336669&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/PIDHandlerRegistry.java (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/registry/PIDHandlerRegistry.java Thu May 10 13:24:41 2012
@@ -0,0 +1,25 @@
+package org.apache.directory.server.hub.api.registry;
+
+
+import java.util.Hashtable;
+
+import org.apache.directory.server.hub.api.meta.DCOperationsManager;
+
+
+
+public class PIDHandlerRegistry
+{
+ private Hashtable<String, DCOperationsManager> handlers = new Hashtable<String, DCOperationsManager>();
+
+
+ public void setPIDHandler( String pid, DCOperationsManager operationsManager )
+ {
+ handlers.put( pid, operationsManager );
+ }
+
+
+ public DCOperationsManager getPIDHandler( String pid )
+ {
+ return handlers.get( pid );
+ }
+}