com.openexchange.messaging
Interface MessagingAccountManager


public interface MessagingAccountManager

MessagingAccountManager - An account manager.

Since:
Open-Xchange v6.16
Author:
Francisco Laguna, Thorben Betten

Method Summary
 int addAccount(MessagingAccount account, com.openexchange.session.Session session)
          Adds a new account.
 void deleteAccount(MessagingAccount account, com.openexchange.session.Session session)
          Deletes an existing account.
 MessagingAccount getAccount(int id, com.openexchange.session.Session session)
          Gets an existing messaging account.
 java.util.List<MessagingAccount> getAccounts(com.openexchange.session.Session session)
          Gets all accounts associated with session user.
 boolean hasAccount(com.openexchange.session.Session session)
          Has the owner of this session an account?
 void migrateToNewSecret(java.lang.String oldSecret, java.lang.String newSecret, com.openexchange.session.Session session)
          Migrates all encrypted strings from an old secret to a new one.
 void updateAccount(MessagingAccount account, com.openexchange.session.Session session)
          Updates an existing account.
 

Method Detail

addAccount

int addAccount(MessagingAccount account,
               com.openexchange.session.Session session)
               throws MessagingException
Adds a new account.

Parameters:
account - The account to add
session - The session providing needed user data
Returns:
The identifier of the newly created account
Throws:
MessagingException - If insertion fails

updateAccount

void updateAccount(MessagingAccount account,
                   com.openexchange.session.Session session)
                   throws MessagingException
Updates an existing account.

Parameters:
account - The account providing the identifier and the data to update
session - The session providing needed user data
Throws:
MessagingException - If update fails

deleteAccount

void deleteAccount(MessagingAccount account,
                   com.openexchange.session.Session session)
                   throws MessagingException
Deletes an existing account.

Parameters:
account - The account to delete
session - The session providing needed user data
Throws:
MessagingException - If deletion fails

getAccounts

java.util.List<MessagingAccount> getAccounts(com.openexchange.session.Session session)
                                             throws MessagingException
Gets all accounts associated with session user.

Parameters:
session - The session providing needed user data
Returns:
All accounts associated with session user.
Throws:
MessagingException - If listing fails

getAccount

MessagingAccount getAccount(int id,
                            com.openexchange.session.Session session)
                            throws MessagingException
Gets an existing messaging account.

Parameters:
id - The identifier
session - The session providing needed user data
Returns:
The messaging account.
Throws:
MessagingException - If retrieval fails

migrateToNewSecret

void migrateToNewSecret(java.lang.String oldSecret,
                        java.lang.String newSecret,
                        com.openexchange.session.Session session)
                        throws MessagingException
Migrates all encrypted strings from an old secret to a new one.

Parameters:
oldSecret - The old secret for decrypting stored secret strings
newSecret - The new secret used for encrypting the secret strings
session - The session providing needed user data
Throws:
MessagingException

hasAccount

boolean hasAccount(com.openexchange.session.Session session)
                   throws MessagingException
Has the owner of this session an account?

Throws:
MessagingException