public class CachingPublicKeyAuthenticator extends Object implements PublickeyAuthenticator, SessionListener
SessionListener.Event
Modifier and Type | Field and Description |
---|---|
protected PublickeyAuthenticator |
authenticator |
protected Map<ServerSession,Map<PublicKey,Boolean>> |
cache |
Constructor and Description |
---|
CachingPublicKeyAuthenticator(PublickeyAuthenticator authenticator) |
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(String username,
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
|
protected final PublickeyAuthenticator authenticator
protected final Map<ServerSession,Map<PublicKey,Boolean>> cache
public CachingPublicKeyAuthenticator(PublickeyAuthenticator authenticator)
public boolean authenticate(String username, 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
public void sessionEvent(Session session, SessionListener.Event event)
SessionListener
sessionEvent
in interface SessionListener
public void sessionClosed(Session session)
SessionListener
sessionClosed
in interface SessionListener
Copyright © 2008–2018 The Apache Software Foundation. All rights reserved.