Class ExchangeMessageUtil
- java.lang.Object
-
- de.uplanet.lucy.server.businesslogic.exchange.util.impl.ExchangeMessageUtil
-
- All Implemented Interfaces:
IExchangeMessageUtil
@Scriptable public final class ExchangeMessageUtil extends Object implements IExchangeMessageUtil
Utility class for Exchange messages.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createFolder(String p_strParentHref, String p_strFolderName)
Creates a new folder.IExchangeMessage
createNewDraft(String p_strFrom, String p_strTo, String p_strSubject, String p_strBody)
Creates a new draft email message.IExchangeMessage
findById(String p_strId)
Loads a message with the given ID.IExchangeMessage
findByPermanentUrl(String p_strPermUrl)
Loads a message with the given permanent URL.static IExchangeMessageUtil
getInstance()
Returns an instance initialized with a Exchange connection for the currently logged in user.static IExchangeMessageUtil
getInstance(Connection p_conn)
Returns an instance initialized with the given Exchange connection.void
saveMessageAsEML(String p_strMsgId, File p_fileDst)
Saves an MS Exchange message item in the EML format to the given file.void
saveMessageAsMSG(String p_strMsgId, File p_fileDst)
Saves an MS Exchange message item in the MSG format to the given file.void
sendMessage(String p_strItemId)
Sends a message identified by the given ID.void
setMessageRead(String p_strItemId)
Marks a message as read by setting the 'Read' flag to true.
-
-
-
Method Detail
-
getInstance
public static IExchangeMessageUtil getInstance()
Returns an instance initialized with a Exchange connection for the currently logged in user.- Returns:
- the instance
-
getInstance
public static IExchangeMessageUtil getInstance(Connection p_conn)
Returns an instance initialized with the given Exchange connection.- Parameters:
p_conn
- the MS Exchange connection- Returns:
- the instance
-
createNewDraft
public IExchangeMessage createNewDraft(String p_strFrom, String p_strTo, String p_strSubject, String p_strBody) throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface:IExchangeMessageUtil
Creates a new draft email message.- Specified by:
createNewDraft
in interfaceIExchangeMessageUtil
- Parameters:
p_strFrom
- The sender email address.p_strTo
- The receiver email address.p_strSubject
- The message subject.p_strBody
- The message body.- Returns:
- The
IExchangeMessage
instance. - Throws:
de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
- If message could not be created.
-
findById
public IExchangeMessage findById(String p_strId) throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface:IExchangeMessageUtil
Loads a message with the given ID.- Specified by:
findById
in interfaceIExchangeMessageUtil
- Parameters:
p_strId
- The message ID.- Returns:
- The
IExchangeMessage
instance. - Throws:
de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
-
findByPermanentUrl
public IExchangeMessage findByPermanentUrl(String p_strPermUrl) throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface:IExchangeMessageUtil
Loads a message with the given permanent URL.- Specified by:
findByPermanentUrl
in interfaceIExchangeMessageUtil
- Parameters:
p_strPermUrl
- The permanent URL.- Returns:
- The
IExchangeMessage
instance. - Throws:
de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
-
saveMessageAsEML
public void saveMessageAsEML(String p_strMsgId, File p_fileDst) throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface:IExchangeMessageUtil
Saves an MS Exchange message item in the EML format to the given file.- Specified by:
saveMessageAsEML
in interfaceIExchangeMessageUtil
- Parameters:
p_strMsgId
- The ID identifying the message.p_fileDst
- The destination file.- Throws:
de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
- If the operation failed.
-
saveMessageAsMSG
public void saveMessageAsMSG(String p_strMsgId, File p_fileDst) throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface:IExchangeMessageUtil
Saves an MS Exchange message item in the MSG format to the given file.- Specified by:
saveMessageAsMSG
in interfaceIExchangeMessageUtil
- Parameters:
p_strMsgId
- the ID identifying the messagep_fileDst
- The destination file.- Throws:
de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
- If the operation failed.
-
sendMessage
public void sendMessage(String p_strItemId) throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface:IExchangeMessageUtil
Sends a message identified by the given ID.- Specified by:
sendMessage
in interfaceIExchangeMessageUtil
- Parameters:
p_strItemId
- The ID of the message.- Throws:
de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
- If the operation failed.
-
setMessageRead
public void setMessageRead(String p_strItemId) throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface:IExchangeMessageUtil
Marks a message as read by setting the 'Read' flag to true.- Specified by:
setMessageRead
in interfaceIExchangeMessageUtil
- Parameters:
p_strItemId
- The ID of the message.- Throws:
de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
- If the operation failed.
-
createFolder
public String createFolder(String p_strParentHref, String p_strFolderName) throws de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
Description copied from interface:IExchangeMessageUtil
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 interfaceIExchangeMessageUtil
- Parameters:
p_strParentHref
- The HREF of the parent folder (required).p_strFolderName
- The folder name.- Returns:
- The ID of the new folder.
- Throws:
de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtilException
- If operation failed.
-
-