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
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 sessionClosed(Session session)
SessionListener
sessionClosed
in interface SessionListener
session
- The closed Session
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.