T
- as Token
E
- as TokenEvent
public interface TokenGenerator<T extends Token<T>,R extends TokenRequest,E extends TokenEvent<T>> extends ChangeGenerator<E>
TokenRequest
.TokenGenerator
maybe on a different machine like a phone etc.TokenGenerator
may be the same or consult a TokenDispatcher
.Modifier and Type | Method and Description |
---|---|
T |
generate(R request,
SingleTokenEvent<T> tokenEvent)
Generate a
Token based on Application defined input. |
T |
reGenerate(R request,
SingleTokenEvent<T> tokenEvent)
Incase of any error or problem, re-generate last token.
|
boolean |
validate(R request)
Similar to
#generate(TokenRequest) , however in this case
there is no commitment to creating the actual Token . |
addChangeListener, getListeners, notifyAllListeners, setListeners
T generate(R request, SingleTokenEvent<T> tokenEvent) throws TokenGenerationException
Token
based on Application defined input.R
- as requesttokenEvent
- as SingleTokenEvent, for optional TokenEvent.getBehaviors()
to be passedTokenGenerationException
T reGenerate(R request, SingleTokenEvent<T> tokenEvent) throws TokenProcessingException
R
- as requesttokenEvent
- as SingleTokenEvent, for optional TokenEvent.getBehaviors()
to be passedTokenProcessingException
boolean validate(R request) throws TokenGenerationException
#generate(TokenRequest)
, however in this case
there is no commitment to creating the actual Token
. if
it throws and Exception or returns false then means validation did not pass.request
- as TokenGenerationException
Copyright © 2018. All rights reserved.