Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-04-17 01:28:36 -0400
committerslewis2007-04-17 01:28:36 -0400
commitde3c08a7dbd3ff2c21cf04ad39707866e784b74f (patch)
tree7bea00b9ec425cd11f495f2b285f2200dd23fc34 /framework/bundles/org.eclipse.ecf.presence
parent5dc765ffec4adb6195f9d1201068621ababa5436 (diff)
downloadorg.eclipse.ecf-de3c08a7dbd3ff2c21cf04ad39707866e784b74f.tar.gz
org.eclipse.ecf-de3c08a7dbd3ff2c21cf04ad39707866e784b74f.tar.xz
org.eclipse.ecf-de3c08a7dbd3ff2c21cf04ad39707866e784b74f.zip
Renamed IRosterUpdateListener to IRosterListener. Moved methods from IPresenceListener to IRosterListener. Updated providers. Replaced Yahoo roster viewer with new multirosterview
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.presence')
-rw-r--r--framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/IPresenceListener.java43
-rw-r--r--framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/AbstractRosterManager.java24
-rw-r--r--framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterListener.java (renamed from framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterUpdateListener.java)19
-rw-r--r--framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterManager.java8
4 files changed, 43 insertions, 51 deletions
diff --git a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/IPresenceListener.java b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/IPresenceListener.java
index 0f5bf383b..4f1e0309d 100644
--- a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/IPresenceListener.java
+++ b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/IPresenceListener.java
@@ -8,51 +8,12 @@
* Contributors:
* Composent, Inc. - initial API and implementation
*****************************************************************************/
-package org.eclipse.ecf.presence;
-import org.eclipse.ecf.presence.roster.IRosterEntry;
+package org.eclipse.ecf.presence;
/**
- * Listener for receiving and processing presence and roster update events.
- * <p>
- * </p>
- * Note these methods will be called asynchronously when notifications of remote
- * changes are received by the provider implementation code. The provider is
- * free to call the methods below with an arbitrary thread, so the
- * implementation of these methods must be appropriately prepared.
- * <p>
- * </p>
- * For example, if the code implementing any of these methods must interact with
- * user interface code, then it should use code such as the following to execute
- * on the SWT UI thread:
- *
- * <pre>
- * Display.getDefault().asyncExec(new Runnable() {
- * public void run() {
- * ... UI code here
- * }
- * });
- * </pre>
- *
- * Further, the code in the implementations of these methods should <b>not block</b> via
- * I/O operations or blocking UI calls.
+ *
*/
public interface IPresenceListener extends IParticipantListener {
- /**
- * Notification that a roster entry has been added
- *
- * @param entry
- * the roster entry that has changed
- */
- public void handleRosterEntryAdd(IRosterEntry entry);
-
- /**
- * Notification that a roster entry has been renived
- *
- * @param entry
- * the entry that has been removed
- */
- public void handleRosterEntryRemove(IRosterEntry entry);
-
}
diff --git a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/AbstractRosterManager.java b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/AbstractRosterManager.java
index 67aef8497..32ea623c5 100644
--- a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/AbstractRosterManager.java
+++ b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/AbstractRosterManager.java
@@ -43,8 +43,8 @@ public abstract class AbstractRosterManager implements IRosterManager {
}
}
- public synchronized void addRosterUpdateListener(
- IRosterUpdateListener listener) {
+ public synchronized void addRosterListener(
+ IRosterListener listener) {
if (listener != null) {
synchronized (rosterUpdateListeners) {
rosterUpdateListeners.add(listener);
@@ -55,11 +55,25 @@ public abstract class AbstractRosterManager implements IRosterManager {
protected void fireRosterUpdate(IRosterItem changedItem) {
synchronized (rosterUpdateListeners) {
for (Iterator i = rosterUpdateListeners.iterator(); i.hasNext();)
- ((IRosterUpdateListener) i.next()).handleRosterUpdate(roster,
+ ((IRosterListener) i.next()).handleRosterUpdate(roster,
changedItem);
}
}
+ protected void fireRosterAdd(IRosterEntry entry) {
+ synchronized (rosterUpdateListeners) {
+ for (Iterator i = rosterUpdateListeners.iterator(); i.hasNext();)
+ ((IRosterListener) i.next()).handleRosterEntryAdd(entry);
+ }
+ }
+
+ protected void fireRosterRemove(IRosterEntry entry) {
+ synchronized (rosterUpdateListeners) {
+ for (Iterator i = rosterUpdateListeners.iterator(); i.hasNext();)
+ ((IRosterListener) i.next()).handleRosterEntryRemove(entry);
+ }
+ }
+
protected void fireSubscriptionListener(ID fromID, IPresence.Type presencetype) {
synchronized (rosterSubscriptionListeners) {
for (Iterator i = rosterSubscriptionListeners.iterator(); i
@@ -95,8 +109,8 @@ public abstract class AbstractRosterManager implements IRosterManager {
}
}
- public synchronized void removeRosterUpdateListener(
- IRosterUpdateListener listener) {
+ public synchronized void removeRosterListener(
+ IRosterListener listener) {
if (listener != null) {
synchronized (rosterUpdateListeners) {
rosterUpdateListeners.remove(listener);
diff --git a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterUpdateListener.java b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterListener.java
index 092c21992..c62c46529 100644
--- a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterUpdateListener.java
+++ b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterListener.java
@@ -36,7 +36,15 @@ package org.eclipse.ecf.presence.roster;
* Further, the code in the implementations of these methods should <b>not block</b> via
* I/O operations or blocking UI calls.
*/
-public interface IRosterUpdateListener {
+public interface IRosterListener {
+
+ /**
+ * Notification that a roster entry has been added
+ *
+ * @param entry
+ * the roster entry that has changed
+ */
+ public void handleRosterEntryAdd(IRosterEntry entry);
/**
* Handle roster update notification.
@@ -48,4 +56,13 @@ public interface IRosterUpdateListener {
*/
public void handleRosterUpdate(IRoster roster, IRosterItem changedValue);
+ /**
+ * Notification that a roster entry has been renived
+ *
+ * @param entry
+ * the entry that has been removed
+ */
+ public void handleRosterEntryRemove(IRosterEntry entry);
+
+
}
diff --git a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterManager.java b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterManager.java
index d3e4a351b..a42ebb199 100644
--- a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterManager.java
+++ b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/roster/IRosterManager.java
@@ -28,21 +28,21 @@ public interface IRosterManager extends IAdaptable {
public IRoster getRoster();
/**
- * Add roster update listener to receive roster update events for this
+ * Add roster listener to receive roster add/update/remove events for this
* roster manager
*
* @param listener
* the listener to add. Must not be <code>null</code>.
*/
- public void addRosterUpdateListener(IRosterUpdateListener listener);
+ public void addRosterListener(IRosterListener listener);
/**
- * Remove roster update listener
+ * Remove roster listener
*
* @param listener
* the listener to remove. Must not be <code>null</code>.
*/
- public void removeRosterUpdateListener(IRosterUpdateListener listener);
+ public void removeRosterListener(IRosterListener listener);
/**
* Setup listener for handling roster subscription requests. The given

Back to the top