diff options
10 files changed, 45 insertions, 10 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml b/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml index 54201ad9c..b6eac282b 100644 --- a/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml +++ b/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml @@ -178,7 +178,7 @@ </viewerContribution> </extension> <extension - point="org.eclipse.ecf.start"> + point="org.eclipse.ecf.startup"> <ecfstart class="org.eclipse.ecf.example.collab.start.CollabStart"/> </extension> diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/start/CollabStart.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/start/CollabStart.java index 4c9520022..996daf4c0 100644 --- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/start/CollabStart.java +++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/start/CollabStart.java @@ -9,7 +9,8 @@ public class CollabStart implements IECFStart { Discovery discovery = null; - public IStatus start(IProgressMonitor monitor) { + public IStatus startup(IProgressMonitor monitor) { + System.out.println("CollabSTart.startup"); try { //discovery = new Discovery(); } catch (Exception e) {} diff --git a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/IChatID.java b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/IChatID.java new file mode 100644 index 000000000..9f71814be --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/IChatID.java @@ -0,0 +1,19 @@ +package org.eclipse.ecf.presence; + +/** + * Adapter interface for chatIDs. The typical usage of this + * interface is as follows: + * <pre> + * IChatID chatID = (IChatID) id.getAdapter(IChatID.class); + * if (chatID != null) { + * ...use chatID here + * } + * </pre> + */ +public interface IChatID { + /** + * Get username for this ID + * @return String username for ID + */ + public String getUsername(); +} diff --git a/framework/bundles/org.eclipse.ecf/plugin.xml b/framework/bundles/org.eclipse.ecf/plugin.xml index ea0db284b..e65011194 100644 --- a/framework/bundles/org.eclipse.ecf/plugin.xml +++ b/framework/bundles/org.eclipse.ecf/plugin.xml @@ -5,5 +5,5 @@ <extension-point id="namespace" name="ECF Namespace" schema="schema/namespace.exsd"/> <extension-point id="connectionFactory" name="ECF Connection Factory" schema="schema/connectionFactory.exsd"/> <extension-point id="sharedObjectFactory" name="ECF Shared Object Factory" schema="schema/sharedObjectFactory.exsd"/> - <extension-point id="start" name="ECF Start" schema="schema/start.exsd"/> + <extension-point id="startup" name="ECF Start Up" schema="schema/startup.exsd"/> </plugin> diff --git a/framework/bundles/org.eclipse.ecf/schema/start.exsd b/framework/bundles/org.eclipse.ecf/schema/startup.exsd index 8d76b6222..38198bead 100644 --- a/framework/bundles/org.eclipse.ecf/schema/start.exsd +++ b/framework/bundles/org.eclipse.ecf/schema/startup.exsd @@ -3,7 +3,7 @@ <schema targetNamespace="org.eclipse.ecf"> <annotation> <appInfo> - <meta.schema plugin="org.eclipse.ecf" id="start" name="ECF Start"/> + <meta.schema plugin="org.eclipse.ecf" id="startup" name="ECF Start"/> </appInfo> <documentation> [Enter description of this extension point.] diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/ECFStartJob.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/ECFStartJob.java index 3745a9696..8389fc535 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/ECFStartJob.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/ECFStartJob.java @@ -18,6 +18,6 @@ public class ECFStartJob extends Job { this.start = start; } protected IStatus run(IProgressMonitor monitor) { - return start.start(monitor); + return start.startup(monitor); } } diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/IECFStart.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/IECFStart.java index e15555326..f1b226157 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/IECFStart.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/IECFStart.java @@ -22,5 +22,5 @@ public interface IECFStart { * @return IStatus the status of the start * @throws ECFStartException if some exception thrown during start */ - public IStatus start(IProgressMonitor monitor); + public IStatus startup(IProgressMonitor monitor); } diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java index 99f89db8e..6550f4a4d 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java @@ -55,7 +55,7 @@ public class ECFPlugin extends Plugin { + ".sharedObjectFactory"; public static final String COMM_FACTORY_EPOINT = ECFNAMESPACE + ".connectionFactory"; - public static final String START_EPOINT = ECFNAMESPACE + ".start"; + public static final String START_EPOINT = ECFNAMESPACE + ".startup"; public static final String PLUGIN_RESOURCE_BUNDLE = ECFNAMESPACE + ".ECFPluginResources"; diff --git a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java index 895bf1767..3cf126dfa 100644 --- a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java +++ b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java @@ -5,8 +5,9 @@ import java.net.URISyntaxException; import org.eclipse.ecf.core.identity.BaseID; import org.eclipse.ecf.core.identity.Namespace; +import org.eclipse.ecf.presence.IChatID; -public class XMPPID extends BaseID { +public class XMPPID extends BaseID implements IChatID { private static final long serialVersionUID = 3257289140701049140L; public static final char USER_HOST_DELIMITER = '@'; @@ -69,5 +70,9 @@ public class XMPPID extends BaseID { sb.append(uri.toString()).append("]"); return sb.toString(); } - + public Object getAdapter(Class clazz) { + if (clazz.equals(IChatID.class)) { + return this; + } else return super.getAdapter(clazz); + } } diff --git a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPRoomID.java b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPRoomID.java index 64393b28e..b7c97d647 100644 --- a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPRoomID.java +++ b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPRoomID.java @@ -4,9 +4,10 @@ import java.net.URI; import java.net.URISyntaxException; import org.eclipse.ecf.core.identity.BaseID; import org.eclipse.ecf.core.identity.Namespace; +import org.eclipse.ecf.presence.IChatID; import org.jivesoftware.smack.XMPPConnection; -public class XMPPRoomID extends BaseID { +public class XMPPRoomID extends BaseID implements IChatID { private static final long serialVersionUID = -4843967090539640622L; public static final String DOMAIN_DEFAULT = "conference"; @@ -106,4 +107,13 @@ public class XMPPRoomID extends BaseID { sb.append(uri).append("]"); return sb.toString(); } + public Object getAdapter(Class clazz) { + if (clazz.equals(IChatID.class)) { + return this; + } else return super.getAdapter(clazz); + } + + public String getUsername() { + return getNickname(); + } } |