eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'NVTClient':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: NVTClient


Inheritance:

   Object
   |
   +--NVTClient
      |
      +--FTPClient
      |
      +--SMTPClient

Package:
stx:goodies/communication
Category:
Net-Communication-Support
Version:
rev: 1.32 date: 2024/04/25 13:47:44
user: stefan
file: NVTClient.st directory: goodies/communication
module: stx stc-classLibrary: communication

Description:


Abstract superclass for Network Virtual Terminal protocol clients;
i.e. FTPCLient, SMTPClient, TelnetClient etc..

copyright

COPYRIGHT (c) 2002 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

Signal constants
o  commandErrorSignal
return the parent of all errors related to command execution

o  connectFailedSignal
return the parent of all errors related to connection setup

o  loginFailedSignal
return the signal raised if the login fails

o  netErrorSignal
return the parent of all net errors

o  timeoutErrorSignal
return the signal raised on response timeout

o  transmissionErrorSignal
return the parent signal related to all data transmission errors

o  unimplementedOperationErrorSignal
return the signal raised if some command is not implemented by
the partner (should not happen)

accessing
o  SSL

o  STARTTLS

o  STARTTLS_OPTIONAL

class initialization
o  initialize
Verbose := true.

Usage example(s):

     self initialize.
     Verbose := true.

debugging
o  verbose: aBoolean
self verbose:false.
self verbose:true.

instance creation
o  connectTo: host
open a connection to some host as anonymous user

o  new
return a new ftpClient instance

o  openOnHostNamed: host
open a connection to some host; do not login

queries
o  isAbstract
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.


Instance protocol:

accessing
o  password

o  password: something

o  tlsEncryption

o  tlsEncryption: aSymbol
Modified (format): / 14-02-2020 / 19:12:39 / Stefan Vogel

o  useSSL
connect via SSL

o  useSTARTTLS
connect via TLS

o  useSTARTTLSIfPossible
connect via TLS, if possible. If not use an unencrypted connection

o  userName: aString

connection setup
o  connectTo: host
connect to some user as anonymous user

o  connectTo: host port: portNrOrNil user: user password: pw
connect to some host as some user.
host may also be in the format: 'hostName:portNr'.

o  connectTo: host user: user
connect to some host as user

o  connectTo: host user: user password: pw
connect to some host as user

o  connectToHost: host
open a connection; do not login: - VW compatibility

o  connectionTimeout: millisOrTimeDurationOrNil
set timeout for establishing a connection. If the millis arg is nonNil,
stop trying to connect after that many milliseconds and raise an exception

o  useIPv4Only

o  useIPv6Only

defaults
o  defaultPassword

** This method must be redefined in concrete classes (subclassResponsibility) **

o  defaultPort

** This method must be redefined in concrete classes (subclassResponsibility) **

o  defaultUser

** This method must be redefined in concrete classes (subclassResponsibility) **

error handling
o  commandFailed

o  connectionFailed

o  errorStringFromResponse

o  loginFailed

o  responseTimeoutError

o  unimplementedOperationError

initialization
o  initialize
(comment from inherited method)
just to ignore initialize to objects which do not need it

private - commands & responses
o  clearReplyPending

o  getResponse
wait for and read a response.
Leaves result in lastResponse (ascii) and lastReplyCode (numeric).
MultiLine responses are collected in responseLines.
Finally, handleReplyCode (redefinable) is asked to xlate from response code to
exception (if any)

o  getResponseHandlingReplyCodesWith: handleReplyCodeBlock
wait for and read a response.
Leaves result in lastResponse (ascii) and lastReplyCode (numeric).
MultiLine responses are collected in responseLines.
Finally, handleReplyCode (redefinable) is asked to xlate from response code to
exception (if any)

o  handleReplyCode: replyCode
intermediate message; final reply code follows

o  sendCommand: aCommandString
send a command, wait for response.
Leaves result in lastResponse (ascii) and lastReplyCode (numeric)

Usage example(s):

     |ftp|

     ftp := FTPClient new.
     ftp connectTo:'porty' user:'anonymous'.
     ftp sendCommand:'SYST'.
     ftp close

Usage example(s):

     |ftp|

     ftp := FTPClient new.
     ftp connectTo:'porty' user:'anonymous'.
     ftp sendCommand:'HELP'.
     ftp close

o  sendCommandNoWait: aCommandString
send a command, do not wait for response.

o  sendLine: aLine
send a line with CRLF

private - connection setup
o  close
disconnect - if redefined (to send a BYE message), do not forget to
invoke me here as well

o  connection

o  doConnect
connect, using the previously defined userName, password and hostName

o  getInitialConnectResponse
invoked right after the socket connection has been setup;
subclass implementation should read all initial hello-bla

** This method must be redefined in concrete classes (subclassResponsibility) **

o  performLoginSequence
invoked after the socket connection has been setup and the initial
connect response blah has been read.
A subclass implementation should perform whatever login sequence has to be performed.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  sendGoodByeCommand
invoked before the socket connection is shutDown.
A subclass implementation may want to redefine this for a graceful goodBy
(typically sending a quit-command)

queries
o  isConnected



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 15:43:21 GMT