com.sshtools.terminal.schemes.exe
Class NativeTerminalProtocolTransport

java.lang.Object
  extended by com.sshtools.terminal.schemes.exe.NativeTerminalProtocolTransport
All Implemented Interfaces:
ProfileTransport, TerminalProtocolTranport, VirtualSessionTransport

public class NativeTerminalProtocolTransport
extends java.lang.Object
implements TerminalProtocolTranport

Title:

Description:

Copyright: Copyright (c) 2006

Company:

Author:
not attributable

Constructor Summary
NativeTerminalProtocolTransport()
           
 
Method Summary
 ProfileTransport cloneVirtualSession(VirtualSession session)
          Clone the current virtual session.
 boolean connect(ResourceProfile profile)
          Connect to a host (or resource) using the URI provided in the ResourceProfile}.
 void disconnect()
          Disconnect from the currently connected resource.
 int getDefaultEOL()
          Return the default line edings type.
 java.io.InputStream getErrorInputStream()
          Return an InputStream from which error data can be read from the host.
 java.lang.String getHostDescription()
          If the host has provided some information about itself, this method will return it.
 java.io.InputStream getInputStream()
          Return an InputStream from which data from the host can be read
 java.io.OutputStream getOutputStream()
          Return an OutputStream on to which the emulation can write data back to the host
 ResourceProfile getProfile()
          Get the profile that was used to connect this transport.
 java.lang.String getProtocolDescription()
          Return a short description of the protocol, for example "Telnet" or "SSH2"
 java.lang.Object getProvider()
          Return the underlying provider of the terminal.
 java.lang.String getTransportDescription()
          Return a short description of the transport, for example "Socket" or "SOCKS5"
 VirtualSession getVirtualSession()
          Get the virtual session for this connection
 void init(VirtualSession session)
          Initialise the transport.
 boolean isCloneVirtualSessionSupported()
          Some transports may be capable of cloning the current virtual session (SSH for example).
 boolean isConnected()
          Get if a connection is currently being maintained.
 boolean isConnectionPending()
          Get if a connection is currently pending, e.g.
 boolean isProtocolSecure()
          Is the protocol secure?
 boolean isTransportSecure()
          Is this transport secure?
 void setScreenSize(int w, int h)
          Send a request to set the screen size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeTerminalProtocolTransport

public NativeTerminalProtocolTransport()
Method Detail

cloneVirtualSession

public ProfileTransport cloneVirtualSession(VirtualSession session)
                                     throws java.lang.CloneNotSupportedException,
                                            ProfileException
Clone the current virtual session.

Specified by:
cloneVirtualSession in interface ProfileTransport
Parameters:
session - the virtual session that is going to manage this newly cloned connection
Returns:
the cloned connection
Throws:
java.lang.CloneNotSupportedException - if cloning cannot take place
ProfileException - on any errors that may occur during cloning.

connect

public boolean connect(ResourceProfile profile)
                throws ProfileException,
                       AuthenticationException
Connect to a host (or resource) using the URI provided in the ResourceProfile}.

Specified by:
connect in interface ProfileTransport
Parameters:
profile - profile
Returns:
true if connected OK
Throws:
ProfileException - on any connection error
AuthenticationException - if authentication fails

disconnect

public void disconnect()
                throws java.io.IOException
Disconnect from the currently connected resource.

Specified by:
disconnect in interface ProfileTransport
Throws:
java.io.IOException - on any disconnection error

getDefaultEOL

public int getDefaultEOL()

Return the default line edings type.

Specified by:
getDefaultEOL in interface TerminalProtocolTranport
Returns:
default line endings type

getErrorInputStream

public java.io.InputStream getErrorInputStream()
Return an InputStream from which error data can be read from the host.

Specified by:
getErrorInputStream in interface TerminalProtocolTranport
Returns:
error input stream

getHostDescription

public java.lang.String getHostDescription()
If the host has provided some information about itself, this method will return it.

Specified by:
getHostDescription in interface ProfileTransport
Returns:
host description

getInputStream

public java.io.InputStream getInputStream()
Description copied from interface: TerminalProtocolTranport
Return an InputStream from which data from the host can be read

Specified by:
getInputStream in interface TerminalProtocolTranport
Returns:
input stream from the connected host

getOutputStream

public java.io.OutputStream getOutputStream()
Description copied from interface: TerminalProtocolTranport
Return an OutputStream on to which the emulation can write data back to the host

Specified by:
getOutputStream in interface TerminalProtocolTranport
Returns:
output stream to the connected host

getProfile

public ResourceProfile getProfile()
Get the profile that was used to connect this transport.

Specified by:
getProfile in interface ProfileTransport
Returns:
profile

getProtocolDescription

public java.lang.String getProtocolDescription()
Description copied from interface: ProfileTransport
Return a short description of the protocol, for example "Telnet" or "SSH2"

Specified by:
getProtocolDescription in interface ProfileTransport
Returns:
java.lang.String

getProvider

public java.lang.Object getProvider()
Return the underlying provider of the terminal.

Specified by:
getProvider in interface ProfileTransport
Returns:
java.lang.Object

getTransportDescription

public java.lang.String getTransportDescription()
Description copied from interface: ProfileTransport
Return a short description of the transport, for example "Socket" or "SOCKS5"

Specified by:
getTransportDescription in interface ProfileTransport
Returns:
java.lang.String

getVirtualSession

public VirtualSession getVirtualSession()
Description copied from interface: VirtualSessionTransport
Get the virtual session for this connection

Specified by:
getVirtualSession in interface VirtualSessionTransport
Returns:
virtual session

init

public void init(VirtualSession session)
Initialise the transport.

Specified by:
init in interface VirtualSessionTransport
Parameters:
session - virtual session

isCloneVirtualSessionSupported

public boolean isCloneVirtualSessionSupported()
Some transports may be capable of cloning the current virtual session (SSH for example).

Specified by:
isCloneVirtualSessionSupported in interface ProfileTransport
Returns:
transport supports cloning

isConnected

public boolean isConnected()
Description copied from interface: ProfileTransport
Get if a connection is currently being maintained.

Specified by:
isConnected in interface ProfileTransport
Specified by:
isConnected in interface VirtualSessionTransport
Returns:
connected

isConnectionPending

public boolean isConnectionPending()
Description copied from interface: ProfileTransport
Get if a connection is currently pending, e.g. unauthenticated.

Specified by:
isConnectionPending in interface ProfileTransport
Specified by:
isConnectionPending in interface VirtualSessionTransport
Returns:
connection pending

isProtocolSecure

public boolean isProtocolSecure()
Description copied from interface: ProfileTransport
Is the protocol secure?

Specified by:
isProtocolSecure in interface ProfileTransport
Returns:
boolean

isTransportSecure

public boolean isTransportSecure()
Description copied from interface: ProfileTransport
Is this transport secure?

Specified by:
isTransportSecure in interface ProfileTransport
Returns:
boolean

setScreenSize

public void setScreenSize(int w,
                          int h)
Send a request to set the screen size.

Specified by:
setScreenSize in interface TerminalProtocolTranport
Parameters:
w - new width
h - new height


Copyright © 2003-2004 3SP LTD. All Rights Reserved.