org.apache.geronimo.javamail.authentication
Class PlainAuthenticator

java.lang.Object
  extended by org.apache.geronimo.javamail.authentication.PlainAuthenticator
All Implemented Interfaces:
ClientAuthenticator

public class PlainAuthenticator
extends Object
implements ClientAuthenticator


Field Summary
protected  boolean complete
           
protected  String password
           
protected  String username
           
 
Constructor Summary
PlainAuthenticator(String username, String password)
          Main constructor.
 
Method Summary
 byte[] evaluateChallenge(byte[] challenge)
          Evaluate a PLAIN login challenge, returning the a result string that should satisfy the clallenge.
 String getMechanismName()
          Retrieve the authenticator mechanism name.
 boolean hasInitialResponse()
          Respond to the hasInitialResponse query.
 boolean isComplete()
          Indicate whether the challenge/response process is complete.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

username

protected String username

password

protected String password

complete

protected boolean complete
Constructor Detail

PlainAuthenticator

public PlainAuthenticator(String username,
                          String password)
Main constructor.

Parameters:
username - The login user name.
password - The login password.
Method Detail

hasInitialResponse

public boolean hasInitialResponse()
Respond to the hasInitialResponse query. This mechanism does have an initial response, which is the entire challenge sequence.

Specified by:
hasInitialResponse in interface ClientAuthenticator
Returns:
Always returns true.

isComplete

public boolean isComplete()
Indicate whether the challenge/response process is complete.

Specified by:
isComplete in interface ClientAuthenticator
Returns:
True if the last challenge has been processed, false otherwise.

getMechanismName

public String getMechanismName()
Retrieve the authenticator mechanism name.

Specified by:
getMechanismName in interface ClientAuthenticator
Returns:
Always returns the string "PLAIN"

evaluateChallenge

public byte[] evaluateChallenge(byte[] challenge)
                         throws MessagingException
Evaluate a PLAIN login challenge, returning the a result string that should satisfy the clallenge.

Specified by:
evaluateChallenge in interface ClientAuthenticator
Parameters:
challenge - The decoded challenge data, as byte array.
Returns:
A formatted challege response, as an array of bytes.
Throws:
MessagingException


Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.