Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorafinkbein2009-01-14 23:31:40 +0000
committerafinkbein2009-01-14 23:31:40 +0000
commit86b8d9d6b73ddea96f77bc854ada495741025a0d (patch)
tree805ffcabcdafc5f49739d9727184c047a8f12017
parentd1e2bf082cb6537514e0f77dcb0b606be5b8ac9f (diff)
downloadorg.eclipse.osee-86b8d9d6b73ddea96f77bc854ada495741025a0d.tar.gz
org.eclipse.osee-86b8d9d6b73ddea96f77bc854ada495741025a0d.tar.xz
org.eclipse.osee-86b8d9d6b73ddea96f77bc854ada495741025a0d.zip
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.classpath7
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.project28
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/META-INF/MANIFEST.MF16
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/build.properties5
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/plugin.xml6
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/schema/org.eclipse.osee.connection.service.ext.exsd102
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/Activator.java75
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/ConnectionServiceImpl.java126
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/EventNotifier.java75
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectionService.java43
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorContributor.java6
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorFilter.java13
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorListener.java24
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IFileKey.java14
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IServiceConnector.java69
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IServicePropertyChangeListener.java15
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/LocalConnector.java133
-rw-r--r--MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/LocalFileKey.java27
19 files changed, 788 insertions, 0 deletions
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.classpath b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.classpath
new file mode 100644
index 00000000000..02159672985
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.project b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.project
new file mode 100644
index 00000000000..ebc756852db
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.ote.connection.service</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.settings/org.eclipse.pde.core.prefs b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 00000000000..32708001733
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+#Tue Aug 19 15:32:58 MST 2008
+eclipse.preferences.version=1
+pluginProject.extensions=true
+resolve.requirebundle=false
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/META-INF/MANIFEST.MF b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..c45b60c1763
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Service Plug-in
+Bundle-SymbolicName: org.eclipse.osee.ote.connection.service;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.osee.connection.service.Activator
+Bundle-Vendor: Boeing
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.osee.framework.logging,
+ org.osgi.framework;version="1.3.0",
+ org.osgi.util.tracker;version="1.3.1"
+Export-Package: org.eclipse.osee.connection.service
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.eclipse.equinox.ds;bundle-version="1.0.0",
+ org.eclipse.osee.framework.jdk.core;bundle-version="0.4.0",
+ org.eclipse.osee.framework.plugin.core;bundle-version="0.4.0"
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/build.properties b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/build.properties
new file mode 100644
index 00000000000..6f20375d6c7
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/plugin.xml b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/plugin.xml
new file mode 100644
index 00000000000..fa5a2c3223d
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/plugin.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="org.eclipse.osee.connection.service.ext" name="Connection Service Extension" schema="schema/org.eclipse.osee.connection.service.ext.exsd"/>
+
+</plugin>
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/schema/org.eclipse.osee.connection.service.ext.exsd b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/schema/org.eclipse.osee.connection.service.ext.exsd
new file mode 100644
index 00000000000..5d3f994f132
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/schema/org.eclipse.osee.connection.service.ext.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.osee.ote.connection.service" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.osee.ote.connection.service" id="org.eclipse.osee.connection.service.ext" name="Connection Service Extension"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="ConnectorContribution"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="ConnectorContribution">
+ <complexType>
+ <attribute name="className" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.osee.connection.service.IConnectorContributor"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/Activator.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/Activator.java
new file mode 100644
index 00000000000..96c5e563870
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/Activator.java
@@ -0,0 +1,75 @@
+package org.eclipse.osee.connection.service;
+
+import java.util.List;
+import java.util.logging.Level;
+
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class Activator implements BundleActivator {
+
+ private ConnectionServiceImpl service;
+ private ServiceTracker connectionServiceTracker;
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ service = new ConnectionServiceImpl();
+
+ // register the service
+ context.registerService(IConnectionService.class.getName(), service,
+ null);
+
+ // create a tracker and track the service
+ connectionServiceTracker = new ServiceTracker(context,
+ IConnectionService.class.getName(), null);
+ connectionServiceTracker.open();
+
+ ExtensionDefinedObjects<IConnectorContributor> definedObjects = new ExtensionDefinedObjects<IConnectorContributor>(
+ "org.eclipse.osee.connection.service.ext",
+ "ConnectorContribution", "className");
+ try {
+ List<IConnectorContributor> contributors = definedObjects
+ .getObjects();
+ for (IConnectorContributor contributor : contributors) {
+ try {
+ contributor.init();
+ } catch (Exception e) {
+ log(Level.SEVERE,
+ "exception initializing connector contributor", e);
+ }
+ }
+ } catch (Exception ex) {
+ log(
+ Level.SEVERE,
+ "failed to process OTE runtime library provider extensions",
+ ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ // close the service tracker
+ connectionServiceTracker.close();
+ connectionServiceTracker = null;
+ service.stop();
+ service = null;
+ }
+
+ public static void log(Level level, String message, Throwable t) {
+ OseeLog.log(Activator.class, level, message, t);
+ }
+
+ public static void log(Level level, String message) {
+ log(level, message, null);
+ }
+
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/ConnectionServiceImpl.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/ConnectionServiceImpl.java
new file mode 100644
index 00000000000..2d70331b2dd
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/ConnectionServiceImpl.java
@@ -0,0 +1,126 @@
+package org.eclipse.osee.connection.service;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.logging.Level;
+
+class ConnectionServiceImpl implements IConnectionService {
+
+ private final HashSet<IServiceConnector> connectors = new HashSet<IServiceConnector>();
+ private final EventNotifier eventNotifier = new EventNotifier();
+
+ private boolean isStopped = false;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IConnectionService#addConnector(org.eclipse.osee.connection.service.IServiceConnector)
+ */
+ @Override
+ public void addConnector(IServiceConnector connector) {
+ addConnectors(Collections.singletonList(connector));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IConnectionService#addConnectors(java.util.Collection)
+ */
+ @Override
+ public synchronized void addConnectors(Collection<IServiceConnector> connectors) {
+ checkState();
+ this.connectors.addAll(connectors);
+ eventNotifier.notifyConnectorsAdded(connectors);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IConnectionService#addListener(org.eclipse.osee.connection.service.IConnectorListener)
+ */
+ @Override
+ public synchronized void addListener(IConnectorListener listener) {
+ checkState();
+ eventNotifier.addListener(listener);
+ listener.onConnectorsAdded(connectors);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IConnectionService#findConnectors(java.lang.String)
+ */
+ @Override
+ public synchronized List<IServiceConnector> findConnectors(IConnectorFilter[] filterChain) {
+ checkState();
+ ArrayList<IServiceConnector> matchingConnectors = new ArrayList<IServiceConnector>();
+ for (IServiceConnector connector : connectors) {
+ boolean accepted = true;
+ for (IConnectorFilter filter : filterChain) {
+ if (!filter.accept(connector)) {
+ accepted = false;
+ break;
+ }
+ }
+ if (accepted) {
+ matchingConnectors.add(connector);
+ }
+ }
+ return matchingConnectors;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IConnectionService#getAllConnectors()
+ */
+ @Override
+ public synchronized Collection<IServiceConnector> getAllConnectors() {
+ checkState();
+ return connectors;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IConnectionService#removeConnector(org.eclipse.osee.connection.service.IServiceConnector)
+ */
+ @Override
+ public synchronized void removeConnector(IServiceConnector connector) throws Exception {
+ checkState();
+ if (connectors.remove(connector)) {
+ eventNotifier.notifyConnectorRemoved(connector);
+ connector.stop();
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IConnectionService#removeListener(org.eclipse.osee.connection.service.IConnectorListener)
+ */
+ @Override
+ public synchronized void removeListener(IConnectorListener listener) {
+ checkState();
+ eventNotifier.removeListener(listener);
+ }
+
+ void stop() {
+ isStopped = true;
+ eventNotifier.notifyServiceStopped();
+ for (IServiceConnector connector : connectors) {
+ try {
+ connector.stop();
+ } catch (Exception ex) {
+ Activator.log(Level.SEVERE,
+ "Exception notifying listener of service stop", ex);
+ }
+ }
+ connectors.clear();
+ }
+
+ private void checkState() throws IllegalStateException {
+ if (isStopped) {
+ throw new IllegalStateException("service has been stopped");
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IConnectionService#isStopped()
+ */
+ @Override
+ public boolean isStopped() {
+ return isStopped;
+ }
+
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/EventNotifier.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/EventNotifier.java
new file mode 100644
index 00000000000..9c727d7203b
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/EventNotifier.java
@@ -0,0 +1,75 @@
+package org.eclipse.osee.connection.service;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.logging.Level;
+
+public class EventNotifier {
+
+ private final ExecutorService executorService = Executors
+ .newCachedThreadPool();
+
+ private final CopyOnWriteArrayList<IConnectorListener> connectorListener = new CopyOnWriteArrayList<IConnectorListener>();
+
+ void notifyConnectorsAdded(final Collection<IServiceConnector> connectors) {
+ executorService.submit(new Runnable() {
+ // copy the collection of new connectors
+ final ArrayList<IServiceConnector> newConnectors = new ArrayList<IServiceConnector>(
+ connectors);
+ @Override
+ public void run() {
+ for (IConnectorListener listener : connectorListener) {
+ try {
+ listener.onConnectorsAdded(newConnectors);
+ } catch (Exception e) {
+ Activator
+ .log(
+ Level.SEVERE,
+ "Error processing listeners for connector added event",
+ e);
+ }
+ }
+ }
+ });
+
+ }
+
+ void notifyConnectorRemoved(final IServiceConnector connector) {
+ executorService.submit(new Runnable() {
+
+ @Override
+ public void run() {
+ for (IConnectorListener listener : connectorListener) {
+ try {
+ listener.onConnectorRemoved(connector);
+ } catch (Exception e) {
+ Activator
+ .log(
+ Level.SEVERE,
+ "Error processing listeners for connector remove event",
+ e);
+ }
+ }
+ }
+
+ });
+
+ }
+
+ void notifyServiceStopped() {
+ for (IConnectorListener listener : connectorListener) {
+ listener.onConnectionServiceStopped();
+ }
+ }
+
+ void addListener(IConnectorListener listener) {
+ connectorListener.add(listener);
+ }
+
+ void removeListener(IConnectorListener listener) {
+ connectorListener.remove(listener);
+ }
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectionService.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectionService.java
new file mode 100644
index 00000000000..e35bc144087
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectionService.java
@@ -0,0 +1,43 @@
+package org.eclipse.osee.connection.service;
+
+import java.util.Collection;
+
+/**
+ * @author Ken J. Aguilar
+ */
+public interface IConnectionService {
+
+ /**
+ * finds all currently existing connectors
+ *
+ * @return
+ */
+ Collection<IServiceConnector> getAllConnectors();
+
+ /**
+ * finds all available connectors that are accepted by all filters in the filter chain
+ *
+ * @param pattern
+ * @param filterChain
+ * @return
+ */
+ Collection<IServiceConnector> findConnectors(IConnectorFilter[] filterChain);
+
+ /**
+ * registers an listener object for notification of connector events. Note that the listener object's
+ * {@link IConnectorListener#onConnectorsAdded(Collection)} will be called immediately for each active connector.
+ *
+ * @param listener
+ */
+ void addListener(IConnectorListener listener);
+
+ void removeListener(IConnectorListener listener);
+
+ void addConnector(IServiceConnector connector);
+
+ void addConnectors(Collection<IServiceConnector> connectors);
+
+ void removeConnector(IServiceConnector connector) throws Exception;
+
+ boolean isStopped();
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorContributor.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorContributor.java
new file mode 100644
index 00000000000..96bb304cb8a
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorContributor.java
@@ -0,0 +1,6 @@
+package org.eclipse.osee.connection.service;
+
+public interface IConnectorContributor {
+
+ void init() throws Exception;
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorFilter.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorFilter.java
new file mode 100644
index 00000000000..90e5a531c7e
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorFilter.java
@@ -0,0 +1,13 @@
+/*
+ * Created on May 12, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.connection.service;
+
+/**
+ * @author b1529404
+ */
+public interface IConnectorFilter {
+ public boolean accept(IServiceConnector connector);
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorListener.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorListener.java
new file mode 100644
index 00000000000..240a97febcf
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IConnectorListener.java
@@ -0,0 +1,24 @@
+/*
+ * Created on May 1, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.connection.service;
+
+import java.util.Collection;
+
+/**
+ * @author b1529404
+ */
+public interface IConnectorListener {
+
+ void onConnectorsAdded(Collection<IServiceConnector> connectors);
+
+ void onConnectorRemoved(IServiceConnector connector);
+
+ /**
+ * this method will be called when the connect service has been commanded to stop but before it is actually stopped.
+ * this gives clients a chance to cleanup however, clients should not call any methods on the service.
+ */
+ void onConnectionServiceStopped();
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IFileKey.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IFileKey.java
new file mode 100644
index 00000000000..d79555ca492
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IFileKey.java
@@ -0,0 +1,14 @@
+/*
+ * Created on Jul 15, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.connection.service;
+
+/**
+ * @author b1529404
+ *
+ */
+public interface IFileKey {
+
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IServiceConnector.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IServiceConnector.java
new file mode 100644
index 00000000000..1c6e46cd6a4
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IServiceConnector.java
@@ -0,0 +1,69 @@
+/*
+ * Created on May 1, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.connection.service;
+
+import java.io.File;
+import java.io.Serializable;
+import java.net.URI;
+import java.rmi.server.ExportException;
+
+/**
+ * Provides a communication pipe to a service.
+ *
+ * @author Ken J. Aguilar
+ */
+public interface IServiceConnector {
+
+ String getConnectorType();
+
+ /**
+ * gets the service provided by this connector
+ *
+ * @return
+ */
+ Object getService();
+
+ void setProperty(String key, Serializable value);
+
+ Serializable getProperty(String property, Serializable defaultValue);
+
+ void stop() throws Exception;
+
+ /**
+ * makes the callback accessible by this connector's service
+ *
+ * @param callback
+ * @return
+ * @throws Exception
+ */
+ Object export(Object callback) throws ExportException;
+
+ /**
+ * finds the matching exported representation of supplied object
+ *
+ * @param callback
+ * @return
+ * @throws Exception
+ */
+ Object findExport(Object callback);
+
+ void unexport(Object callback) throws Exception;
+
+ void addPropertyChangeListener(IServicePropertyChangeListener listener);
+
+ void removePropertyChangeListener(IServicePropertyChangeListener listener);
+
+ /**
+ * uploads a file to a service and creates an {@link URI} that the service can access.
+ *
+ * @param file
+ * @return
+ * @throws Exception
+ */
+ URI upload(File file) throws Exception;
+
+ boolean ping();
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IServicePropertyChangeListener.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IServicePropertyChangeListener.java
new file mode 100644
index 00000000000..0a388d6168a
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/IServicePropertyChangeListener.java
@@ -0,0 +1,15 @@
+/*
+ * Created on Jul 1, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.connection.service;
+
+import java.io.Serializable;
+
+/**
+ * @author b1529404
+ */
+public interface IServicePropertyChangeListener {
+ void propertyChanged(IServiceConnector connector, String key, Serializable value);
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/LocalConnector.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/LocalConnector.java
new file mode 100644
index 00000000000..1a9aa6ed9bb
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/LocalConnector.java
@@ -0,0 +1,133 @@
+/*
+ * Created on May 2, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.connection.service;
+
+import java.io.File;
+import java.io.Serializable;
+import java.net.URI;
+import java.rmi.server.ExportException;
+import java.util.HashSet;
+
+import org.eclipse.osee.framework.jdk.core.util.EnhancedProperties;
+
+/**
+ * @author b1529404
+ */
+public class LocalConnector implements IServiceConnector {
+ public static final String TYPE = "local";
+ private final Object service;
+ private final EnhancedProperties properties;
+
+ private final HashSet<IServicePropertyChangeListener> propertyChangeListeners =
+ new HashSet<IServicePropertyChangeListener>();
+
+ /**
+ * @param service
+ * @param properties
+ */
+ public LocalConnector(Object service, EnhancedProperties properties) {
+ this.service = service;
+ this.properties = properties;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IServiceConnector#getService()
+ */
+ @Override
+ public Object getService() {
+ return service;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IServiceConnector#stop()
+ */
+ @Override
+ public void stop() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IServiceConnector#getType()
+ */
+ @Override
+ public String getConnectorType() {
+ return TYPE;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IServiceConnector#setProperty(java.lang.String, java.lang.String)
+ */
+ @Override
+ public void setProperty(String key, Serializable value) {
+ properties.setProperty(key, value);
+ for (IServicePropertyChangeListener listener : propertyChangeListeners) {
+ listener.propertyChanged(this, key, value);
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IServiceConnector#getProperty(java.lang.String, java.lang.String)
+ */
+ @Override
+ public Serializable getProperty(String property, Serializable defaultValue) {
+ return properties.getProperty(property, defaultValue);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IServiceConnector#export(java.lang.Object)
+ */
+ @Override
+ public Object export(Object callback) throws ExportException {
+ return callback;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IServiceConnector#unexport(java.lang.Object)
+ */
+ @Override
+ public void unexport(Object callback) throws Exception {
+ }
+
+
+ @Override
+ public Object findExport(Object callback) {
+ return callback;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.osee.connection.service.IServiceConnector#
+ * addPropertyChangeListener
+ * (org.eclipse.osee.connection.service.IServicePropertyChangeListener)
+ */
+ @Override
+ public void addPropertyChangeListener(IServicePropertyChangeListener listener) {
+ propertyChangeListeners.add(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IServiceConnector#removePropertyChangeListener(org.eclipse.osee.connection.service.IServicePropertyChangeListener)
+ */
+ @Override
+ public void removePropertyChangeListener(IServicePropertyChangeListener listener) {
+ propertyChangeListeners.remove(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.connection.service.IServiceConnector#upload(java.io.File)
+ */
+ @Override
+ public URI upload(File file) throws Exception {
+ return file.toURI();
+ }
+
+ @Override
+ public boolean ping() {
+ return true;
+ }
+
+}
diff --git a/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/LocalFileKey.java b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/LocalFileKey.java
new file mode 100644
index 00000000000..dc2fdce3255
--- /dev/null
+++ b/MS_0.6.0_20090114/org.eclipse.osee.ote.connection.service/src/org/eclipse/osee/connection/service/LocalFileKey.java
@@ -0,0 +1,27 @@
+/*
+ * Created on Jul 15, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.connection.service;
+
+import java.io.File;
+
+/**
+ * @author b1529404
+ */
+class LocalFileKey implements IFileKey {
+
+ private final File file;
+
+ /**
+ * @param file
+ */
+ LocalFileKey(File file) {
+ this.file = file;
+ }
+
+ File getFile() {
+ return file;
+ }
+}

Back to the top