Package com.tailf.ned
Class SSHJSession
Object
com.tailf.ned.SSHJSession
- All Implemented Interfaces:
CliSession,SSHClient.CliSession
Class implementing the SSHClient.CliSession interface using
the net.schmizz.sshj framework.
- Author:
- jrendel
-
Field Summary
Fields inherited from interface com.tailf.ned.SSHClient.CliSession
MODE_OCRNL, MODE_ONLRET, MODE_ONOCR -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the SSH sessiongetLine()Return the line bufferReturn the session input readerintReturn the configured read timeoutGet configured println modeReturn the session output writervoidLog on debug levelvoidLog on info levelbooleanready(int timeout) Checks if the input reader is ready for reading.booleanReturns true if session has been closedvoidsetReadTimeout(int readTimeout) Configure the readTimeoutvoidsetTermPrintlnMode(String mode) Configure println modevoidEnable tracervoidAppend to tracervoidtraceInBufAppend(String msg) Append to trace in bufvoidFlush trace in buffer
-
Method Details
-
ready
Checks if the input reader is ready for reading. Done with a blocking read in a separate thread. Called through a Java Future to ensure timeout exception.- Specified by:
readyin interfaceSSHClient.CliSession- Parameters:
timeout- timeout- Returns:
- true if the input reader is ready, false otherwise
- Throws:
IOException- if an I/O error occurs
-
serverSideClosed
public boolean serverSideClosed()Returns true if session has been closed- Specified by:
serverSideClosedin interfaceCliSession
-
close
public void close()Close the SSH session- Specified by:
closein interfaceCliSession
-
getReadTimeout
public int getReadTimeout()Return the configured read timeout- Specified by:
getReadTimeoutin interfaceSSHClient.CliSession
-
setReadTimeout
public void setReadTimeout(int readTimeout) Configure the readTimeout- Specified by:
setReadTimeoutin interfaceSSHClient.CliSession
-
getReader
Return the session input reader- Specified by:
getReaderin interfaceSSHClient.CliSession
-
getWriter
Return the session output writer- Specified by:
getWriterin interfaceSSHClient.CliSession
-
getLine
Return the line buffer- Specified by:
getLinein interfaceSSHClient.CliSession
-
setTracer
Enable tracer- Specified by:
setTracerin interfaceCliSession
-
trace
Append to tracer- Specified by:
tracein interfaceSSHClient.CliSession
-
traceInBufAppend
Append to trace in buf- Specified by:
traceInBufAppendin interfaceSSHClient.CliSession
-
traceInBufFlush
public void traceInBufFlush()Flush trace in buffer- Specified by:
traceInBufFlushin interfaceSSHClient.CliSession
-
logInfo
Log on info level- Specified by:
logInfoin interfaceSSHClient.CliSession
-
logDebug
Log on debug level- Specified by:
logDebugin interfaceSSHClient.CliSession
-
getTermPrintlnMode
Get configured println mode- Specified by:
getTermPrintlnModein interfaceSSHClient.CliSession
-
setTermPrintlnMode
Configure println mode- Specified by:
setTermPrintlnModein interfaceSSHClient.CliSession
-
getInputStream
- Specified by:
getInputStreamin interfaceSSHClient.CliSession
-
getErrorStream
- Specified by:
getErrorStreamin interfaceSSHClient.CliSession
-
getOutputStream
- Specified by:
getOutputStreamin interfaceSSHClient.CliSession
-