com.ibm.portal.portlet.service.credentialvault.credentials
Interface JavaMailCredential

All Superinterfaces:
ActiveCredential, Credential, UserPasswordCredential
All Known Implementing Classes:
JavaMailCredential

Deprecated. Since 8.5.

public interface JavaMailCredential
extends UserPasswordCredential

Credential for authenticating at the back-end the javax.mail API. To be used in following way:

  1. Construct and initialize the credential
  2. Create a javax.mail.Session and have it authenticated by the credential
    To do so, call getAuthenticatedSession and supply your session object, the host name and optionally the port number to use
  3. Use the session for business calls to the mail server
Preconditions:

Since:
5.1.0.1

Field Summary
 
Fields inherited from interface com.ibm.portal.portlet.service.credentialvault.credentials.Credential
KEY_CREDENTIAL_SECRET
 
Method Summary
 javax.mail.Session getAuthenticatedSession(javax.mail.Session session, java.lang.String host)
          Deprecated. Authenticates an javax.mail.Session.
 javax.mail.Session getAuthenticatedSession(javax.mail.Session session, java.lang.String host, int port)
          Deprecated. Authenticates an javax.mail.Session.
 int getSecretType()
          Deprecated. Returns the credential's Secret Type in terms of the constants declared in the Credential Vault Portlet Service.
Should be overwritten by any child class that "overwrites" the secret attribute.
 void init(java.util.Map<java.lang.String,java.lang.Object> config)
          Deprecated. Initializes a new JavaMailCredential.
 
Methods inherited from interface com.ibm.portal.portlet.service.credentialvault.credentials.ActiveCredential
isActive
 

Method Detail

init

void init(java.util.Map<java.lang.String,java.lang.Object> config)
          throws CredentialVaultException
Deprecated. 
Initializes a new JavaMailCredential.

Specified by:
init in interface Credential
Specified by:
init in interface UserPasswordCredential
Parameters:
config - The configuration needed to initialize this credential:
  • KEY_CREDENTIAL_SECRET JavaMailCredentialSecret - the credential's secret (mandatory)
Throws:
CredentialVaultException - If any mandatory parameter is missing or has a wrong object type as value.

getSecretType

int getSecretType()
Deprecated. 
Description copied from interface: Credential
Returns the credential's Secret Type in terms of the constants declared in the Credential Vault Portlet Service.
Should be overwritten by any child class that "overwrites" the secret attribute.

Specified by:
getSecretType in interface Credential
Specified by:
getSecretType in interface UserPasswordCredential
Returns:
int Credential Secret Type Identifier
See Also:
CredentialVaultService

getAuthenticatedSession

javax.mail.Session getAuthenticatedSession(javax.mail.Session session,
                                           java.lang.String host)
                                           throws javax.mail.MessagingException
Deprecated. 
Authenticates an javax.mail.Session.

Parameters:
session - The session to authenticate.
host - The mail server host name.
Returns:
Session The authenticated session.
Throws:
javax.mail.MessagingException - thrown if javax.mail.session.getTransport().connect() fails.

getAuthenticatedSession

javax.mail.Session getAuthenticatedSession(javax.mail.Session session,
                                           java.lang.String host,
                                           int port)
                                           throws javax.mail.MessagingException
Deprecated. 
Authenticates an javax.mail.Session.

Parameters:
session - The session to authenticate.
host - The mail server host name.
port - The mail server port number.
Returns:
Session The authenticated session.
Throws:
javax.mail.MessagingException - thrown if javax.mail.session.getTransport().connect() fails.