Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a42ebb19950c674923b537c46d2b7c603c59bf87 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/****************************************************************************
 * Copyright (c) 2004 Composent, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Composent, Inc. - initial API and implementation
 *****************************************************************************/
package org.eclipse.ecf.presence.roster;

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ecf.presence.IPresenceListener;
import org.eclipse.ecf.presence.IPresenceSender;

/**
 * Roster manager for getting access to and changing roster.
 * 
 */
public interface IRosterManager extends IAdaptable {

	/**
	 * Get roster for this account.
	 * 
	 * @return IRoster for this roster manager. Will not be <code>null</code>.
	 */
	public IRoster getRoster();

	/**
	 * 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 addRosterListener(IRosterListener listener);

	/**
	 * Remove roster listener
	 * 
	 * @param listener
	 *            the listener to remove. Must not be <code>null</code>.
	 */
	public void removeRosterListener(IRosterListener listener);

	/**
	 * Setup listener for handling roster subscription requests. The given
	 * listener will asynchronously be called when a subscription request is
	 * received by this connected account.
	 * 
	 * @param listener
	 *            for receiving subscription requests. Must not be
	 *            <code>null</code>.
	 */
	public void addRosterSubscriptionListener(
			IRosterSubscriptionListener listener);

	/**
	 * Remove listener for roster subscription requests.
	 * 
	 * @param listener
	 *            the listener to remove. Will not be <code>null</code>.
	 */
	public void removeRosterSubscriptionListener(
			IRosterSubscriptionListener listener);

	/**
	 * Get roster subscription sender. The roster subscription sender returned
	 * by this method, if not <code>null</code>, may be used to send roster
	 * subscribe and unsubscribe requests
	 * 
	 * @return IRosterSubscriptionSender the sender to use. If <code>null</code>,
	 *         sending requests for roster updates are not supported.
	 */
	public IRosterSubscriptionSender getRosterSubscriptionSender();

	/**
	 * Retrieve interface for sending presence updates. The returned
	 * IPresenceSender (if not <code>null</code>) can be used to send
	 * presence change messages to remote users that have access to the presence
	 * information for the connected account.
	 * 
	 * @return IPresenceSender. <code>null</code> if no presence sender
	 *         available for this provider.
	 */
	public IPresenceSender getPresenceSender();

	/**
	 * Setup listener for handling presence updates. The given listener will
	 * asynchronously be called when a subscription request is received by this
	 * connected account.
	 * 
	 * @param listener
	 *            for receiving presence notifications. Must not be
	 *            <code>null</code>.
	 * 
	 */
	public void addPresenceListener(IPresenceListener listener);

	/**
	 * Remove listener for presence events.
	 * 
	 * @param listener
	 *            the listener to remove. Must not be <code>null</code>.
	 * 
	 */
	public void removePresenceListener(IPresenceListener listener);

}

Back to the top