com.funambol.email.console.dao
Class ConsoleDAO

java.lang.Object
  extended by com.funambol.email.console.dao.ConsoleDAO

public class ConsoleDAO
extends java.lang.Object

This class implements methods to access data in Connector DB Schema.


Field Summary
protected  java.lang.String encryptionKey
           
protected  java.lang.String jndiDataSourceName
           
 
Constructor Summary
ConsoleDAO(java.lang.String _jndiDataSourceName, java.lang.String _encryptionKey)
           
 
Method Summary
 int checkUsersForMailServer(java.lang.String mailServerId)
          check if there are related users to the specific Mail Server
 int deletePubMailServer(java.lang.String mailServerId)
          delete mail server
 int deleteUser(java.lang.String accountId)
          delete user
 int disableUser(java.lang.String accountId)
          disable account
 int enableUser(java.lang.String accountId)
          disable account
 SyncItemInfoAdmin[] getCachedInfo(java.lang.String username, java.lang.String protocol)
          get user
 MailServer getPubMailServer(java.lang.String mailServerId)
          get public mail server
 MailServer[] getPubMailServers(com.funambol.framework.filter.Clause clause)
          get public mail servers
 MailServerAccount getUser(java.lang.String username)
          get user
 MailServerAccount getUserFromID(java.lang.String accountId)
          get user
 MailServerAccount[] getUsers(com.funambol.framework.filter.Clause clause)
          get users in the filter
 int insertPubMailServer(MailServer pms)
          insert public mail server configuration
 int insertUser(MailServerAccount msa)
          insert user and the mail server configuration
 int updatePubMailServer(MailServer pms)
          update public mail server
 int updateUser(MailServerAccount msa)
          update user regarding the mail server connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jndiDataSourceName

protected java.lang.String jndiDataSourceName

encryptionKey

protected java.lang.String encryptionKey
Constructor Detail

ConsoleDAO

public ConsoleDAO(java.lang.String _jndiDataSourceName,
                  java.lang.String _encryptionKey)
Parameters:
jndiDataSourceName - String
Method Detail

insertUser

public int insertUser(MailServerAccount msa)
               throws EntityException
insert user and the mail server configuration

Parameters:
msa - MailServerAccount
Returns:
result of insert operation int
Throws:
EntityException

deleteUser

public int deleteUser(java.lang.String accountId)
               throws EntityException
delete user

Parameters:
accountId - String
Returns:
int
Throws:
EntityException

disableUser

public int disableUser(java.lang.String accountId)
                throws EntityException
disable account

Parameters:
accountId - String
Returns:
int
Throws:
EntityException

enableUser

public int enableUser(java.lang.String accountId)
               throws EntityException
disable account

Parameters:
accountId - String
Returns:
int
Throws:
EntityException

updateUser

public int updateUser(MailServerAccount msa)
               throws EntityException
update user regarding the mail server connection

Parameters:
msa - MailServerAccount
Returns:
int
Throws:
EntityException

getUsers

public MailServerAccount[] getUsers(com.funambol.framework.filter.Clause clause)
                             throws EntityException
get users in the filter

Parameters:
clause - Clause
Returns:
list with all the user in the filter ArrayList
Throws:
EntityException

getUser

public MailServerAccount getUser(java.lang.String username)
                          throws EntityException
get user

Parameters:
username - String
Returns:
all the info about the user and the related mail server MailServerAccount
Throws:
EntityException

getCachedInfo

public SyncItemInfoAdmin[] getCachedInfo(java.lang.String username,
                                         java.lang.String protocol)
                                  throws EntityException
get user

Parameters:
username - String
Returns:
all the info about the user and the related mail server MailServerAccount
Throws:
EntityException

getUserFromID

public MailServerAccount getUserFromID(java.lang.String accountId)
                                throws EntityException
get user

Parameters:
accountId - String
Returns:
all the info about the user and the related mail server MailServerAccount
Throws:
EntityException

insertPubMailServer

public int insertPubMailServer(MailServer pms)
                        throws EntityException
insert public mail server configuration

Parameters:
pms - PublicMailServer
Returns:
int
Throws:
EntityException

deletePubMailServer

public int deletePubMailServer(java.lang.String mailServerId)
                        throws EntityException
delete mail server

Parameters:
mailServerId - String
Returns:
int
Throws:
EntityException

updatePubMailServer

public int updatePubMailServer(MailServer pms)
                        throws EntityException
update public mail server

Parameters:
pms - PublicMailServer
Returns:
int
Throws:
EntityException

getPubMailServers

public MailServer[] getPubMailServers(com.funambol.framework.filter.Clause clause)
                               throws EntityException
get public mail servers

Returns:
list with all the mail server in the filter ArrayList
Throws:
EntityException

getPubMailServer

public MailServer getPubMailServer(java.lang.String mailServerId)
                            throws EntityException
get public mail server

Parameters:
mailServerId - String
Returns:
all the info about the public mail server MailServer
Throws:
EntityException

checkUsersForMailServer

public int checkUsersForMailServer(java.lang.String mailServerId)
                            throws EntityException
check if there are related users to the specific Mail Server

Parameters:
mailServerId - String
Returns:
number of user for the specific mail server
Throws:
EntityException


Copyright © 2005-2006 Funambol.