aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/service/protocol/AccountManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/sip/communicator/service/protocol/AccountManager.java')
-rw-r--r--src/net/java/sip/communicator/service/protocol/AccountManager.java61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/AccountManager.java b/src/net/java/sip/communicator/service/protocol/AccountManager.java
new file mode 100644
index 0000000..6cdb8e3
--- /dev/null
+++ b/src/net/java/sip/communicator/service/protocol/AccountManager.java
@@ -0,0 +1,61 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol;
+
+import net.java.sip.communicator.service.protocol.event.*;
+
+/**
+ * Represents a manager of accounts which contains the details about the format
+ * in which the accounts in question are stored (i.e. knows how to store and load
+ * them) and takes care of loading them on start-up.
+ *
+ * @author Lubomir Marinov
+ */
+public interface AccountManager
+{
+
+ /**
+ * Registers a specific listener to be notified about events fired by this
+ * <code>AccountManager</code>. If the <code>listener</code> is already
+ * registered, it will not be registered again.
+ *
+ * @param listener the listener to be registered for notification events
+ * fired by this <code>AccountManager</code>
+ */
+ void addListener(AccountManagerListener listener);
+
+ /**
+ * Determines whether the account store represented by this manager contains
+ * stored accounts.
+ *
+ * @return <tt>true</tt> if the account store represented by this manager
+ * contains stored accounts; <tt>false</tt>, otherwise
+ */
+ boolean hasStoredAccounts();
+
+ /**
+ * Unregisters a specific listener from this <code>AccountManager</code> so
+ * that it no longer received notifications about events fired by this
+ * manager.
+ *
+ * @param listener the listener to be unregistered from this
+ * <code>AccountManager</code> so that it no longer receives
+ * notifications about events fired by this manager
+ */
+ void removeListener(AccountManagerListener listener);
+
+ /**
+ * Stores an account represented in the form of an <code>AccountID</code>
+ * created by a specific <code>ProtocolProviderFactory</code>.
+ *
+ * @param factory the <code>ProtocolProviderFactory</code> which created the
+ * account to be stored
+ * @param accountID the account in the form of <code>AccountID</code> to be
+ * stored
+ */
+ void storeAccount(ProtocolProviderFactory factory, AccountID accountID);
+}