Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2013-12-01 21:51:18 -0500
committerslewis2013-12-01 21:51:18 -0500
commita514f32f7f00749b3cfb46d0337fd09fa817a2a0 (patch)
treef1a76accf1a064e31e03e58a05b01bdaddd9bb01 /incubation
parent5f9697ede095918e7b4d9a31599c4d2032c4388c (diff)
downloadorg.eclipse.ecf-a514f32f7f00749b3cfb46d0337fd09fa817a2a0.tar.gz
org.eclipse.ecf-a514f32f7f00749b3cfb46d0337fd09fa817a2a0.tar.xz
org.eclipse.ecf-a514f32f7f00749b3cfb46d0337fd09fa817a2a0.zip
Deleted most contents from plugin
Diffstat (limited to 'incubation')
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.classpath1
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/META-INF/MANIFEST.MF11
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/build.properties4
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0-javadoc.jarbin524040 -> 0 bytes
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0-sources.jarbin161959 -> 0 bytes
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0.jarbin146728 -> 0 bytes
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/plugin.xml21
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/AbstractPahoConnection.java365
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/AsyncPahoMessage.java15
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/ConnectRequestMessage.java16
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientConnection.java51
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainer.java30
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainerInstantiator.java17
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoDebugOptions.java8
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoMessage.java62
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoServerConnection.java28
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoServerContainer.java12
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/SyncRequestMessage.java15
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/SyncResponseMessage.java15
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoID.java27
-rw-r--r--incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoNamespace.java36
21 files changed, 2 insertions, 732 deletions
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.classpath b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.classpath
index 6a120755a..64c5e31b7 100644
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.classpath
+++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.classpath
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry exported="true" kind="lib" path="lib/mqtt-client-0.4.0.jar" sourcepath="lib/mqtt-client-0.4.0-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/META-INF/MANIFEST.MF b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/META-INF/MANIFEST.MF
index a7504612b..7ba8ad892 100644
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/META-INF/MANIFEST.MF
+++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/META-INF/MANIFEST.MF
@@ -8,13 +8,4 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Require-Bundle: org.eclipse.equinox.common;bundle-version="3.6.200"
-Bundle-ClassPath: lib/mqtt-client-0.4.0.jar,
- .
-Import-Package: org.eclipse.ecf.core;version="3.0.0",
- org.eclipse.ecf.core.identity;version="3.2.0",
- org.eclipse.ecf.core.provider;version="3.1.0",
- org.eclipse.ecf.core.sharedobject;version="2.3.0",
- org.eclipse.ecf.core.util;version="3.2.0",
- org.eclipse.ecf.provider.comm;version="4.3.0",
- org.eclipse.ecf.provider.comm.tcp;version="4.3.0",
- org.eclipse.ecf.provider.generic;version="4.3.0"
+Bundle-ClassPath: .
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/build.properties b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/build.properties
index 00a23e8dc..aa1a00826 100644
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/build.properties
+++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/build.properties
@@ -2,6 +2,4 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.properties,\
- lib/mqtt-client-0.4.0.jar,\
- plugin.xml
+ plugin.properties
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0-javadoc.jar b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0-javadoc.jar
deleted file mode 100644
index 6f2914f00..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0-javadoc.jar
+++ /dev/null
Binary files differ
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0-sources.jar b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0-sources.jar
deleted file mode 100644
index a3dc6516b..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0-sources.jar
+++ /dev/null
Binary files differ
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0.jar b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0.jar
deleted file mode 100644
index 8f1d92faa..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0.jar
+++ /dev/null
Binary files differ
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/plugin.xml b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/plugin.xml
deleted file mode 100644
index 729708f95..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/plugin.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.ecf.identity.namespace">
- <namespace
- class="org.eclipse.ecf.provider.mqtt.paho.identity.PahoNamespace"
- description="PahoID Namespace"
- name="org.eclipse.provider.paho.namespace">
- </namespace>
- </extension>
- <extension
- point="org.eclipse.ecf.containerFactory">
- <containerFactory
- class="org.eclipse.ecf.provider.mqtt.paho.container.PahoClientContainerInstantiator"
- name="ecf.mqtt.paho.container.client"
- server="false">
- </containerFactory>
- </extension>
-
-</plugin>
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/AbstractPahoConnection.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/AbstractPahoConnection.java
deleted file mode 100644
index e0ff378b1..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/AbstractPahoConnection.java
+++ /dev/null
@@ -1,365 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.util.ECFException;
-import org.eclipse.ecf.core.util.Trace;
-import org.eclipse.ecf.provider.comm.AsynchEvent;
-import org.eclipse.ecf.provider.comm.ConnectionEvent;
-import org.eclipse.ecf.provider.comm.DisconnectEvent;
-import org.eclipse.ecf.provider.comm.IConnectionListener;
-import org.eclipse.ecf.provider.comm.ISynchAsynchConnection;
-import org.eclipse.ecf.provider.comm.ISynchAsynchEventHandler;
-import org.eclipse.ecf.provider.mqtt.paho.identity.PahoID;
-import org.eclipse.ecf.provider.mqtt.paho.identity.PahoNamespace;
-import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
-import org.eclipse.paho.client.mqttv3.MqttCallback;
-import org.eclipse.paho.client.mqttv3.MqttClient;
-import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
-import org.eclipse.paho.client.mqttv3.MqttException;
-import org.eclipse.paho.client.mqttv3.MqttMessage;
-
-public abstract class AbstractPahoConnection implements
-ISynchAsynchConnection {
-
- protected PahoID clientID;
- protected MqttClient client;
- protected String mqttTopic;
- protected boolean connected;
- protected boolean started;
- protected List<IConnectionListener> connectionListeners = new ArrayList<IConnectionListener>();
- protected ISynchAsynchEventHandler handler;
-
- protected void fireListenersConnect(ConnectionEvent event) {
- List<IConnectionListener> toNotify = null;
- synchronized (connectionListeners) {
- toNotify = new ArrayList<IConnectionListener>(connectionListeners);
- }
- for (Iterator<IConnectionListener> i = toNotify.iterator(); i.hasNext();) {
- IConnectionListener l = (IConnectionListener) i.next();
- l.handleConnectEvent(event);
- }
- }
-
- protected void fireListenersDisconnect(DisconnectEvent event) {
- List<IConnectionListener> toNotify = null;
- synchronized (connectionListeners) {
- toNotify = new ArrayList<IConnectionListener>(connectionListeners);
- }
- for (Iterator<IConnectionListener> i = toNotify.iterator(); i.hasNext();) {
- IConnectionListener l = (IConnectionListener) i.next();
- l.handleDisconnectEvent(event);
- }
- }
-
- public void start() {
- this.started = true;
- }
-
- public void stop() {
- this.started = false;
- }
-
- public boolean isStarted() {
- return started;
- }
-
- protected boolean isActive() {
- return isConnected() && isStarted();
- }
-
- protected String getMqttTopic() {
- return this.mqttTopic;
- }
-
- public AbstractPahoConnection(PahoID clientID,
- ISynchAsynchEventHandler handler) {
- if (clientID == null)
- throw new IllegalArgumentException("clientID cannot be null");
- this.clientID = clientID;
- if (handler == null)
- throw new IllegalArgumentException("handler cannot be null");
- this.handler = handler;
- }
-
- protected MqttCallback callback = new MqttCallback() {
- public void connectionLost(Throwable cause) {
- handleConnectionLost(cause);
- }
-
- public void messageArrived(String topic, MqttMessage message)
- throws Exception {
- handleMessageArrived(topic, message);
- }
-
- public void deliveryComplete(IMqttDeliveryToken token) {
- handleDeliveryComplete(token);
- }
- };
-
- protected void handleConnectionLost(Throwable cause) {
- // xxx todo
- }
-
- protected void handleDeliveryComplete(IMqttDeliveryToken token) {
- // TODO Auto-generated method stub
- }
-
- protected synchronized void connectAndSubscribe(PahoID targetID,
- MqttConnectOptions opts) throws ECFException {
- // Create client
- try {
- this.client = new MqttClient(targetID.getServerURI(),
- targetID.getClientId());
- // Set callback
- this.client.setCallback(callback);
- // Connect to broker with connectOpts
- if (opts == null)
- this.client.connect();
- else
- this.client.connect(opts);
- // Subscribe to topic
- this.client.subscribe(targetID.getClientId());
- this.connected = true;
- } catch (MqttException e) {
- throw new ECFException("Could not connect to targetID"
- + targetID.getName());
- }
- }
-
- @SuppressWarnings("rawtypes")
- public Map getProperties() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ecf.core.comm.IConnection#addCommEventListener(org.eclipse
- * .ecf.core.comm.IConnectionListener)
- */
- public void addListener(IConnectionListener listener) {
- connectionListeners.add(listener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ecf.core.comm.IConnection#removeCommEventListener(org.eclipse
- * .ecf.core.comm.IConnectionListener)
- */
- public void removeListener(IConnectionListener listener) {
- connectionListeners.remove(listener);
- }
-
- public ID getLocalID() {
- return clientID;
- }
-
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- protected MqttConnectOptions createConnectionOptions(ID targetID,
- Object data, int timeout) {
- MqttConnectOptions options = new MqttConnectOptions();
- options.setCleanSession(true);
- options.setConnectionTimeout(timeout);
- options.setKeepAliveInterval(timeout);
- return options;
- }
-
- public boolean isConnected() {
- return connected;
- }
-
- protected void publishMessage(PahoMessage message) throws IOException {
- try {
- this.client.publish(getMqttTopic(), message.toMqttMessage());
- } catch (MqttException e) {
- throw new IOException(e.getMessage(), e);
- }
- }
-
- public synchronized void disconnect() {
- if (isConnected()) {
- try {
- this.client.disconnect();
- } catch (MqttException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- this.client = null;
- this.connected = false;
- }
- }
-
- public synchronized void sendAsynch(ID receiver, byte[] data)
- throws IOException {
- if (!isActive())
- throw new IOException("PahoConnection not connected");
- if (receiver != null
- && !PahoNamespace.NAME
- .equals(receiver.getNamespace().getName()))
- throw new IOException("receiver not in PahoID namespace");
- publishMessage(new AsyncPahoMessage((PahoID) getLocalID(),
- (PahoID) receiver, data));
- }
-
- protected Object synch = new Object();
- protected boolean waitDone;
- protected Serializable reply;
- protected int connectWaitDuration = 15000;
-
- protected PahoID getLocalPahoID() {
- return (PahoID) getLocalID();
- }
-
- public Object sendSynch(ID receiver, byte[] data) throws IOException {
- if (!isActive())
- throw new IOException("PahoConnection not connected");
- if (receiver == null)
- throw new IOException("receiver id must not be null");
- if (receiver != null
- && !PahoNamespace.NAME
- .equals(receiver.getNamespace().getName()))
- throw new IOException("receiver not in PahoID namespace");
- return sendAndWait(new SyncRequestMessage(getLocalPahoID(),
- (PahoID) receiver, data), connectWaitDuration);
- }
-
- private String PLUGIN_ID = "org.eclipse.ecf.provider.mqtt.paho";
-
- protected void throwIOException(String method, String msg, Throwable t)
- throws IOException {
- Trace.throwing(PLUGIN_ID, PahoDebugOptions.EXCEPTIONS_CATCHING,
- this.getClass(), method, t);
- throw new IOException(msg + ": " + t.getMessage()); //$NON-NLS-1$
- }
-
- protected void traceAndLogExceptionCatch(int code, String method,
- Throwable e) {
- Trace.catching(PLUGIN_ID, PahoDebugOptions.EXCEPTIONS_CATCHING,
- this.getClass(), method, e);
- }
-
- private Serializable sendAndWait(SyncRequestMessage syncRequestMessage,
- int waitDuration) throws IOException {
- synchronized (synch) {
- try {
- waitDone = false;
- long waittimeout = System.currentTimeMillis() + waitDuration;
- reply = null;
- this.client.publish(getMqttTopic(),
- syncRequestMessage.toMqttMessage());
- while (!waitDone
- && (waittimeout - System.currentTimeMillis() > 0)) {
- synch.wait(waitDuration / 10);
- }
- waitDone = true;
- if (reply == null)
- throw new IOException("timeout waiting for response"); //$NON-NLS-1$
- } catch (MqttException e) {
- Trace.catching(PLUGIN_ID, PahoDebugOptions.EXCEPTIONS_CATCHING,
- this.getClass(), "sendAndWait", e); //$NON-NLS-1$
- throwIOException("sendAndWait", "MqttException in sendAndWait", //$NON-NLS-1$ //$NON-NLS-2$
- e);
- } catch (InterruptedException e) {
- traceAndLogExceptionCatch(IStatus.ERROR,
- "handleTopicMessage", e); //$NON-NLS-1$
- }
- return reply;
- }
- }
-
- protected void handleMessageArrived(String topic, MqttMessage message) {
- if (!isActive())
- return;
- if (topic.equals(this.getMqttTopic()))
- return;
- Object response = null;
- try {
- response = PahoMessage.deserialize(message.getPayload());
- if (response instanceof PahoMessage) {
- PahoMessage pahoMessage = (PahoMessage) response;
- PahoID fromID = pahoMessage.getFromID();
- if (fromID == null) {
- Trace.exiting(PLUGIN_ID, PahoDebugOptions.METHODS_ENTERING,
- this.getClass(),
- "fromID=null...ignoring PahoMessage " + pahoMessage); //$NON-NLS-1$
- return;
- }
- if (fromID.equals(getLocalID())) {
- Trace.exiting(
- PLUGIN_ID,
- PahoDebugOptions.METHODS_ENTERING,
- this.getClass(),
- "fromID=localID...ignoring PahoMessage " + pahoMessage); //$NON-NLS-1$
- return;
- }
- PahoID targetID = pahoMessage.getTargetID();
- if (targetID == null) {
- if (pahoMessage instanceof AsyncPahoMessage)
- handleTopicMessage((AsyncPahoMessage) pahoMessage);
- else
- Trace.trace(PLUGIN_ID,
- "onMessage.received invalid message to group"); //$NON-NLS-1$
- } else {
- if (targetID.equals(getLocalID())) {
- if (pahoMessage instanceof AsyncPahoMessage)
- handleTopicMessage((AsyncPahoMessage) pahoMessage);
- else if (pahoMessage instanceof SyncRequestMessage)
- handleSynchRequest((SyncRequestMessage) pahoMessage);
- else if (pahoMessage instanceof SyncResponseMessage)
- handleSynchResponse((SyncResponseMessage) pahoMessage);
- else
- Trace.trace(
- PLUGIN_ID,
- "onMessage.msg invalid message to " + targetID); //$NON-NLS-1$
- } else
- Trace.trace(
- PLUGIN_ID,
- "onMessage.msg " + pahoMessage + " not intended for " + targetID); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } else
- // received bogus message...ignore
- Trace.trace(
- PLUGIN_ID,
- "onMessage: received non-ECFMessage...ignoring " + response); //$NON-NLS-1$
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- protected void handleTopicMessage(AsyncPahoMessage message) {
- if (isActive()) {
- try {
- this.handler.handleAsynchEvent(new AsynchEvent(this,message.getData()));
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
-
- protected void handleSynchResponse(SyncResponseMessage pahoMessage) {
- synchronized (this.synch) {
- this.reply = pahoMessage.getData();
- this.waitDone = true;
- this.synch.notify();
- }
- }
-
- protected abstract void handleSynchRequest(SyncRequestMessage pahoMessage);
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/AsyncPahoMessage.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/AsyncPahoMessage.java
deleted file mode 100644
index 85faa4c54..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/AsyncPahoMessage.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import java.io.Serializable;
-
-import org.eclipse.ecf.provider.mqtt.paho.identity.PahoID;
-
-public class AsyncPahoMessage extends PahoMessage {
-
- private static final long serialVersionUID = -2538908397359614161L;
-
- public AsyncPahoMessage(PahoID fromID, PahoID targetID, Serializable data) {
- super(fromID, targetID, data);
- }
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/ConnectRequestMessage.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/ConnectRequestMessage.java
deleted file mode 100644
index c13150804..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/ConnectRequestMessage.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import java.io.IOException;
-
-import org.eclipse.ecf.provider.mqtt.paho.identity.PahoID;
-
-public class ConnectRequestMessage extends PahoMessage {
-
- private static final long serialVersionUID = 3750692684824242655L;
-
- public ConnectRequestMessage(PahoID fromID, PahoID targetID, Object data)
- throws IOException {
- super(fromID, targetID, serialize(data));
- }
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientConnection.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientConnection.java
deleted file mode 100644
index 63a0eb005..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientConnection.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import java.io.IOException;
-
-import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.util.ECFException;
-import org.eclipse.ecf.provider.comm.ISynchAsynchEventHandler;
-import org.eclipse.ecf.provider.comm.tcp.ConnectResultMessage;
-import org.eclipse.ecf.provider.mqtt.paho.identity.PahoID;
-import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
-
-public class PahoClientConnection extends AbstractPahoConnection {
-
- public PahoClientConnection(PahoID clientID,
- ISynchAsynchEventHandler handler) {
- super(clientID, handler);
- }
-
- public synchronized Object connect(ID targetID, Object data, int timeout)
- throws ECFException {
- if (targetID == null)
- throw new ECFException("targetID cannot be null");
- if (!(targetID instanceof PahoID))
- throw new ECFException("targetID must be in PahoID namespace");
- PahoID pahoTargetID = (PahoID) targetID;
-
- MqttConnectOptions connectOpts = createConnectionOptions(targetID,
- data, timeout);
-
- connectAndSubscribe(pahoTargetID, connectOpts);
- ConnectResultMessage response;
- try {
- response = (ConnectResultMessage) sendSynch(pahoTargetID,
- new ConnectRequestMessage((PahoID) getLocalID(),
- pahoTargetID, data).serialize());
- } catch (IOException e) {
- throw new ECFException("Could not connect to target=" + targetID, e);
- }
- if (response == null)
- throw new ECFException("Received null response from group manager");
-
- return response.getData();
- }
-
- @Override
- protected void handleSynchRequest(SyncRequestMessage pahoMessage) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainer.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainer.java
deleted file mode 100644
index df4f83c59..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainer.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.identity.IDFactory;
-import org.eclipse.ecf.core.identity.Namespace;
-import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerConfig;
-import org.eclipse.ecf.provider.comm.ConnectionCreateException;
-import org.eclipse.ecf.provider.comm.ISynchAsynchConnection;
-import org.eclipse.ecf.provider.generic.ClientSOContainer;
-import org.eclipse.ecf.provider.mqtt.paho.identity.PahoNamespace;
-
-public class PahoClientContainer extends ClientSOContainer {
-
- public PahoClientContainer(ISharedObjectContainerConfig config) {
- super(config);
- }
-
- @Override
- public Namespace getConnectNamespace() {
- return IDFactory.getDefault().getNamespaceByName(PahoNamespace.NAME);
- }
-
- @Override
- protected ISynchAsynchConnection createConnection(ID targetID, Object data)
- throws ConnectionCreateException {
- // XXX todo
- return null;
- }
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainerInstantiator.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainerInstantiator.java
deleted file mode 100644
index f17ef61fd..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainerInstantiator.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import org.eclipse.ecf.core.ContainerCreateException;
-import org.eclipse.ecf.core.ContainerTypeDescription;
-import org.eclipse.ecf.core.IContainer;
-import org.eclipse.ecf.core.provider.BaseRemoteServiceContainerInstantiator;
-
-public class PahoClientContainerInstantiator extends
- BaseRemoteServiceContainerInstantiator {
-
- public IContainer createInstance(ContainerTypeDescription description,
- Object[] parameters) throws ContainerCreateException {
- // XXX todo
- return null;
- }
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoDebugOptions.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoDebugOptions.java
deleted file mode 100644
index 72e22a645..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoDebugOptions.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-public interface PahoDebugOptions {
-
- public static String EXCEPTIONS_CATCHING = "exceptions catching";
- public static String METHODS_ENTERING = "methods entering";
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoMessage.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoMessage.java
deleted file mode 100644
index d126d9fcb..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoMessage.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-import org.eclipse.ecf.provider.mqtt.paho.identity.PahoID;
-import org.eclipse.paho.client.mqttv3.MqttMessage;
-
-public class PahoMessage implements Serializable {
-
- private static final long serialVersionUID = -8768793858838034483L;
-
- private PahoID fromID;
- private PahoID targetID;
- private Serializable data;
-
- public static byte[] serialize(Object object) throws IOException {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(bos);
- oos.writeObject(object);
- return bos.toByteArray();
- }
-
- public static Object deserialize(byte[] bytes) throws IOException,
- ClassNotFoundException {
- ObjectInputStream oos = new ObjectInputStream(new ByteArrayInputStream(
- bytes));
- return oos.readObject();
- }
-
- public PahoMessage(PahoID fromID, PahoID targetID, Serializable data) {
- if (fromID == null)
- throw new IllegalArgumentException("fromID cannot be null");
- this.fromID = fromID;
- this.targetID = targetID;
- this.data = data;
- }
-
- public PahoID getFromID() {
- return this.fromID;
- }
-
- public PahoID getTargetID() {
- return this.targetID;
- }
-
- public Serializable getData() {
- return this.data;
- }
-
- public byte[] serialize() throws IOException {
- return serialize(this);
- }
-
- public MqttMessage toMqttMessage() throws IOException {
- return new MqttMessage(serialize());
- }
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoServerConnection.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoServerConnection.java
deleted file mode 100644
index 9b061f1a6..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoServerConnection.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.util.ECFException;
-import org.eclipse.ecf.provider.comm.ISynchAsynchConnection;
-import org.eclipse.ecf.provider.comm.ISynchAsynchEventHandler;
-import org.eclipse.ecf.provider.mqtt.paho.identity.PahoID;
-
-public class PahoServerConnection extends AbstractPahoConnection implements
- ISynchAsynchConnection {
-
- public PahoServerConnection(PahoID clientID,
- ISynchAsynchEventHandler handler) {
- super(clientID, handler);
- }
-
- public synchronized Object connect(ID targetID, Object data, int timeout)
- throws ECFException {
- throw new ECFException("Server cannot be connected");
- }
-
- @Override
- protected void handleSynchRequest(SyncRequestMessage pahoMessage) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoServerContainer.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoServerContainer.java
deleted file mode 100644
index 0f817ca1a..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoServerContainer.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerConfig;
-import org.eclipse.ecf.provider.generic.ServerSOContainer;
-
-public class PahoServerContainer extends ServerSOContainer {
-
- public PahoServerContainer(ISharedObjectContainerConfig config) {
- super(config);
- }
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/SyncRequestMessage.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/SyncRequestMessage.java
deleted file mode 100644
index 93936ab93..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/SyncRequestMessage.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import java.io.Serializable;
-
-import org.eclipse.ecf.provider.mqtt.paho.identity.PahoID;
-
-public class SyncRequestMessage extends PahoMessage {
-
- private static final long serialVersionUID = 9073885283936597534L;
-
- public SyncRequestMessage(PahoID fromID, PahoID targetID, Serializable data) {
- super(fromID, targetID, data);
- }
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/SyncResponseMessage.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/SyncResponseMessage.java
deleted file mode 100644
index 7b76fb174..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/SyncResponseMessage.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.container;
-
-import java.io.Serializable;
-
-import org.eclipse.ecf.provider.mqtt.paho.identity.PahoID;
-
-public class SyncResponseMessage extends PahoMessage {
-
- private static final long serialVersionUID = 4085439339371979310L;
-
- public SyncResponseMessage(PahoID fromID, PahoID targetID, Serializable data) {
- super(fromID, targetID, data);
- }
-
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoID.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoID.java
deleted file mode 100644
index 2f2e1e628..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoID.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.identity;
-
-import org.eclipse.ecf.core.identity.Namespace;
-import org.eclipse.ecf.core.identity.StringID;
-
-public class PahoID extends StringID {
-
- private static final long serialVersionUID = 9124480553723803576L;
-
- public PahoID(Namespace n, String s) {
- super(n, s);
- }
-
- public String getServerURI() {
- return null;
- }
-
- public String getClientId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTopic() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoNamespace.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoNamespace.java
deleted file mode 100644
index 1ba5a5bbf..000000000
--- a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoNamespace.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.ecf.provider.mqtt.paho.identity;
-
-import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.identity.IDCreateException;
-import org.eclipse.ecf.core.identity.Namespace;
-
-public class PahoNamespace extends Namespace {
-
- public static final String NAME = "org.eclipse.provider.paho.namespace";
- public static final String SCHEME = "paho";
-
- static Namespace INSTANCE;
-
- private static final long serialVersionUID = -1856480656826761786L;
-
- public PahoNamespace() {
- INSTANCE = this;
- }
-
- public PahoNamespace(String name, String desc) {
- super(name, desc);
- INSTANCE = this;
- }
-
- @Override
- public ID createInstance(Object[] parameters) throws IDCreateException {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String getScheme() {
- return SCHEME;
- }
-
-}

Back to the top