01: /***
02: * jwma Java WebMail
03: * Copyright (c) 2000-2003 jwma team
04: *
05: * jwma is free software; you can distribute and use this source
06: * under the terms of the BSD-style license received along with
07: * the distribution.
08: ***/package dtw.webmail;
09:
10: import javax.mail.*;
11: import java.io.Serializable;
12:
13: /**
14: * Class that implements an authenticator.
15: * <p>
16: *
17: * @author Dieter Wimberger
18: * @version 0.9.7 07/02/2003
19: */
20: public class JwmaAuthenticator extends Authenticator {
21:
22: private PasswordAuthentication m_Authentication;
23:
24: public JwmaAuthenticator(String username, String password) {
25: m_Authentication = new PasswordAuthentication(username,
26: password);
27: }//constructor
28:
29: protected PasswordAuthentication getPasswordAuthentication() {
30: //FIXME: Handle/extend to check for usage
31: return m_Authentication;
32: }//getPasswordAuthentication
33:
34: /**
35: * Returns the password associated with this
36: * Authenticator.
37: */
38: public String getPassword() {
39: return m_Authentication.getPassword();
40: }//getPassword
41:
42: /**
43: * Returns the username associated with this
44: * Authenticator.
45: *
46: */
47: public String getUserName() {
48: return m_Authentication.getUserName();
49: }//getUsername
50:
51: }//JwmaAuthenticator
|