Nitido Inc.

com.nitido.nimx.nuggets.javamail.real
Class JavaMailNuggetImpl

java.lang.Object
  extended by com.nitido.nim.Nugget
      extended by com.nitido.nimx.nuggets.javamail.JavaMailNugget
          extended by com.nitido.nimx.nuggets.javamail.real.JavaMailNuggetImpl
All Implemented Interfaces:
CredentialConstants, java.io.Serializable

public class JavaMailNuggetImpl
extends JavaMailNugget

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.nitido.nimx.nuggets.javamail.JavaMailNugget
KEY_CHECK_UID_VALIDITY, KEY_IMAP_APPENDBUFFERSIZE, KEY_IMAP_CONNECTION_DEBUG, KEY_IMAP_CONNECTIONPOOLSIZE, KEY_IMAP_CONNECTIONPOOLTIMEOUT, KEY_IMAP_CONNECTIONTIMEOUT, KEY_IMAP_FETCHSIZE, KEY_IMAP_HOST, KEY_IMAP_PARTIALFETCH, KEY_IMAP_PORT, KEY_IMAP_PWD, KEY_IMAP_SEPARATESTORECONNECTION, KEY_IMAP_STATUSCACHETIMEOUT, KEY_IMAP_TIMEOUT, KEY_IMAP_USER, KEY_JAVAMAIL_DEBUG, KEY_SMTP_ALLOW8BITMIME, KEY_SMTP_AUTH, KEY_SMTP_CONNECTIONTIMEOUT, KEY_SMTP_DSN_NOTIFY, KEY_SMTP_DSN_RET, KEY_SMTP_EHLO, KEY_SMTP_FROM, KEY_SMTP_HOST, KEY_SMTP_LOCALHOST, KEY_SMTP_PORT, KEY_SMTP_PWD, KEY_SMTP_SENDPARTIAL, KEY_SMTP_TIMEOUT, KEY_SMTP_USER, KEY_STORE_PROTOCOL, KEY_TRANSPORT_PROTOCOL, NAME_DRAFTS, NAME_INBOX, NAME_SENT, NAME_TRASH
 
Fields inherited from class com.nitido.nim.Nugget
_entity, _nim, _nuggetName, _settings
 
Fields inherited from interface com.nitido.nim.CredentialConstants
CRED_ADMIN, CRED_CONTAINER, CRED_HELPDESK, CRED_SYSTEM, CRED_USER, KEY_PASSWORD
 
Constructor Summary
JavaMailNuggetImpl(NuggetVisa visa)
          Default constructor.
 
Method Summary
 void activate()
          Used by NiM Nugget mechnanism.
protected  void checkBoolean(java.lang.String key)
           
protected  void checkEmail(java.lang.String key)
           
protected  void checkFolderForUIDOps(javax.mail.Folder folder)
           
protected  void checkInt(java.lang.String key)
           
protected  void checkNonNull(java.lang.String key)
           
 void checkUIDValidity(javax.mail.Folder folder, long orgUIDValidity)
          This method will throw an InvalidUIDException if the folder's current UIDValidity value is not the same as the original value.
protected  void checkWithDefault(java.lang.String key, java.lang.String defaultValue)
           
 void closeFolder(javax.mail.Folder folder, boolean expunge)
          Close the specified folder.
 void closeFolderQuietly(javax.mail.Folder folder, boolean expunge)
          Close the specified folder quietly.
 void connectIMAP()
          Connect to to the IMAP server with the specified settings.
 javax.mail.Folder createFolder(java.lang.String folderName, int type, boolean isOpenedFolder)
          Create a new folder by specifying the full name of the folder.
 javax.mail.internet.MimeMessage createMessage()
          This method creates an empty MimeMessage for the user to populate and save/send.
 void deactivate()
          Used by NiM Nugget mechnanism.
 void disconnectIMAP()
          Disconnect from the IMAP server.
 void disconnectIMAPQuietly()
          Force a disconnection from the IMAP server.
protected  Credential fetchCredential(java.lang.String protocol, java.lang.String settingKey)
          Fetch the credential from the DataStore.
protected  java.lang.String getActualSetting(java.lang.String configKey)
          This method return the actual value of a setting.
 javax.mail.Folder getDefaultFolder()
          Get the folder that represents the 'root' of the mailbox.
 java.lang.String getDescriptor()
          Used by NiM Nugget mechnanism.
 javax.mail.Folder getFolderByName(java.lang.String folderName)
          Get the folder with the specified folder name.
protected  java.lang.String getLoginPassword(java.lang.String configKey)
           
protected  java.lang.String getLoginUser(java.lang.String configKey)
           
 Usage getMailBoxUsage()
          This method should work with iPlanet Calendar Server 5.1 or later.
 javax.mail.Message getMessageByUID(javax.mail.Folder folder, long orgUIDValidity, long uid)
          Get the message by UID.
 javax.mail.Message[] getMessagesByUIDRange(javax.mail.Folder folder, long orgUIDValidity, long start, long end)
          Get messages by UIDs
 javax.mail.Message[] getMessagesByUIDs(javax.mail.Folder folder, long orgUIDValidity, long[] uids)
          Get messages by UIDs
 java.lang.String[] getPersonalNamespaces()
          Deprecated.  
 java.lang.String[] getSharedNamespaces()
          Deprecated.  
 java.lang.String[] getSystemFolders()
          This method reports a list of folders that are system folders.
protected  long getUID(javax.mail.UIDFolder uf, javax.mail.Message msg)
           
 long getUIDNext(javax.mail.Folder folder)
          Get the UIDNext number of the folder.
 long getUIDofMessage(javax.mail.Folder folder, javax.mail.Message msg)
          Get the UID of the message.
 long[] getUIDofMessages(javax.mail.Folder folder, javax.mail.Message[] msgs)
          Get the UIDs of the messages.
 long getUIDValidity(javax.mail.Folder folder)
          Get the UIDValidity number of the folder.
protected  Usage getUsageFromFolder(javax.mail.Folder inFolder)
          get mailbox usage quota on a folder.
protected  void initImpl()
          Used by NiM Nugget mechnanism.
 boolean isCachable()
          This method indicates whether the Nugget implementation is a cachable nugget.
 javax.mail.Folder openDefaultFolder()
          Open the folder that represents the 'root' of the mailbox.
protected  boolean openFolder(javax.mail.Folder folder)
           
 javax.mail.Folder openFolderByName(java.lang.String folderName)
          Open the folder with the specified folder name.
protected  boolean reconnectIMAP()
           
 void sendMessage(javax.mail.Message msg, javax.mail.Address[] addr)
          Send the message to the address.
 void setDebug()
           
protected  void setJavaMailProperties()
           
protected  void settingsToProperties(java.lang.String key, java.util.Properties props)
           
 
Methods inherited from class com.nitido.nimx.nuggets.javamail.JavaMailNugget
createFolderByName
 
Methods inherited from class com.nitido.nim.Nugget
destroy, destroyImpl, getEntity, getNuggetName, getSetting, getSettings, init, requestBegin, requestEnd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMailNuggetImpl

public JavaMailNuggetImpl(NuggetVisa visa)
Default constructor.

Method Detail

connectIMAP

public void connectIMAP()
                 throws JavaMailNuggetException
Connect to to the IMAP server with the specified settings. This method will open one connection to the IMAP. The connection will remain open until disconnect is invoked. (It will be closed when the Nugget is serialized, but the connection will be automatically reopened after it has been deserialized).

Specified by:
connectIMAP in class JavaMailNugget
Throws:
JavaMailNuggetException

disconnectIMAP

public void disconnectIMAP()
                    throws ActivationException
Disconnect from the IMAP server.

Specified by:
disconnectIMAP in class JavaMailNugget
Throws:
ActivationException - if network error occurs or problems with disconnection.

disconnectIMAPQuietly

public void disconnectIMAPQuietly()
Description copied from class: JavaMailNugget
Force a disconnection from the IMAP server. Once this method is call, the connection to the IMAP server will be dropped, no matter how many folders are still opened.

If the connection has been dropped already or IO/IMAP problem occured, this method will not do anything (i.e. no exception).

Specified by:
disconnectIMAPQuietly in class JavaMailNugget

activate

public void activate()
              throws ActivationException
Used by NiM Nugget mechnanism. An application developer should never invoke this.

Overrides:
activate in class Nugget
Throws:
ActivationException - If unable to activate the Nugget

deactivate

public void deactivate()
                throws ActivationException
Used by NiM Nugget mechnanism. An application developer should never invoke this.

Overrides:
deactivate in class Nugget
Throws:
ActivationException - If unable to deactivate the Nugget

getDescriptor

public java.lang.String getDescriptor()
Used by NiM Nugget mechnanism. An application developer should never invoke this.

Specified by:
getDescriptor in class Nugget
Returns:
The string with the description of the Nugget.

initImpl

protected void initImpl()
                 throws InvalidSettingException
Used by NiM Nugget mechnanism. An application developer should never invoke this.

Specified by:
initImpl in class Nugget
Throws:
InvalidSettingException - If any of the expected initialization settings are null.

openDefaultFolder

public javax.mail.Folder openDefaultFolder()
                                    throws javax.mail.FolderNotFoundException,
                                           javax.mail.MessagingException,
                                           JavaMailNuggetException
Description copied from class: JavaMailNugget
Open the folder that represents the 'root' of the mailbox. If the folder can contain messages, this method will automatically open the folder. Otherwise, this method will return the unopened Folder object as it may contain other folders.

Specified by:
openDefaultFolder in class JavaMailNugget
Returns:
an opened Folder object for the requested folder.
Throws:
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

getDefaultFolder

public javax.mail.Folder getDefaultFolder()
                                   throws javax.mail.FolderNotFoundException,
                                          javax.mail.MessagingException,
                                          JavaMailNuggetException
Description copied from class: JavaMailNugget
Get the folder that represents the 'root' of the mailbox. NOTE: the returned Folder object is not "opened". You cannot obtain the messages inside it. You should call openDefaultFolder() if you want to access an opened folder.

Specified by:
getDefaultFolder in class JavaMailNugget
Returns:
an opened Folder object for the requested folder.
Throws:
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

openFolderByName

public javax.mail.Folder openFolderByName(java.lang.String folderName)
                                   throws javax.mail.FolderNotFoundException,
                                          javax.mail.MessagingException,
                                          JavaMailNuggetException
Description copied from class: JavaMailNugget
Open the folder with the specified folder name. If the folder can contain messages, this method will automatically open the folder.

Specified by:
openFolderByName in class JavaMailNugget
Parameters:
folderName - The folder name can be a full folder name or short name (with path relative to the default 'root' folder for the user).
Returns:
an opened Folder object for the requested folder.
Throws:
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

getFolderByName

public javax.mail.Folder getFolderByName(java.lang.String folderName)
                                  throws javax.mail.FolderNotFoundException,
                                         javax.mail.MessagingException,
                                         JavaMailNuggetException
Description copied from class: JavaMailNugget
Get the folder with the specified folder name. This folder will return a closed folder.

Specified by:
getFolderByName in class JavaMailNugget
Parameters:
folderName - The folder name can be a full folder name or short name (with path relative to the default 'root' folder for the user).
Returns:
a closed Folder object for the requested folder.
Throws:
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

createFolder

public javax.mail.Folder createFolder(java.lang.String folderName,
                                      int type,
                                      boolean isOpenedFolder)
                               throws javax.mail.MessagingException,
                                      JavaMailNuggetException
Description copied from class: JavaMailNugget
Create a new folder by specifying the full name of the folder. Any non-existing folders along its path will be also created.

If the creation is successful, a Folder object of the new folder will be returned. This Folder object will be opened if the type parameter has set the Folder.HOLDS_MESSAGES bit, AND, the isOpenedFolder parameter is "true". Otherwise, the returning Folder object will remain closed.

This method is introduced in NiM 2.4 to replace the original "Folder createFolderByName( String folderName, int type )" method.

Specified by:
createFolder in class JavaMailNugget
Parameters:
folderName - the name of the new folder (this includes the full path)
type - The type of the folders. It is a bit-field stored as integer. The valid fields are Folder.HOLDS_FOLDERS and Folder.HOLDS_MESSAGES. If a folder can hold both folders and messages, the value would be ( Folder.HOLDS_FOLDERS | Folder.HOLDS_MESSAGES ) - i.e. bitwise OR of the values.
For more details, please refer to the JavaDoc for the class javax.mail.Folder (Belongs to JavaMail 1.2 API).
Returns:
A Folder object for the requested folder. This Folder object will be opened if it can contain messages.
Throws:
javax.mail.MessagingException
JavaMailNuggetException

getPersonalNamespaces

public java.lang.String[] getPersonalNamespaces()
                                         throws javax.mail.MessagingException,
                                                JavaMailNuggetException
Deprecated. 

Description copied from class: JavaMailNugget
Retrieve the set of folders that represents the personal name spaces.

This method is deprecated because future versions of JavaMail will not support this type of methods. JavaMail 1.2 is the last version that supports it.

Specified by:
getPersonalNamespaces in class JavaMailNugget
Returns:
an array of full folder name for those matched folders.
Throws:
javax.mail.MessagingException
JavaMailNuggetException

getSharedNamespaces

public java.lang.String[] getSharedNamespaces()
                                       throws javax.mail.MessagingException,
                                              JavaMailNuggetException
Deprecated. 

Description copied from class: JavaMailNugget
Retrieve the set of folders that represents the shared name spaces. This method is deprecated because future versions of JavaMail will not support this type of methods. JavaMail 1.2 is the last version that supports it.

Specified by:
getSharedNamespaces in class JavaMailNugget
Returns:
an array of full folder name for those matched folders.
Throws:
javax.mail.MessagingException
JavaMailNuggetException

closeFolder

public void closeFolder(javax.mail.Folder folder,
                        boolean expunge)
                 throws javax.mail.MessagingException,
                        JavaMailNuggetException
Description copied from class: JavaMailNugget
Close the specified folder. If the folder has already been closed, nothing will happen.

Specified by:
closeFolder in class JavaMailNugget
Parameters:
folder - the Folder object of the folder to be closed.

expunge - Determine how the IMAP server treats "deleted" messages upon closing the folder. If the parameter is set to true, the server will permanently remove all the messages with flag marked as DELETED. Otherwise, the server will just leave those messages on the system.

Throws:
javax.mail.MessagingException - if error has occurred when connecting the IMAP server and/or when executing the command.
JavaMailNuggetException - if the folder object is null

closeFolderQuietly

public void closeFolderQuietly(javax.mail.Folder folder,
                               boolean expunge)
Description copied from class: JavaMailNugget
Close the specified folder quietly. This method basically do the same thing as closeFolder, except that it will never throw any exceptions.

Specified by:
closeFolderQuietly in class JavaMailNugget
Parameters:
folder - the Folder object of the folder to be closed.

expunge - Determine how the IMAP server treats "deleted" messages upon closing the folder. If the parameter is set to true, the server will permanently remove all the messages with flag marked as DELETED. Otherwise, the server will just leave those messages on the system.


getSystemFolders

public java.lang.String[] getSystemFolders()
                                    throws javax.mail.MessagingException,
                                           JavaMailNuggetException
Description copied from class: JavaMailNugget
This method reports a list of folders that are system folders. These are folders such as Inbox that may have special needs within a project.

Specified by:
getSystemFolders in class JavaMailNugget
Returns:
An array of String objects containing the name of each system folder.
Throws:
javax.mail.MessagingException
JavaMailNuggetException

getUIDValidity

public long getUIDValidity(javax.mail.Folder folder)
                    throws javax.mail.FolderNotFoundException,
                           javax.mail.MessagingException,
                           JavaMailNuggetException
Description copied from class: JavaMailNugget
Get the UIDValidity number of the folder. This number is required if you want to refer any messages with UID in the future. According to the IMAP v4 protocol (RFC 2445), this number will be increased if the server has changed the UID of messages stored under the folder.

Specified by:
getUIDValidity in class JavaMailNugget
Parameters:
folder - The folder to fetch the UIDValidity number from
Returns:
The UIDValidity number of the folder.
Throws:
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

getUIDNext

public long getUIDNext(javax.mail.Folder folder)
                throws javax.mail.MessagingException
Description copied from class: JavaMailNugget
Get the UIDNext number of the folder. This number is required if you want to refer any messages with UID in the future.

Specified by:
getUIDNext in class JavaMailNugget
Parameters:
folder - The folder to fetch the UIDNext number from.
Returns:
The UIDNext number of the folder.
Throws:
javax.mail.MessagingException

getUIDofMessage

public long getUIDofMessage(javax.mail.Folder folder,
                            javax.mail.Message msg)
                     throws javax.mail.FolderNotFoundException,
                            javax.mail.MessagingException,
                            MessageNotInFolderException,
                            JavaMailNuggetException
Description copied from class: JavaMailNugget
Get the UID of the message. The messages must be stored under the specified folder.

Specified by:
getUIDofMessage in class JavaMailNugget
Throws:
MessageNotInFolderException - If the message is not stored under the specified folder.
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

getUIDofMessages

public long[] getUIDofMessages(javax.mail.Folder folder,
                               javax.mail.Message[] msgs)
                        throws javax.mail.FolderNotFoundException,
                               javax.mail.MessagingException,
                               MessageNotInFolderException,
                               JavaMailNuggetException
Description copied from class: JavaMailNugget
Get the UIDs of the messages. All the messages must be stored under the specified folder.

Specified by:
getUIDofMessages in class JavaMailNugget
Throws:
MessageNotInFolderException - If at least one of the message is not stored under the specified folder.
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

getMessageByUID

public javax.mail.Message getMessageByUID(javax.mail.Folder folder,
                                          long orgUIDValidity,
                                          long uid)
                                   throws javax.mail.FolderNotFoundException,
                                          javax.mail.MessagingException,
                                          InvalidUIDException,
                                          JavaMailNuggetException
Description copied from class: JavaMailNugget
Get the message by UID.

Specified by:
getMessageByUID in class JavaMailNugget
Parameters:
folder - The folder to get the message from.
orgUIDValidity - The original UIDValidity number that the folder returns when you fetch the message UID. This number is used to determine whether the server has altered the UIDs between your request.
uid - The uid of the message you want to fetch.
Returns:
A javax.mail.Message object
Throws:
InvalidUIDException - If the server has changed the UID between your requests.
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

getMessagesByUIDs

public javax.mail.Message[] getMessagesByUIDs(javax.mail.Folder folder,
                                              long orgUIDValidity,
                                              long[] uids)
                                       throws javax.mail.FolderNotFoundException,
                                              javax.mail.MessagingException,
                                              InvalidUIDException,
                                              JavaMailNuggetException
Description copied from class: JavaMailNugget
Get messages by UIDs

Specified by:
getMessagesByUIDs in class JavaMailNugget
Parameters:
folder - The folder to get the message from.
orgUIDValidity - The original UIDValidity number that the folder returns when you fetch the message UID. This number is used to determine whether the server has altered the UIDs between your request.
uids - An array of uid of the messages you want to fetch.
Returns:
An array of javax.mail.Message objects
Throws:
InvalidUIDException - If the server has changed the UID between your requests.
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

getMessagesByUIDRange

public javax.mail.Message[] getMessagesByUIDRange(javax.mail.Folder folder,
                                                  long orgUIDValidity,
                                                  long start,
                                                  long end)
                                           throws javax.mail.FolderNotFoundException,
                                                  javax.mail.MessagingException,
                                                  InvalidUIDException,
                                                  JavaMailNuggetException
Description copied from class: JavaMailNugget
Get messages by UIDs

Specified by:
getMessagesByUIDRange in class JavaMailNugget
Parameters:
folder - The folder to get the message from.
orgUIDValidity - The original UIDValidity number that the folder returns when you fetch the message UID. This number is used to determine whether the server has altered the UIDs between your request.
start - The smallest UID of the message to fetch.
end - The largest UID index of the message to fetch.
Returns:
An array of javax.mail.Message objects
Throws:
InvalidUIDException - If the server has changed the UID between your requests.
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

getMailBoxUsage

public Usage getMailBoxUsage()
                      throws javax.mail.MessagingException,
                             JavaMailNuggetException
This method should work with iPlanet Calendar Server 5.1 or later. It attempts to check the quota usage on the root folder first. If no storage quota is found, it will attempt to

Specified by:
getMailBoxUsage in class JavaMailNugget
Returns:
a Usage object that contains both the quota and the space that has been used. If the user account has no quota associated to its root folder or INBOX folder, a null object will be returned.
Throws:
javax.mail.MessagingException
JavaMailNuggetException

createMessage

public javax.mail.internet.MimeMessage createMessage()
Description copied from class: JavaMailNugget
This method creates an empty MimeMessage for the user to populate and save/send. ALL user-composed messages must be created through this method, no matter whether those messages will be sent right away or stored into the draft folder.

Its headers field is set to an empty InternetHeaders object. The flags field is set to an empty Flags object. The modified flag is set to true.

In other words, this method would not restrict the caller on the setting of the message. The caller can set these header information in anyway that is suitable for the nature of the message.

This method does not require the caller to have any folder opened,.

Specified by:
createMessage in class JavaMailNugget

sendMessage

public void sendMessage(javax.mail.Message msg,
                        javax.mail.Address[] addr)
                 throws javax.mail.SendFailedException,
                        javax.mail.MessagingException,
                        JavaMailNuggetException
Description copied from class: JavaMailNugget
Send the message to the address. This method will perform a msg.saveChange() before sending out the message.

Specified by:
sendMessage in class JavaMailNugget
Parameters:
msg - the message to be sent.
addr - an array of Address objects that are going to be sent. If this parameter is null, it will use the addresses from msg.getAllRecipients() instead.
Throws:
javax.mail.SendFailedException
javax.mail.MessagingException
JavaMailNuggetException

reconnectIMAP

protected boolean reconnectIMAP()
                         throws JavaMailNuggetException
Throws:
JavaMailNuggetException

setJavaMailProperties

protected void setJavaMailProperties()
                              throws InvalidSettingException
Throws:
InvalidSettingException

getUsageFromFolder

protected Usage getUsageFromFolder(javax.mail.Folder inFolder)
                            throws javax.mail.MessagingException
get mailbox usage quota on a folder.

Throws:
javax.mail.MessagingException

setDebug

public void setDebug()

fetchCredential

protected Credential fetchCredential(java.lang.String protocol,
                                     java.lang.String settingKey)
                              throws InvalidSettingException
Fetch the credential from the DataStore.

Throws:
InvalidSettingException

checkNonNull

protected void checkNonNull(java.lang.String key)
                     throws InvalidSettingException
Throws:
InvalidSettingException

checkWithDefault

protected void checkWithDefault(java.lang.String key,
                                java.lang.String defaultValue)
                         throws InvalidSettingException
Throws:
InvalidSettingException

checkEmail

protected void checkEmail(java.lang.String key)
                   throws InvalidSettingException
Throws:
InvalidSettingException

checkBoolean

protected void checkBoolean(java.lang.String key)
                     throws InvalidSettingException
Throws:
InvalidSettingException

checkInt

protected void checkInt(java.lang.String key)
                 throws InvalidSettingException
Throws:
InvalidSettingException

settingsToProperties

protected void settingsToProperties(java.lang.String key,
                                    java.util.Properties props)

openFolder

protected boolean openFolder(javax.mail.Folder folder)
                      throws javax.mail.FolderNotFoundException,
                             javax.mail.MessagingException
Returns:
true if the opened folder can hold messages.
Throws:
javax.mail.FolderNotFoundException
javax.mail.MessagingException

checkFolderForUIDOps

protected void checkFolderForUIDOps(javax.mail.Folder folder)
                             throws javax.mail.FolderNotFoundException,
                                    javax.mail.MessagingException,
                                    JavaMailNuggetException
Throws:
javax.mail.FolderNotFoundException
javax.mail.MessagingException
JavaMailNuggetException

checkUIDValidity

public void checkUIDValidity(javax.mail.Folder folder,
                             long orgUIDValidity)
                      throws InvalidUIDException,
                             javax.mail.MessagingException
Description copied from class: JavaMailNugget
This method will throw an InvalidUIDException if the folder's current UIDValidity value is not the same as the original value.

Specified by:
checkUIDValidity in class JavaMailNugget
Parameters:
folder - The folder object must be an UIDFolder instance and should be already opened.
orgUIDValidity - The original UIDValidity value. If it is a negative number, no check will be performed.
Throws:
InvalidUIDException
javax.mail.MessagingException

getUID

protected long getUID(javax.mail.UIDFolder uf,
                      javax.mail.Message msg)
               throws MessageNotInFolderException,
                      javax.mail.MessagingException
Throws:
MessageNotInFolderException
javax.mail.MessagingException

getLoginUser

protected java.lang.String getLoginUser(java.lang.String configKey)

getLoginPassword

protected java.lang.String getLoginPassword(java.lang.String configKey)

getActualSetting

protected java.lang.String getActualSetting(java.lang.String configKey)
This method return the actual value of a setting. A setting value can be the literal string or referencing another value in the Entity's user space. This method will interpret the initial value of the setting and fetch the actual value from the user space if necessary.

Returns:
The actual value, which can be literal string or the dereferenced value from the user space. It will return null if the specified setting does not exists or the dereferenced value is null.

isCachable

public boolean isCachable()
Description copied from class: JavaMailNugget
This method indicates whether the Nugget implementation is a cachable nugget. A cachable nugget will be instantiate only once during the lifetime of the associated Entity. The nugget instance will be reused for future requests. On the other hand, a non-cachable nugget will be instantiated every time that the getNugget() method is invoked. A Nugget implementation can be cachable only if every method is thread safe and atomic. Namely, if there are multiple threads access it at the same time, they will not interfere each other.

Specified by:
isCachable in class JavaMailNugget
Returns:
true if the Nugget implementation is cachable, false otherwise.

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.