Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2562 - in development/main/transit/core/handler/src/main/net/dpml/transit: configuration repository

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2562 - in development/main/transit/core/handler/src/main/net/dpml/transit: configuration repository
  • Date: Sun, 15 May 2005 17:44:06 +0000

Author: mcconnell AT dpml.net
Date: Sun May 15 17:44:03 2005
New Revision: 2562

Added:

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheDirector.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheListener.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/FileChangeEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostAddedEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostChangedEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostDirector.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostListener.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostRemovedEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginChangeEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitDirector.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitListener.java
Modified:

development/main/transit/core/handler/src/main/net/dpml/transit/repository/Repository.java

development/main/transit/core/handler/src/main/net/dpml/transit/repository/StandardLoader.java
Log:
Add a set of proposed transit configuration control interfaces (directors).

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheDirector.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheDirector.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2005 Stephen McConnell
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.io.File;
+
+/**
+ * A CacheDirector maintains information about the configuration of the
Transit
+ * cache subsystem. Instances of CacheDirector shall be supplied to cache
handler
+ * implementations as constructor arguments.
+ */
+public interface CacheDirector
+{
+ File getCacheDirectory();
+
+ HostDirector[] getHostDirectors();
+
+ void addCacheListener( CacheListener listener );
+
+}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheListener.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheListener.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.util.EventListener;
+
+public interface CacheListener extends EventListener
+{
+ void cacheDirectoryChanged( FileChangeEvent event );
+
+ void hostAdded( HostAddedEvent event );
+
+ void hostRemoved( HostRemovedEvent event );
+
+}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/FileChangeEvent.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/FileChangeEvent.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.io.File;
+import java.util.EventObject;
+
+public class FileChangeEvent extends EventObject
+{
+ private final File m_old;
+ private final File m_new;
+
+ public FileChangeEvent( Object source, File old, File replacement )
+ {
+ super( source );
+
+ m_old = old;
+ m_new = replacement;
+ }
+
+ public File getOldFile()
+ {
+ return m_old;
+ }
+
+ public File getNewFile()
+ {
+ return m_new;
+ }
+}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostAddedEvent.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostAddedEvent.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.util.EventObject;
+
+public class HostAddedEvent extends EventObject
+{
+ private final HostDirector m_host;
+ private final int m_priority;
+
+ public HostAddedEvent( Object source, HostDirector host, int priority )
+ {
+ super( source );
+
+ m_host = host;
+ m_priority = priority;
+ }
+
+ public HostDirector getHostDirector()
+ {
+ return m_host;
+ }
+
+ public int getPriority()
+ {
+ return m_priority;
+ }
+}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostChangedEvent.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostChangedEvent.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.util.EventObject;
+
+public class HostChangedEvent extends EventObject
+{
+ private final HostDirector m_director;
+ private final String[] m_features;
+
+ public HostChangedEvent( HostDirector director, String[] features )
+ {
+ super( director );
+
+ m_director = director;
+ m_features = features;
+ }
+
+ public HostDirector getHostDirector()
+ {
+ return m_director;
+ }
+
+ public String[] getFeatureNames()
+ {
+ return m_features;
+ }
+}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostDirector.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostDirector.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.net.URL;
+import java.net.URI;
+import java.net.Authenticator;
+
+/**
+ * The HostDirector interface is implemented by objects that control the
+ * the configuration of resource host implementations. An instance of an
+ * implementation of HostDirector may be passed as a constructor argument
+ * to a resource host implmentation. Implementation shall maintain
+ * synchronization via change events raised by implementations of this
+ * interface.
+ */
+public interface HostDirector
+{
+ // Based on the resource descriptor, this interface attempt to reduce
+ // down the information needed at instantiation and subsequent runtime.
+ // It assumes that the host implementation class is immutable.
+ // Host priority has been moved to the CacheListener class.
+ //
+ // Password and username have been reflected as an authenticator instance
+ // however - some additional info may be needed related to sceme and
promopt
+ // but these are not included as these feel like authenticator
implementation
+ // concerns (not sure on this one). At least its fair to say that an
authenticator
+ // is a network host concern which would suggest that there is a
NetworkHostDirector.
+
+ /**
+ * Return an immutable host identifier. The host identifier shall be
+ * guranteed to be unique and constant for the life of the director.
+ */
+ String getID();
+
+ /**
+ * Return the name of the resource host. The value returned may be used
to uniquely
+ * identify the host within the set of managed hosts.
+ */
+ String getHostName();
+
+ /**
+ * Return the host base url.
+ * @return the base url
+ */
+ URL getBaseURL();
+
+ /**
+ * Return index url.
+ * @return the index url
+ */
+ String getIndexURL();
+
+ /**
+ * Return the enabled status of the host.
+ * @return TRUE if enabled
+ */
+ boolean getEnabled();
+
+ /**
+ * Return the trusted status.
+ * @return TRUE if trusted
+ */
+ boolean getTrusted();
+
+ /**
+ * Return the host authenticator.
+ * @return the authenticator
+ */
+ public Authenticator getAuthenticator();
+
+ /**
+ * Return the location resolver plugin uri.
+ * @return the uri of the location resolver plugin
+ */
+ URI getLocationResolverPluginURI();
+
+ /**
+ * Add a host change listener to the director.
+ * @param listener the host change listener to add
+ */
+ void addHostListener( HostListener listener );
+
+ /**
+ * Remove a host change listener from the director.
+ * @param listener the host change listener to remove
+ */
+ void removeHostListener( HostListener listener );
+}
+

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostListener.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostListener.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.util.EventListener;
+
+/**
+ * The HostListener is an interface implmented by resource host
+ * implementation. The interface declares a single host change notification
+ * method that is invoked by a host director signalling one or more changes
+ * to the host configuration.
+ */
+public interface HostListener extends EventListener
+{
+ /**
+ * Notify a consumer of an aggregated set of changes.
+ * @param event the host change event
+ */
+ void hostChanged( HostChangedEvent event );
+}
+

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostRemovedEvent.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostRemovedEvent.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.util.EventObject;
+
+public class HostRemovedEvent extends EventObject
+{
+ private final HostDirector m_host;
+
+ public HostRemovedEvent( Object source, HostDirector host )
+ {
+ super( source );
+
+ m_host = host;
+ }
+
+ public HostDirector getHostDirector()
+ {
+ return m_host;
+ }
+}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginChangeEvent.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginChangeEvent.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.net.URI;
+import java.util.EventObject;
+
+public class PluginChangeEvent extends EventObject
+{
+ private final URI m_plugin;
+
+ public PluginChangeEvent( Object source, URI plugin )
+ {
+ super( source );
+
+ m_plugin = plugin;
+ }
+
+ public URI getPluginURI()
+ {
+ return m_plugin;
+ }
+}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitDirector.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitDirector.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005 Stephen McConnell
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+/**
+ * The TransitDirector is an interface implemented by objects that
+ * manage the configuration of a running transit system.
+ */
+public interface TransitDirector
+{
+ /**
+ * Add a listener to the director. The listener will be
+ * notified of changes to the cache handler plugin uri and
+ * content handler uri.
+ *
+ * @param listener the listener to add
+ */
+ void addTransitListener( TransitListener listener );
+
+ /**
+ * Remove a listener from the director.
+ *
+ * @param listener the listener to remove
+ */
+ void removeTransitListener( TransitListener listener );
+}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitListener.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitListener.java
Sun May 15 17:44:03 2005
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005 Stephen McConnell
+ *
+ * Licensed 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.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.util.EventListener;
+
+/**
+ * A TransitDirector maintains information about the configuration of a
Transit
+ * system. An implementation of this interface would be supplied to an
object
+ * controlling the Transit cache and content management sub-systems.
+ */
+public interface TransitListener extends EventListener
+{
+ /**
+ * Notification of the change to the cache handler plugin.
+ * @param event a plugin change event
+ */
+ void cachePluginChanged( PluginChangeEvent event );
+
+ /**
+ * Notification of the change to the content handler plugin.
+ * @param event a plugin change event
+ */
+ void contentPluginChanged( PluginChangeEvent event );
+
+}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/repository/Repository.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/repository/Repository.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/repository/Repository.java
Sun May 15 17:44:03 2005
@@ -31,13 +31,19 @@
public interface Repository
{
/**
+ * Return the singleton repository instance.
+ * @return the repository
+ */
+ Repository getRepository();
+
+ /**
* Creates a plugin descriptor from an artifact.
*
* @param uri the artifact reference to the plugin descriptor
* @return the plugin descriptor
* @exception IOException if a factory creation error occurs
*/
- public Plugin getPluginDescriptor( URI uri )
+ Plugin getPluginDescriptor( URI uri )
throws IOException;

/**

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/repository/StandardLoader.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/repository/StandardLoader.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/repository/StandardLoader.java
Sun May 15 17:44:03 2005
@@ -77,6 +77,15 @@
//
------------------------------------------------------------------------

/**
+ * Return the repository instance.
+ * @return the repository
+ */
+ public Repository getRepository()
+ {
+ return this; // TODO wrap me in a proxy
+ }
+
+ /**
* Return the repository monitor router.
* @return the router
*/



  • svn commit: r2562 - in development/main/transit/core/handler/src/main/net/dpml/transit: configuration repository, mcconnell, 05/15/2005

Archive powered by MHonArc 2.6.24.

Top of Page