Nitido Inc.

com.nitido.nimx.nuggets.extmail.real
Class ExternalMailNuggetImpl

java.lang.Object
  extended by com.nitido.nim.Nugget
      extended by com.nitido.nim.NonCachableNugget
          extended by com.nitido.nimx.nuggets.extmail.ExternalMailNugget
              extended by com.nitido.nimx.nuggets.extmail.real.ExternalMailNuggetImpl
All Implemented Interfaces:
java.io.Serializable

public class ExternalMailNuggetImpl
extends ExternalMailNugget

Actual implementation of ExternalMailNugget.

See Also:
Serialized Form

Field Summary
static java.lang.String JM_KEY_POP3_CONNECTIONTIMEOUT
           
static java.lang.String JM_KEY_POP3_RESETBEFOREQUIT
           
static java.lang.String JM_KEY_POP3_TIMEOUT
           
static java.lang.String JM_KEY_STORE_PROTOCOL
           
 
Fields inherited from class com.nitido.nimx.nuggets.extmail.ExternalMailNugget
DEFAULT_CONNECTIONTIMEOUT, DEFAULT_TIMEOUT, KEY_JAVAMAIL_DEBUG, KEY_POP3_CONNECTIONTIMEOUT, KEY_POP3_TIMEOUT
 
Fields inherited from class com.nitido.nim.Nugget
_entity, _nim, _nuggetName, _settings
 
Constructor Summary
ExternalMailNuggetImpl(NuggetVisa visa)
          Default constructor
 
Method Summary
 void activate()
          Used by NiM Nugget mechnanism.
 javax.mail.Folder connect(java.lang.String host, int port, java.lang.String username, java.lang.String password, boolean leaveMail)
          Get the folder that represents the 'root' of the mailbox.
 javax.mail.Folder connect(java.lang.String host, int port, java.lang.String username, java.lang.String password, boolean leaveMail, boolean useSSL)
          Get the folder that represents the 'root' of the mailbox.
 void deactivate()
          Used by NiM Nugget mechnanism.
 void disconnect()
          Complete disconnect from the backend server.
 java.lang.String getDescriptor()
          Used by NiM Nugget mechnanism.
protected  void initImpl()
          This method is called by the init() method after the member variables _nuggetName, _entity and _settings are assigned.
protected  boolean openFolder(javax.mail.Folder folder)
           
protected  void settingsToProperties(java.util.Properties props, java.lang.String settingKey, java.lang.String propKey, java.lang.String defaultValue)
           
 
Methods inherited from class com.nitido.nimx.nuggets.extmail.ExternalMailNugget
checkBoolean, checkEmail, checkInt, checkNonNull, checkWithDefault, settingsToProperties
 
Methods inherited from class com.nitido.nim.NonCachableNugget
isCachable
 
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
 

Field Detail

JM_KEY_STORE_PROTOCOL

public static final java.lang.String JM_KEY_STORE_PROTOCOL
See Also:
Constant Field Values

JM_KEY_POP3_CONNECTIONTIMEOUT

public static final java.lang.String JM_KEY_POP3_CONNECTIONTIMEOUT
See Also:
Constant Field Values

JM_KEY_POP3_TIMEOUT

public static final java.lang.String JM_KEY_POP3_TIMEOUT
See Also:
Constant Field Values

JM_KEY_POP3_RESETBEFOREQUIT

public static final java.lang.String JM_KEY_POP3_RESETBEFOREQUIT
See Also:
Constant Field Values
Constructor Detail

ExternalMailNuggetImpl

public ExternalMailNuggetImpl(NuggetVisa visa)
Default constructor

Method Detail

initImpl

protected void initImpl()
                 throws InitializationFailedException,
                        InvalidSettingException
Description copied from class: Nugget
This method is called by the init() method after the member variables _nuggetName, _entity and _settings are assigned. This method allows nugget implementations to put in code for initializing itself.

Specified by:
initImpl in class Nugget
Throws:
InitializationFailedException - If unable to initialize the nugget with the given parameters.
InvalidSettingException - If any of the expected initialization settings are null.

connect

public javax.mail.Folder connect(java.lang.String host,
                                 int port,
                                 java.lang.String username,
                                 java.lang.String password,
                                 boolean leaveMail)
                          throws javax.mail.MessagingException,
                                 ExternalMailNuggetException
Description copied from class: ExternalMailNugget
Get the folder that represents the 'root' of the mailbox.

Specified by:
connect in class ExternalMailNugget
Parameters:
host - The host name of the target external POP3 server.
port - The port of the target external POP3 server.
username - The external POP3 server's login user name.
password - The external POP3 server's login user password.
leaveMail - The flag to indicate whether to leave emails on the external POP3 server after downloaded them.
Returns:
an opened Folder object for the requested folder.
Throws:
javax.mail.MessagingException
ExternalMailNuggetException

connect

public javax.mail.Folder connect(java.lang.String host,
                                 int port,
                                 java.lang.String username,
                                 java.lang.String password,
                                 boolean leaveMail,
                                 boolean useSSL)
                          throws javax.mail.MessagingException,
                                 ExternalMailNuggetException
Get the folder that represents the 'root' of the mailbox.

Specified by:
connect in class ExternalMailNugget
Parameters:
host - The host name of the target external POP3 server.
port - The port of the target external POP3 server.
username - The external POP3 server's login user name.
password - The external POP3 server's login user password.
leaveMail - The flag to indicate whether to leave emails on the external POP3 server after downloaded them.
useSSL - The flag to indicate whether to use SSL socket to connect to the external POP3 server.
Returns:
an opened Folder object for the requested folder.
Throws:
javax.mail.MessagingException
ExternalMailNuggetException

disconnect

public void disconnect()
                throws javax.mail.MessagingException,
                       ExternalMailNuggetException
Complete disconnect from the backend server.

Specified by:
disconnect in class ExternalMailNugget
Throws:
javax.mail.MessagingException
ExternalMailNuggetException

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.

settingsToProperties

protected void settingsToProperties(java.util.Properties props,
                                    java.lang.String settingKey,
                                    java.lang.String propKey,
                                    java.lang.String defaultValue)

openFolder

protected boolean openFolder(javax.mail.Folder folder)
                      throws javax.mail.FolderNotFoundException,
                             javax.mail.MessagingException
Throws:
javax.mail.FolderNotFoundException
javax.mail.MessagingException

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.