ParameterType
- defining the parameter type for setParams(Object)
TokenType
- defining the token type for getToken()
public interface AuthenticationHandler<ParameterType,TokenType> extends Closeable
AuthenticationHandler
encapsulates a possibly multi-step
authentication protocol. Intended usage:
setParams(something); start(); sendToken(getToken()); while (!isDone()) { setParams(receiveMessageAndExtractParams()); process(); Object t = getToken(); if (t != null) { sendToken(t); } }An
AuthenticationHandler
may be stateful and therefore is a
Closeable
.Modifier and Type | Method and Description |
---|---|
void |
close() |
TokenType |
getToken()
Retrieves the last token generated.
|
boolean |
isDone()
Tells whether is authentication mechanism is done (successfully or
unsuccessfully).
|
void |
process()
Produces the next authentication token, if any.
|
void |
setParams(ParameterType input)
|
void |
start()
Produces the initial authentication token that can be then retrieved via
getToken() . |
void start() throws Exception
getToken()
.Exception
- if an error occursvoid process() throws Exception
Exception
- if an error occursvoid setParams(ParameterType input)
input
- to set, may be null
TokenType getToken() throws Exception
null
if there is noneException
- if an error occursboolean isDone()
void close()
close
in interface AutoCloseable
close
in interface Closeable
Copyright © 2018 Eclipse JGit Project. All rights reserved.