|
Email Answering System Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.mail.Authenticator | +--com.ninecode.email.connector.EmailAuthenticator
An authenticator for email connection attempts. Differs from the model because this doesn't interact with the user (yeah, that'd be good in the J2EE environment eh?) and must be pre-charged with all the information it may need when asked. This class holds two sets of user names and passwords, one for the Transport provider and one for the Store provider. It uses the protocol to determine which to return to the caller.
Field Summary | |
protected String |
mStorePassword
The current value of Store password. |
protected String |
mStoreUserName
The current value of Store user name. |
protected String |
mTransportPassword
The current value of Transport password. |
protected String |
mTransportUserName
The current value of Transport user name. |
Constructor Summary | |
protected |
EmailAuthenticator()
Creates a default instance of EmailAuthenticator. |
protected |
EmailAuthenticator(String transport_username,
String transport_password,
String store_username,
String store_password)
Creates a new instance of an EmailAuthenticator with the user names and passwords given. |
Method Summary | |
PasswordAuthentication |
getPasswordAuthentication()
Get authentication details. |
protected String |
getStorePassword()
Getter for property storePassword. |
protected String |
getStoreUserName()
Getter for property storeUserName. |
protected String |
getTransportPassword()
Getter for property transportPassword. |
protected String |
getTransportUserName()
Getter for property transportUserName. |
protected void |
setStorePassword(String password)
Setter for property storePassword. |
protected void |
setStoreUserName(String user)
Setter for property storeUserName. |
protected void |
setTransportPassword(String password)
Setter for property transportPassword. |
protected void |
setTransportUserName(String user)
Setter for property transportUserName. |
Methods inherited from class javax.mail.Authenticator |
getDefaultUserName, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingSite |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String mTransportUserName
protected String mTransportPassword
protected String mStoreUserName
protected String mStorePassword
Constructor Detail |
protected EmailAuthenticator()
user.name
property from the
System properties, and the passwords are set to empty strings.
Useful only if the user names and passwords are set later.
setTransportUserName(java.lang.String)
,
setTransportPassword(java.lang.String)
,
setStoreUserName(java.lang.String)
,
setStorePassword(java.lang.String)
protected EmailAuthenticator(String transport_username, String transport_password, String store_username, String store_password)
transport_username
- The user name to authenticate Transport protocols with.transport_password
- The password to authenticate Transport protocols with.store_username
- The user name to authenticate Store protocols with.store_password
- The password to authenticate Store protocols with.Method Detail |
protected String getTransportUserName()
protected void setTransportUserName(String user)
user
- New value of property transportUserName.
IllegalArgumentException
- if the user name is null
.protected String getTransportPassword()
protected void setTransportPassword(String password)
password
- New value of property transportPassword.
IllegalArgumentException
- if the password is null
.protected String getStoreUserName()
protected void setStoreUserName(String user)
user
- New value of property storeUserName.
IllegalArgumentException
- if the user name is null
.protected String getStorePassword()
protected void setStorePassword(String password)
password
- New value of property storePassword.
IllegalArgumentException
- if the password is null
.public PasswordAuthentication getPasswordAuthentication()
Protocol | User/Password |
---|---|
smtp | Transport |
pop3 | Store |
imap | Store |
If the protocol is unrecognized, it attempts to match the default user name with the Store and Transport user names, if one matches it is returned, otherwise the Store user name and password are returned. TODORemove System.out.println.
getPasswordAuthentication
in class Authenticator
|
Email Answering System Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |