Class SessionTimeoutListener
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.session.helpers.SessionTimeoutListener
-
- All Implemented Interfaces:
Runnable
,EventListener
,SessionListener
,SshdEventListener
public class SessionTimeoutListener extends AbstractLoggingBean implements SessionListener, Runnable
Task that iterates over all currently openSession
s and checks each of them for timeouts. If theAbstractSession
has timed out (either authentication or idle timeout), the session will be disconnected.- See Also:
SessionHelper.checkForTimeouts()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.sshd.common.session.SessionListener
SessionListener.Event
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<SessionHelper>
sessions
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description SessionTimeoutListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
void
sessionClosed(Session s)
A session has been closedvoid
sessionCreated(Session session)
A new session just been createdvoid
sessionException(Session session, Throwable t)
An exception was caught and the session will be closed (if not already so).-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.session.SessionListener
sessionDisconnect, sessionEstablished, sessionEvent, sessionNegotiationEnd, sessionNegotiationOptionsCreated, sessionNegotiationStart, sessionPeerIdentificationLine, sessionPeerIdentificationReceived, sessionPeerIdentificationSend
-
-
-
-
Field Detail
-
sessions
protected final Set<SessionHelper> sessions
-
-
Method Detail
-
sessionCreated
public void sessionCreated(Session session)
Description copied from interface:SessionListener
A new session just been created- Specified by:
sessionCreated
in interfaceSessionListener
- Parameters:
session
- The createdSession
-
sessionException
public void sessionException(Session session, Throwable t)
Description copied from interface:SessionListener
An exception was caught and the session will be closed (if not already so). Note: the code makes no guarantee that at this stageSessionListener.sessionClosed(Session)
will be called or perhaps has already been called- Specified by:
sessionException
in interfaceSessionListener
- Parameters:
session
- The referencedSession
t
- The caught exception
-
sessionClosed
public void sessionClosed(Session s)
Description copied from interface:SessionListener
A session has been closed- Specified by:
sessionClosed
in interfaceSessionListener
- Parameters:
s
- The closedSession
-
-