public class CachingPublicKeyAuthenticator extends AbstractLoggingBean implements PublickeyAuthenticator, SessionListener
SessionListener.Event
Modifier and Type | Field and Description |
---|---|
protected PublickeyAuthenticator |
authenticator |
protected java.util.Map<Session,java.util.Map<java.security.PublicKey,java.lang.Boolean>> |
cache |
log
Constructor and Description |
---|
CachingPublicKeyAuthenticator(PublickeyAuthenticator authenticator) |
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(java.lang.String username,
java.security.PublicKey key,
ServerSession session)
Check the validity of a public key.
|
void |
sessionClosed(Session session)
A session has been closed
|
void |
sessionCreated(Session session)
A new session just been created
|
void |
sessionEvent(Session session,
SessionListener.Event event)
An event has been triggered
|
void |
sessionException(Session session,
java.lang.Throwable t)
An exception was caught and the session will be closed
(if not already so).
|
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sessionNegotiationEnd, sessionNegotiationStart, validateListener
validateListener
protected final PublickeyAuthenticator authenticator
protected final java.util.Map<Session,java.util.Map<java.security.PublicKey,java.lang.Boolean>> cache
public CachingPublicKeyAuthenticator(PublickeyAuthenticator authenticator)
public boolean authenticate(java.lang.String username, java.security.PublicKey key, ServerSession session)
PublickeyAuthenticator
authenticate
in interface PublickeyAuthenticator
username
- the usernamekey
- the keysession
- the server sessionpublic void sessionCreated(Session session)
SessionListener
sessionCreated
in interface SessionListener
session
- The created Session
public void sessionEvent(Session session, SessionListener.Event event)
SessionListener
sessionEvent
in interface SessionListener
session
- The referenced Session
event
- The generated SessionListener.Event
public void sessionException(Session session, java.lang.Throwable t)
SessionListener
SessionListener.sessionClosed(Session)
will be called
or perhaps has already been calledsessionException
in interface SessionListener
session
- The referenced Session
t
- The caught exceptionpublic void sessionClosed(Session session)
SessionListener
sessionClosed
in interface SessionListener
session
- The closed Session