de.uplanet.lucy.server.businesslogic.exchange.util.impl
Class ExchangeMailboxUtil

java.lang.Object
  extended by de.uplanet.lucy.server.businesslogic.exchange.util.impl.ExchangeMailboxUtil
All Implemented Interfaces:
IExchangeMailboxUtil

@Scriptable
public class ExchangeMailboxUtil
extends java.lang.Object
implements IExchangeMailboxUtil

Utility class for an Exchange user's mailbox.

Version:
$Revision: 88228 $

Method Summary
 java.lang.String createFolder(java.lang.String p_strParentHref, java.lang.String p_strFolderName, java.lang.String p_strContentClass)
          Creates a new folder.
 boolean deleteFolder(java.lang.String p_strId, boolean p_bPurgeFolder)
          Deletes a folder identified by ID.
 java.lang.String getCalendarFolderHref(java.lang.String p_strUserMailbox)
          Returns the folder HREF value.
 java.lang.String getCalendarFolderName(java.lang.String p_strUserMailbox)
          Returns the language dependent folder name.
 java.lang.String getContactsFolderHref(java.lang.String p_strUserMailbox)
          Returns the folder HREF value.
 java.lang.String getContactsFolderName(java.lang.String p_strUserMailbox)
          Returns the language dependent folder name.
 java.lang.String getDeletedItemsFolderHref(java.lang.String p_strUserMailbox)
          Returns the folder HREF value.
 java.lang.String getDeletedItemsFolderName(java.lang.String p_strUserMailbox)
          Returns the language dependent folder name.
 java.lang.String getDraftsFolderHref(java.lang.String p_strUserMailbox)
          Returns the folder HREF value.
 java.lang.String getDraftsFolderName(java.lang.String p_strUserMailbox)
          Returns the language dependent folder name.
 IFolderInfo getFolderInfoByHref(java.lang.String p_strFolderHref)
          Returns an ExchangeFolderInfo instance with the folder properties.
 IFolderInfo getFolderInfoById(java.lang.String p_strFolderId)
          Returns an ExchangeFolderInfo instance with the folder properties.
 java.util.List<IFolderInfo> getFolders()
          Returns a list of IFolderInfo instances for all folders.
 ExchangeAccount getImpersonateUserAccount(java.lang.String p_strUserGuid)
          Returns Exchange account properties for the given impersonate user.
 ExchangeAccount getImpersonateUserAccount(java.lang.String p_strUserGuid, java.lang.String p_strPortalGuid)
          Returns Exchange account properties for the given impersonate user.
 java.lang.String getInboxFolderHref(java.lang.String p_strUserMailbox)
          Returns the folder HREF value.
 java.lang.String getInboxFolderName(java.lang.String p_strUserMailbox)
          Returns the language dependent folder name.
static IExchangeMailboxUtil getInstance()
          Returns an instance initialized with a Exchange connection for the currently logged in user.
static IExchangeMailboxUtil getInstance(java.sql.Connection p_conn)
          Returns an instance initialized with the given Exchange connection.
 java.lang.String getJournalFolderHref(java.lang.String p_strUserMailbox)
          Returns the folder HREF value.
 java.lang.String getJournalFolderName(java.lang.String p_strUserMailbox)
          Returns the language dependent folder name.
 java.lang.String getOutboxFolderHref(java.lang.String p_strUserMailbox)
          Returns the folder HREF value.
 java.lang.String getOutboxFolderName(java.lang.String p_strUserMailbox)
          Returns the language dependent folder name.
 java.lang.String getOutOfOfficeMessage()
          Returns the out of office message.
 java.lang.String getSentItemsFolderHref(java.lang.String p_strUserMailbox)
          Returns the folder HREF value.
 java.lang.String getSentItemsFolderName(java.lang.String p_strUserMailbox)
          Returns the language dependent folder name.
 java.util.List<java.lang.String> getSharedUsers()
          Returns a list of currently shared users mailbox names.
 java.lang.String getTasksFolderHref(java.lang.String p_strUserMailbox)
          Returns the folder HREF value.
 java.lang.String getTasksFolderName(java.lang.String p_strUserMailbox)
          Returns the language dependent folder name.
 ExchangeAccount getUserAccount(java.lang.String p_strUserGuid)
          Returns Exchange account properties for the given user.
 ExchangeAccount getUserAccount(java.lang.String p_strUserGuid, java.lang.String p_strPortalGuid)
          Returns Exchange account properties for the given user.
 boolean isOutOfOfficeEnabled()
          Returns the out of office status.
 void purgeDeletedItemsFolder()
          Deletes all items in the deleted items folder.
 void releaseSharedUsers()
          Release shared users table.
 void setOutOfOffice(boolean p_bOutOfOffice)
          Sets the out of office status.
 void setOutOfOfficeMessage(java.lang.String p_strMessage)
          Sets both the internal and the external out of office message.
 java.lang.String updateFolderName(java.lang.String p_strFolderId, java.lang.String p_strFolderName)
          Updates the name of a folder identified by the given folder ID.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IExchangeMailboxUtil getInstance()
Returns an instance initialized with a Exchange connection for the currently logged in user.

Returns:
the instance

getInstance

public static IExchangeMailboxUtil getInstance(java.sql.Connection p_conn)
Returns an instance initialized with the given Exchange connection.

Parameters:
p_conn - the MS Exchange connection
Returns:
the instance

getUserAccount

public ExchangeAccount getUserAccount(java.lang.String p_strUserGuid)
                               throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns Exchange account properties for the given user.

Specified by:
getUserAccount in interface IExchangeMailboxUtil
Parameters:
p_strUserGuid - The GUID of the user.
Returns:
The Exchange account properties bean.
Throws:
ExchangeUtilException - If operation failed.

getUserAccount

public ExchangeAccount getUserAccount(java.lang.String p_strUserGuid,
                                      java.lang.String p_strPortalGuid)
                               throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns Exchange account properties for the given user.

Specified by:
getUserAccount in interface IExchangeMailboxUtil
Parameters:
p_strUserGuid - The GUID of the user.
p_strPortalGuid - The portal GUID.
Returns:
The Exchange account properties bean.
Throws:
ExchangeUtilException - If operation failed.

getImpersonateUserAccount

public ExchangeAccount getImpersonateUserAccount(java.lang.String p_strUserGuid)
                                          throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns Exchange account properties for the given impersonate user.

Specified by:
getImpersonateUserAccount in interface IExchangeMailboxUtil
Parameters:
p_strUserGuid - The GUID of the user.
Returns:
The Exchange account properties bean.
Throws:
ExchangeUtilException - If operation failed.

getImpersonateUserAccount

public ExchangeAccount getImpersonateUserAccount(java.lang.String p_strUserGuid,
                                                 java.lang.String p_strPortalGuid)
                                          throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns Exchange account properties for the given impersonate user.

Specified by:
getImpersonateUserAccount in interface IExchangeMailboxUtil
Parameters:
p_strUserGuid - The GUID of the user.
p_strPortalGuid - The portal GUID.
Returns:
The Exchange account properties bean.
Throws:
ExchangeUtilException - If operation failed.

getSharedUsers

public java.util.List<java.lang.String> getSharedUsers()
                                                throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns a list of currently shared users mailbox names.

Specified by:
getSharedUsers in interface IExchangeMailboxUtil
Returns:
A list of currently shared users.
Throws:
ExchangeUtilException - If operation failed.

getCalendarFolderName

public java.lang.String getCalendarFolderName(java.lang.String p_strUserMailbox)
                                       throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the language dependent folder name.

Specified by:
getCalendarFolderName in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder name.
Throws:
ExchangeUtilException - If operation failed.

getCalendarFolderHref

public java.lang.String getCalendarFolderHref(java.lang.String p_strUserMailbox)
                                       throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the folder HREF value.

Specified by:
getCalendarFolderHref in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder HREF value.
Throws:
ExchangeUtilException - If operation failed.

getContactsFolderName

public java.lang.String getContactsFolderName(java.lang.String p_strUserMailbox)
                                       throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the language dependent folder name.

Specified by:
getContactsFolderName in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder name.
Throws:
ExchangeUtilException - If operation failed.

getContactsFolderHref

public java.lang.String getContactsFolderHref(java.lang.String p_strUserMailbox)
                                       throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the folder HREF value.

Specified by:
getContactsFolderHref in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder HREF value.
Throws:
ExchangeUtilException - If operation failed.

getDeletedItemsFolderName

public java.lang.String getDeletedItemsFolderName(java.lang.String p_strUserMailbox)
                                           throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the language dependent folder name.

Specified by:
getDeletedItemsFolderName in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder name.
Throws:
ExchangeUtilException - If operation failed.

getDeletedItemsFolderHref

public java.lang.String getDeletedItemsFolderHref(java.lang.String p_strUserMailbox)
                                           throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the folder HREF value.

Specified by:
getDeletedItemsFolderHref in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder HREF value.
Throws:
ExchangeUtilException - If operation failed.

getDraftsFolderName

public java.lang.String getDraftsFolderName(java.lang.String p_strUserMailbox)
                                     throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the language dependent folder name.

Specified by:
getDraftsFolderName in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder name.
Throws:
ExchangeUtilException - If operation failed.

getDraftsFolderHref

public java.lang.String getDraftsFolderHref(java.lang.String p_strUserMailbox)
                                     throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the folder HREF value.

Specified by:
getDraftsFolderHref in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder HREF value.
Throws:
ExchangeUtilException - If operation failed.

getInboxFolderName

public java.lang.String getInboxFolderName(java.lang.String p_strUserMailbox)
                                    throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the language dependent folder name.

Specified by:
getInboxFolderName in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder name.
Throws:
ExchangeUtilException - If operation failed.

getInboxFolderHref

public java.lang.String getInboxFolderHref(java.lang.String p_strUserMailbox)
                                    throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the folder HREF value.

Specified by:
getInboxFolderHref in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder HREF value.
Throws:
ExchangeUtilException - If operation failed.

getJournalFolderName

public java.lang.String getJournalFolderName(java.lang.String p_strUserMailbox)
                                      throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the language dependent folder name.

Specified by:
getJournalFolderName in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder name.
Throws:
ExchangeUtilException - If operation failed.

getJournalFolderHref

public java.lang.String getJournalFolderHref(java.lang.String p_strUserMailbox)
                                      throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the folder HREF value.

Specified by:
getJournalFolderHref in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder HREF value.
Throws:
ExchangeUtilException - If operation failed.

getOutboxFolderName

public java.lang.String getOutboxFolderName(java.lang.String p_strUserMailbox)
                                     throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the language dependent folder name.

Specified by:
getOutboxFolderName in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder name.
Throws:
ExchangeUtilException - If operation failed.

getOutboxFolderHref

public java.lang.String getOutboxFolderHref(java.lang.String p_strUserMailbox)
                                     throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the folder HREF value.

Specified by:
getOutboxFolderHref in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder HREF value.
Throws:
ExchangeUtilException - If operation failed.

getSentItemsFolderName

public java.lang.String getSentItemsFolderName(java.lang.String p_strUserMailbox)
                                        throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the language dependent folder name.

Specified by:
getSentItemsFolderName in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder name.
Throws:
ExchangeUtilException - If operation failed.

getSentItemsFolderHref

public java.lang.String getSentItemsFolderHref(java.lang.String p_strUserMailbox)
                                        throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the folder HREF value.

Specified by:
getSentItemsFolderHref in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder HREF value.
Throws:
ExchangeUtilException - If operation failed.

getTasksFolderName

public java.lang.String getTasksFolderName(java.lang.String p_strUserMailbox)
                                    throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the language dependent folder name.

Specified by:
getTasksFolderName in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder name.
Throws:
ExchangeUtilException - If operation failed.

getTasksFolderHref

public java.lang.String getTasksFolderHref(java.lang.String p_strUserMailbox)
                                    throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the folder HREF value.

Specified by:
getTasksFolderHref in interface IExchangeMailboxUtil
Parameters:
p_strUserMailbox - The name of the user mailbox or null for the current user.
Returns:
The folder HREF value.
Throws:
ExchangeUtilException - If operation failed.

isOutOfOfficeEnabled

public boolean isOutOfOfficeEnabled()
                             throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the out of office status.

Specified by:
isOutOfOfficeEnabled in interface IExchangeMailboxUtil
Returns:
True if out of office is enabled.
Throws:
ExchangeUtilException - If operation failed.

getOutOfOfficeMessage

public java.lang.String getOutOfOfficeMessage()
                                       throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns the out of office message.

Specified by:
getOutOfOfficeMessage in interface IExchangeMailboxUtil
Returns:
The out of office message.
Throws:
ExchangeUtilException - If operation failed.

setOutOfOffice

public void setOutOfOffice(boolean p_bOutOfOffice)
                    throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Sets the out of office status.

Specified by:
setOutOfOffice in interface IExchangeMailboxUtil
Parameters:
p_bOutOfOffice - True to enable out of office message.
Throws:
ExchangeUtilException - If operation failed.

setOutOfOfficeMessage

public void setOutOfOfficeMessage(java.lang.String p_strMessage)
                           throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Sets both the internal and the external out of office message.

Specified by:
setOutOfOfficeMessage in interface IExchangeMailboxUtil
Parameters:
p_strMessage - The out of office message.
Throws:
ExchangeUtilException - If operation failed.

getFolders

public java.util.List<IFolderInfo> getFolders()
                                       throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns a list of IFolderInfo instances for all folders.

Specified by:
getFolders in interface IExchangeMailboxUtil
Returns:
A list of IFolderInfo instances for all folders.
Throws:
ExchangeUtilException - If operation failed.

getFolderInfoById

public IFolderInfo getFolderInfoById(java.lang.String p_strFolderId)
                              throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns an ExchangeFolderInfo instance with the folder properties.

Specified by:
getFolderInfoById in interface IExchangeMailboxUtil
Parameters:
p_strFolderId - The ID to identify the folder.
Returns:
A IFolderInfo instance with the folder properties or null if no folder exists for the given ID.
Throws:
ExchangeUtilException - If operation failed.

getFolderInfoByHref

public IFolderInfo getFolderInfoByHref(java.lang.String p_strFolderHref)
                                throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Returns an ExchangeFolderInfo instance with the folder properties.

Specified by:
getFolderInfoByHref in interface IExchangeMailboxUtil
Parameters:
p_strFolderHref - The HREF of the folder.
Returns:
A IFolderInfo instance with the folder properties or null if no folder exists for the given HREF.
Throws:
ExchangeUtilException - If operation failed.

updateFolderName

public java.lang.String updateFolderName(java.lang.String p_strFolderId,
                                         java.lang.String p_strFolderName)
                                  throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Updates the name of a folder identified by the given folder ID.

Specified by:
updateFolderName in interface IExchangeMailboxUtil
Parameters:
p_strFolderId - The folder ID.
p_strFolderName - The new folder name.
Returns:
The new HREF of the folder.
Throws:
ExchangeUtilException - If operation failed.

createFolder

public java.lang.String createFolder(java.lang.String p_strParentHref,
                                     java.lang.String p_strFolderName,
                                     java.lang.String p_strContentClass)
                              throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Creates a new folder. The display name can be an arbitrary string. The HREF and parent HREF parameters must include the canonical path to the folder. Consider the following structure:

+ Folder1
++ Folder2
+++ MyNewFolder

To create 'MyNewFolder' beneath 'Folder2' the following values are required:

Folder name: MyNewFolder
Parent HREF: /Folder1/Folder2/

Specified by:
createFolder in interface IExchangeMailboxUtil
Parameters:
p_strParentHref - The HREF of the parent folder (required).
p_strFolderName - The name of the folder (required).
p_strContentClass - The content class of the folder (default is urn:content-classes:mailfolder).
Returns:
The ID of the new folder.
Throws:
ExchangeUtilException - If operation failed.

deleteFolder

public boolean deleteFolder(java.lang.String p_strId,
                            boolean p_bPurgeFolder)
                     throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Deletes a folder identified by ID.

Specified by:
deleteFolder in interface IExchangeMailboxUtil
Parameters:
p_strId - The ID of the folder.
p_bPurgeFolder - If true, the folder will be removed from deleted items folder as well.
Returns:
True if folder was deleted.
Throws:
ExchangeUtilException - If operation failed.

purgeDeletedItemsFolder

public void purgeDeletedItemsFolder()
                             throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Deletes all items in the deleted items folder.

Specified by:
purgeDeletedItemsFolder in interface IExchangeMailboxUtil
Throws:
ExchangeUtilException - If operation failed.

releaseSharedUsers

public void releaseSharedUsers()
                        throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface: IExchangeMailboxUtil
Release shared users table.

Specified by:
releaseSharedUsers in interface IExchangeMailboxUtil
Throws:
ExchangeUtilException - If operation failed.


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.