Package org.apache.sshd.common.global
Class AbstractOpenSshHostKeysHandler
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.session.helpers.AbstractConnectionServiceRequestHandler
-
- org.apache.sshd.common.global.AbstractOpenSshHostKeysHandler
-
- All Implemented Interfaces:
RequestHandler<ConnectionService>,ConnectionServiceRequestHandler
- Direct Known Subclasses:
OpenSshHostKeysHandler,OpenSshHostKeysHandler
public abstract class AbstractOpenSshHostKeysHandler extends AbstractConnectionServiceRequestHandler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.sshd.common.channel.RequestHandler
RequestHandler.Result
-
-
Field Summary
Fields Modifier and Type Field Description private booleanignoreInvalidKeysprivate BufferPublicKeyParser<? extends java.security.PublicKey>parserprivate java.lang.Stringrequest-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.session.ConnectionServiceRequestHandler
SVC2HNDLR
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOpenSshHostKeysHandler(java.lang.String request)protectedAbstractOpenSshHostKeysHandler(java.lang.String request, BufferPublicKeyParser<? extends java.security.PublicKey> parser)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BufferPublicKeyParser<? extends java.security.PublicKey>getPublicKeysParser()java.lang.StringgetRequestName()protected abstract RequestHandler.ResulthandleHostKeys(Session session, java.util.Collection<? extends java.security.PublicKey> keys, boolean wantReply, Buffer buffer)protected booleanisIgnoreInvalidKeys()RequestHandler.Resultprocess(ConnectionService connectionService, java.lang.String request, boolean wantReply, Buffer buffer)Process an SSH request.protected voidsetIgnoreInvalidKeys(boolean ignore)java.lang.StringtoString()
-
-
-
Field Detail
-
request
private final java.lang.String request
-
parser
private final BufferPublicKeyParser<? extends java.security.PublicKey> parser
-
ignoreInvalidKeys
private boolean ignoreInvalidKeys
-
-
Constructor Detail
-
AbstractOpenSshHostKeysHandler
protected AbstractOpenSshHostKeysHandler(java.lang.String request)
-
AbstractOpenSshHostKeysHandler
protected AbstractOpenSshHostKeysHandler(java.lang.String request, BufferPublicKeyParser<? extends java.security.PublicKey> parser)
-
-
Method Detail
-
getRequestName
public final java.lang.String getRequestName()
-
getPublicKeysParser
public BufferPublicKeyParser<? extends java.security.PublicKey> getPublicKeysParser()
-
process
public RequestHandler.Result process(ConnectionService connectionService, java.lang.String request, boolean wantReply, Buffer buffer) throws java.lang.Exception
Description copied from interface:RequestHandlerProcess an SSH request. If an exception is thrown, the ConnectionService will send a failure message if needed and the request will be considered handled.- Specified by:
processin interfaceConnectionServiceRequestHandler- Specified by:
processin interfaceRequestHandler<ConnectionService>- Overrides:
processin classAbstractConnectionServiceRequestHandler- Parameters:
connectionService- The input parameterrequest- The request stringwantReply- Whether a reply is requestedbuffer- TheBufferwith request specific data- Returns:
- The
RequestHandler.Result - Throws:
java.lang.Exception- If failed to handle the request - Note: in order to signal an unsupported request theRequestHandler.Result.Unsupportedvalue should be returned
-
setIgnoreInvalidKeys
protected void setIgnoreInvalidKeys(boolean ignore)
-
isIgnoreInvalidKeys
protected boolean isIgnoreInvalidKeys()
-
handleHostKeys
protected abstract RequestHandler.Result handleHostKeys(Session session, java.util.Collection<? extends java.security.PublicKey> keys, boolean wantReply, Buffer buffer) throws java.lang.Exception
- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-