Package com.sshtools.daemon.terminal
Class TerminalIO
- java.lang.Object
-
- com.sshtools.daemon.terminal.TerminalIO
-
- All Implemented Interfaces:
PseudoTerminal
public class TerminalIO extends java.lang.Object implements PseudoTerminal
- Version:
- $Revision: 1.13 $
- Author:
- $author$
-
-
Field Summary
Fields Modifier and Type Field Description static int
BACKSPACE
static int
BCOLOR
static int
BEL
static int
BLACK
static int
BLINK
static int
BLINK_OFF
static int
BLUE
static int
BOLD
static int
BOLD_OFF
static int
BS
static int
BYTEMISSING
static int
CharacterUpdate
static int
COLORINIT
static int
CR
static java.lang.String
CRLF
static int
CYAN
static int
DEL
static int
DELETE
static int
DOWN
static int
EBOL
static int
EBOS
static int
EditBuffer
static int
EEL
static int
EEOL
static int
EEOS
static int
EES
static int
ENTER
static int
EOL_CR
static int
EOL_CRLF
static int
ESCAPE
static int
FCOLOR
static int
GREEN
static int
HANDLED
static int[]
HOME
static int
IOERROR
static int
ITALIC
static int
ITALIC_OFF
static int
LEFT
static int
LF
static int
LineEditBuffer
static int
LineUpdate
static int
LOGOUTREQUEST
static int
MAGENTA
static int
RED
static int
RESET
static int
RESTORECURSOR
static int
RIGHT
static int
ScreenpartUpdate
static int
STORECURSOR
static int
STYLE
static int
TABULATOR
static int
UNDERLINED
static int
UNDERLINED_OFF
static int
UNRECOGNIZED
static int
UP
static int
white
static int
YELLOW
-
Fields inherited from interface com.sshtools.j2ssh.session.PseudoTerminal
CS7, CS8, ECHO, ECHOCTL, ECHOE, ECHOK, ECHOKE, ECHONL, ICANON, ICRNL, IEXTEN, IGNCR, IGNPAR, IMAXBEL, INLCR, INPCK, ISIG, ISTRIP, IUCLC, IXANY, IXOFF, IXON, NOFLSH, OCRNL, OLCUC, ONLCR, ONLRET, ONOCR, OPOST, PARENB, PARMRK, PARODD, PENDIN, TOSTOP, TTY_OP_END, TTY_OP_ISPEED, TTY_OP_OSPEED, VDISCARD, VDSUSP, VEOF, VEOL, VEOL2, VERASE, VFLUSH, VINTR, VKILL, VLNEXT, VQUIT, VREPRINT, VSTART, VSTATUS, VSTOP, VSUSP, VSWTCH, VWERASE, XCASE
-
-
Constructor Summary
Constructors Constructor Description TerminalIO(java.io.InputStream in, java.io.OutputStream out, java.lang.String term, int cols, int rows)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attachStreams(java.io.InputStream in, java.io.OutputStream out)
void
bell()
void
bindSlaveInputStream(java.io.InputStream slaveIn)
void
bindSlaveOutputStream(java.io.OutputStream slaveOut)
void
close()
void
closeInput()
void
closeOutput()
boolean
defineScrollRegion(int topmargin, int bottommargin)
void
detachStreams()
void
eraseLine()
void
eraseScreen()
void
eraseToBeginOfLine()
void
eraseToBeginOfScreen()
void
eraseToEndOfLine()
void
eraseToEndOfScreen()
void
flush()
java.io.InputStream
getAttachedInputStream()
java.io.OutputStream
getAttachedOutputStream()
int
getColumns()
java.lang.String
getEncodedTerminalModes()
int
getEOL()
java.lang.String
getEOLString()
int
getHeight()
java.io.InputStream
getMasterInputStream()
int
getRows()
java.io.OutputStream
getSlaveOutputStream()
java.lang.String
getTerm()
Terminal
getTerminal()
int
getWidth()
void
homeCursor()
boolean
isAutoflushing()
boolean
isSignalling()
void
moveCursor(int direction, int times)
void
moveDown(int times)
void
moveLeft(int times)
void
moveRight(int times)
void
moveUp(int times)
void
println()
void
println(java.lang.String str)
int
read()
void
resetAttributes()
void
restoreCursor()
void
setAutoflushing(boolean b)
void
setBackgroundColor(int color)
void
setBlink(boolean b)
void
setBold(boolean b)
void
setCursor(int row, int col)
void
setDefaultTerminal()
void
setEOL(int eol)
void
setForegroundColor(int color)
void
setItalic(boolean b)
void
setSignalling(boolean bool)
void
setTerminal(java.lang.String terminalName)
void
setUnderlined(boolean b)
void
storeCursor()
void
write(byte b)
void
write(byte[] sequence)
void
write(char ch)
void
write(int i)
void
write(int[] sequence)
void
write(java.lang.String str)
-
-
-
Field Detail
-
EOL_CRLF
public static final int EOL_CRLF
- See Also:
- Constant Field Values
-
EOL_CR
public static final int EOL_CR
- See Also:
- Constant Field Values
-
HOME
public static final int[] HOME
-
IOERROR
public static final int IOERROR
- See Also:
- Constant Field Values
-
UP
public static final int UP
- See Also:
- Constant Field Values
-
DOWN
public static final int DOWN
- See Also:
- Constant Field Values
-
RIGHT
public static final int RIGHT
- See Also:
- Constant Field Values
-
LEFT
public static final int LEFT
- See Also:
- Constant Field Values
-
STORECURSOR
public static final int STORECURSOR
- See Also:
- Constant Field Values
-
RESTORECURSOR
public static final int RESTORECURSOR
- See Also:
- Constant Field Values
-
EEOL
public static final int EEOL
- See Also:
- Constant Field Values
-
EBOL
public static final int EBOL
- See Also:
- Constant Field Values
-
EEL
public static final int EEL
- See Also:
- Constant Field Values
-
EEOS
public static final int EEOS
- See Also:
- Constant Field Values
-
EBOS
public static final int EBOS
- See Also:
- Constant Field Values
-
EES
public static final int EES
- See Also:
- Constant Field Values
-
ESCAPE
public static final int ESCAPE
- See Also:
- Constant Field Values
-
BYTEMISSING
public static final int BYTEMISSING
- See Also:
- Constant Field Values
-
UNRECOGNIZED
public static final int UNRECOGNIZED
- See Also:
- Constant Field Values
-
ENTER
public static final int ENTER
- See Also:
- Constant Field Values
-
TABULATOR
public static final int TABULATOR
- See Also:
- Constant Field Values
-
DELETE
public static final int DELETE
- See Also:
- Constant Field Values
-
BACKSPACE
public static final int BACKSPACE
- See Also:
- Constant Field Values
-
COLORINIT
public static final int COLORINIT
- See Also:
- Constant Field Values
-
HANDLED
public static final int HANDLED
- See Also:
- Constant Field Values
-
LOGOUTREQUEST
public static final int LOGOUTREQUEST
- See Also:
- Constant Field Values
-
LineUpdate
public static final int LineUpdate
- See Also:
- Constant Field Values
-
CharacterUpdate
public static final int CharacterUpdate
- See Also:
- Constant Field Values
-
ScreenpartUpdate
public static final int ScreenpartUpdate
- See Also:
- Constant Field Values
-
EditBuffer
public static final int EditBuffer
- See Also:
- Constant Field Values
-
LineEditBuffer
public static final int LineEditBuffer
- See Also:
- Constant Field Values
-
BEL
public static final int BEL
- See Also:
- Constant Field Values
-
BS
public static final int BS
- See Also:
- Constant Field Values
-
DEL
public static final int DEL
- See Also:
- Constant Field Values
-
CR
public static final int CR
- See Also:
- Constant Field Values
-
LF
public static final int LF
- See Also:
- Constant Field Values
-
FCOLOR
public static final int FCOLOR
- See Also:
- Constant Field Values
-
BCOLOR
public static final int BCOLOR
- See Also:
- Constant Field Values
-
STYLE
public static final int STYLE
- See Also:
- Constant Field Values
-
RESET
public static final int RESET
- See Also:
- Constant Field Values
-
BOLD
public static final int BOLD
- See Also:
- Constant Field Values
-
BOLD_OFF
public static final int BOLD_OFF
- See Also:
- Constant Field Values
-
ITALIC
public static final int ITALIC
- See Also:
- Constant Field Values
-
ITALIC_OFF
public static final int ITALIC_OFF
- See Also:
- Constant Field Values
-
BLINK
public static final int BLINK
- See Also:
- Constant Field Values
-
BLINK_OFF
public static final int BLINK_OFF
- See Also:
- Constant Field Values
-
UNDERLINED
public static final int UNDERLINED
- See Also:
- Constant Field Values
-
UNDERLINED_OFF
public static final int UNDERLINED_OFF
- See Also:
- Constant Field Values
-
BLACK
public static final int BLACK
- See Also:
- Constant Field Values
-
RED
public static final int RED
- See Also:
- Constant Field Values
-
GREEN
public static final int GREEN
- See Also:
- Constant Field Values
-
YELLOW
public static final int YELLOW
- See Also:
- Constant Field Values
-
BLUE
public static final int BLUE
- See Also:
- Constant Field Values
-
MAGENTA
public static final int MAGENTA
- See Also:
- Constant Field Values
-
CYAN
public static final int CYAN
- See Also:
- Constant Field Values
-
white
public static final int white
- See Also:
- Constant Field Values
-
CRLF
public static final java.lang.String CRLF
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMasterInputStream
public java.io.InputStream getMasterInputStream()
- Returns:
-
bindSlaveInputStream
public void bindSlaveInputStream(java.io.InputStream slaveIn)
- Parameters:
slaveIn
-
-
bindSlaveOutputStream
public void bindSlaveOutputStream(java.io.OutputStream slaveOut)
- Parameters:
slaveOut
-
-
getSlaveOutputStream
public java.io.OutputStream getSlaveOutputStream()
- Returns:
-
getWidth
public int getWidth()
- Specified by:
getWidth
in interfacePseudoTerminal
- Returns:
-
getHeight
public int getHeight()
- Specified by:
getHeight
in interfacePseudoTerminal
- Returns:
-
getTerm
public java.lang.String getTerm()
- Specified by:
getTerm
in interfacePseudoTerminal
- Returns:
-
getEncodedTerminalModes
public java.lang.String getEncodedTerminalModes()
- Specified by:
getEncodedTerminalModes
in interfacePseudoTerminal
- Returns:
-
getAttachedInputStream
public java.io.InputStream getAttachedInputStream() throws java.io.IOException
- Throws:
java.io.IOException
-
getAttachedOutputStream
public java.io.OutputStream getAttachedOutputStream() throws java.io.IOException
- Returns:
- Throws:
java.io.IOException
-
detachStreams
public void detachStreams()
-
getEOL
public int getEOL()
- Returns:
-
getEOLString
public java.lang.String getEOLString()
- Returns:
-
setEOL
public void setEOL(int eol)
- Parameters:
eol
-
-
attachStreams
public void attachStreams(java.io.InputStream in, java.io.OutputStream out)
- Parameters:
in
-out
-
-
read
public int read() throws java.io.IOException
- Returns:
- Throws:
java.io.IOException
-
write
public void write(char ch) throws java.io.IOException
- Parameters:
ch
-- Throws:
java.io.IOException
-
write
public void write(java.lang.String str) throws java.io.IOException
- Parameters:
str
-- Throws:
java.io.IOException
-
println
public void println(java.lang.String str) throws java.io.IOException
- Parameters:
str
-- Throws:
java.io.IOException
-
println
public void println() throws java.io.IOException
- Throws:
java.io.IOException
-
eraseToEndOfLine
public void eraseToEndOfLine() throws java.io.IOException
- Throws:
java.io.IOException
-
eraseToBeginOfLine
public void eraseToBeginOfLine() throws java.io.IOException
- Throws:
java.io.IOException
-
eraseLine
public void eraseLine() throws java.io.IOException
- Throws:
java.io.IOException
-
eraseToEndOfScreen
public void eraseToEndOfScreen() throws java.io.IOException
- Throws:
java.io.IOException
-
eraseToBeginOfScreen
public void eraseToBeginOfScreen() throws java.io.IOException
- Throws:
java.io.IOException
-
eraseScreen
public void eraseScreen() throws java.io.IOException
- Throws:
java.io.IOException
-
moveCursor
public void moveCursor(int direction, int times) throws java.io.IOException
- Parameters:
direction
-times
-- Throws:
java.io.IOException
-
moveLeft
public void moveLeft(int times) throws java.io.IOException
- Parameters:
times
-- Throws:
java.io.IOException
-
moveRight
public void moveRight(int times) throws java.io.IOException
- Parameters:
times
-- Throws:
java.io.IOException
-
moveUp
public void moveUp(int times) throws java.io.IOException
- Parameters:
times
-- Throws:
java.io.IOException
-
moveDown
public void moveDown(int times) throws java.io.IOException
- Parameters:
times
-- Throws:
java.io.IOException
-
setCursor
public void setCursor(int row, int col) throws java.io.IOException
- Parameters:
row
-col
-- Throws:
java.io.IOException
-
homeCursor
public void homeCursor() throws java.io.IOException
- Throws:
java.io.IOException
-
storeCursor
public void storeCursor() throws java.io.IOException
- Throws:
java.io.IOException
-
restoreCursor
public void restoreCursor() throws java.io.IOException
- Throws:
java.io.IOException
-
closeInput
public void closeInput() throws java.io.IOException
- Throws:
java.io.IOException
-
write
public void write(byte b) throws java.io.IOException
- Parameters:
b
-- Throws:
java.io.IOException
-
write
public void write(int i) throws java.io.IOException
- Parameters:
i
-- Throws:
java.io.IOException
-
write
public void write(byte[] sequence) throws java.io.IOException
- Parameters:
sequence
-- Throws:
java.io.IOException
-
write
public void write(int[] sequence) throws java.io.IOException
- Parameters:
sequence
-- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Throws:
java.io.IOException
-
closeOutput
public void closeOutput() throws java.io.IOException
- Throws:
java.io.IOException
-
setSignalling
public void setSignalling(boolean bool)
- Parameters:
bool
-
-
isSignalling
public boolean isSignalling()
- Returns:
-
bell
public void bell() throws java.io.IOException
- Throws:
java.io.IOException
-
defineScrollRegion
public boolean defineScrollRegion(int topmargin, int bottommargin) throws java.io.IOException
- Parameters:
topmargin
-bottommargin
-- Returns:
- Throws:
java.io.IOException
-
setForegroundColor
public void setForegroundColor(int color) throws java.io.IOException
- Parameters:
color
-- Throws:
java.io.IOException
-
setBackgroundColor
public void setBackgroundColor(int color) throws java.io.IOException
- Parameters:
color
-- Throws:
java.io.IOException
-
setBold
public void setBold(boolean b) throws java.io.IOException
- Parameters:
b
-- Throws:
java.io.IOException
-
setUnderlined
public void setUnderlined(boolean b) throws java.io.IOException
- Parameters:
b
-- Throws:
java.io.IOException
-
setItalic
public void setItalic(boolean b) throws java.io.IOException
- Parameters:
b
-- Throws:
java.io.IOException
-
setBlink
public void setBlink(boolean b) throws java.io.IOException
- Parameters:
b
-- Throws:
java.io.IOException
-
resetAttributes
public void resetAttributes() throws java.io.IOException
- Throws:
java.io.IOException
-
isAutoflushing
public boolean isAutoflushing()
- Returns:
-
setAutoflushing
public void setAutoflushing(boolean b)
- Parameters:
b
-
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
getTerminal
public Terminal getTerminal()
- Returns:
-
setDefaultTerminal
public void setDefaultTerminal() throws java.io.IOException
- Throws:
java.io.IOException
-
setTerminal
public void setTerminal(java.lang.String terminalName) throws java.io.IOException
- Parameters:
terminalName
-- Throws:
java.io.IOException
-
getRows
public int getRows()
- Specified by:
getRows
in interfacePseudoTerminal
- Returns:
-
getColumns
public int getColumns()
- Specified by:
getColumns
in interfacePseudoTerminal
- Returns:
-
-