diff options
author | slewis | 2013-11-13 01:27:44 +0000 |
---|---|---|
committer | slewis | 2013-11-13 01:27:44 +0000 |
commit | 31e719c64d15e408bacccd21f271406a753ce435 (patch) | |
tree | 88e558ed62c24d41c6f561b4429d7a159bc1ce0b /incubation | |
parent | eaff9f4fb8fb0f15a85429e3d59f65c4fbfb5bea (diff) | |
download | org.eclipse.ecf-31e719c64d15e408bacccd21f271406a753ce435.tar.gz org.eclipse.ecf-31e719c64d15e408bacccd21f271406a753ce435.tar.xz org.eclipse.ecf-31e719c64d15e408bacccd21f271406a753ce435.zip |
Initial checkin of org.eclipse.ecf.provider.mqtt.paho provider. This is
an MQTT client provider based upon the Paho (www.eclipse.org/paho)
codebase. Version 0.4.0 of Paho library jar is temporarily included in
the lib directory of this project to aid development.
Diffstat (limited to 'incubation')
17 files changed, 287 insertions, 0 deletions
diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.classpath b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.classpath new file mode 100644 index 000000000..6a120755a --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.classpath @@ -0,0 +1,8 @@ +<?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"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.gitignore b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.gitignore new file mode 100644 index 000000000..5e56e040e --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.gitignore @@ -0,0 +1 @@ +/bin diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.project b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.project new file mode 100644 index 000000000..59aa83f7e --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.ecf.provider.mqtt.paho</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/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.settings/org.eclipse.jdt.core.prefs b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..af0f20f97 --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.settings/org.eclipse.pde.core.prefs b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 000000000..706f07e8a --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +pluginProject.extensions=true +resolve.requirebundle=false 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 new file mode 100644 index 000000000..12e9e96fb --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %plugin.name +Bundle-SymbolicName: org.eclipse.ecf.provider.mqtt.paho;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: %plugin.provider +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.generic;version="4.3.0" diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/build.properties b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/build.properties new file mode 100644 index 000000000..00a23e8dc --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + lib/mqtt-client-0.4.0.jar,\ + plugin.xml 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 Binary files differnew file mode 100644 index 000000000..6f2914f00 --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0-javadoc.jar 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 Binary files differnew file mode 100644 index 000000000..a3dc6516b --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0-sources.jar 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 Binary files differnew file mode 100644 index 000000000..8f1d92faa --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/lib/mqtt-client-0.4.0.jar diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/plugin.properties b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/plugin.properties new file mode 100644 index 000000000..b5be1b019 --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/plugin.properties @@ -0,0 +1,2 @@ +plugin.name=ECF Paho Provider +plugin.provider=Eclipse.org - ECF
\ No newline at end of file diff --git a/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/plugin.xml b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/plugin.xml new file mode 100644 index 000000000..729708f95 --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/plugin.xml @@ -0,0 +1,21 @@ +<?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/PahoClientContainer.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainer.java new file mode 100644 index 000000000..a032cd4fa --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainer.java @@ -0,0 +1,30 @@ +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.PahoID; +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 { + return new PahoConnection((PahoID) targetID,data); + } + +} 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 new file mode 100644 index 000000000..82c79e1bb --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoClientContainerInstantiator.java @@ -0,0 +1,16 @@ +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/PahoConnection.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoConnection.java new file mode 100644 index 000000000..9fc781b72 --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/container/PahoConnection.java @@ -0,0 +1,86 @@ +package org.eclipse.ecf.provider.mqtt.paho.container; + +import java.io.IOException; +import java.util.Map; + +import org.eclipse.ecf.core.identity.ID; +import org.eclipse.ecf.core.util.ECFException; +import org.eclipse.ecf.provider.comm.IConnectionListener; +import org.eclipse.ecf.provider.comm.ISynchAsynchConnection; +import org.eclipse.ecf.provider.mqtt.paho.identity.PahoID; + +public class PahoConnection implements ISynchAsynchConnection { + + public PahoConnection(PahoID targetID, Object data) { + // TODO Auto-generated constructor stub + } + + public void sendAsynch(ID receiver, byte[] data) throws IOException { + // TODO Auto-generated method stub + + } + + public Object connect(ID targetID, Object data, int timeout) + throws ECFException { + // TODO Auto-generated method stub + return null; + } + + public void disconnect() { + // TODO Auto-generated method stub + + } + + public boolean isConnected() { + // TODO Auto-generated method stub + return false; + } + + public ID getLocalID() { + // TODO Auto-generated method stub + return null; + } + + public void start() { + // TODO Auto-generated method stub + + } + + public void stop() { + // TODO Auto-generated method stub + + } + + public boolean isStarted() { + // TODO Auto-generated method stub + return false; + } + + @SuppressWarnings("rawtypes") + public Map getProperties() { + // TODO Auto-generated method stub + return null; + } + + public void addListener(IConnectionListener listener) { + // TODO Auto-generated method stub + + } + + public void removeListener(IConnectionListener listener) { + // TODO Auto-generated method stub + + } + + @SuppressWarnings("rawtypes") + public Object getAdapter(Class adapter) { + // TODO Auto-generated method stub + return null; + } + + public Object sendSynch(ID receiver, byte[] data) throws IOException { + // 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/PahoID.java b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoID.java new file mode 100644 index 000000000..83f52f8d6 --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoID.java @@ -0,0 +1,23 @@ +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 getTargetID() { + // XXX TODO + return null; + } + + public String getClientID() { + // XXX TODO + 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 new file mode 100644 index 000000000..1ba5a5bbf --- /dev/null +++ b/incubation/bundles/org.eclipse.ecf.provider.mqtt.paho/src/org/eclipse/ecf/provider/mqtt/paho/identity/PahoNamespace.java @@ -0,0 +1,36 @@ +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; + } + +} |