|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.subethamail.smtp.auth.PluginAuthenticationHandler
public class PluginAuthenticationHandler
This handler makes it possible to sum the capabilities of two or more handlers types.
Hence, you can design a single handler for each authentication mechanism and decide how many
authentication mechanisms to support by simply plugging them here.
Constructor Summary | |
---|---|
PluginAuthenticationHandler()
Creates a new instance of PluginAuthenticationHandler |
Method Summary | |
---|---|
void |
addPlugin(AuthenticationHandler plugin)
|
boolean |
auth(java.lang.String clientInput,
java.lang.StringBuilder response,
ConnectionContext ctx)
Initially called using an input string in the RFC2554 form: "AUTH |
AuthenticationHandler |
getActiveHandler()
|
java.util.List<java.lang.String> |
getAuthenticationMechanisms()
If your handler supports RFC 2554 at some degree, then it must return all the supported mechanisms here. |
java.util.List<AuthenticationHandler> |
getPlugins()
|
void |
resetState()
Since a so-designed handler has its own state, it seems reasonable to enable resetting its state. |
void |
setActiveHandler(AuthenticationHandler activeHandler)
|
void |
setPlugins(java.util.List<AuthenticationHandler> plugins)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PluginAuthenticationHandler()
Method Detail |
---|
public java.util.List<java.lang.String> getAuthenticationMechanisms()
AuthenticationHandler
getAuthenticationMechanisms
in interface AuthenticationHandler
public boolean auth(java.lang.String clientInput, java.lang.StringBuilder response, ConnectionContext ctx) throws RejectException
AuthenticationHandler
response
parameter) at each clientInput
.
Depending on the authentication mechanism, the handshaking process may require
many request-response passes. This method will return true
only when the authentication process is finished
auth
in interface AuthenticationHandler
clientInput
- The client's input.response
- a buffer filled with your response to the client input.ctx
- the connection context filled with the credential of the user if authentication succeeds.
true
if the authentication process is finished, false
otherwise.
RejectException
- if authentication fails.public void resetState()
AuthenticationHandler
resetState
in interface AuthenticationHandler
public java.util.List<AuthenticationHandler> getPlugins()
public void addPlugin(AuthenticationHandler plugin)
public void setPlugins(java.util.List<AuthenticationHandler> plugins)
public AuthenticationHandler getActiveHandler()
public void setActiveHandler(AuthenticationHandler activeHandler)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |