Home > Class Reference > ENSLIB namespace > EnsLib.FTP.CommonSSH

EnsLib.FTP.CommonSSH

abstract class EnsLib.FTP.CommonSSH extends %Library.RegisteredObject

Adapter that receives files via the FTP protocol.

Property Inventory

Method Inventory

Parameters

parameter SETTINGS = FTPServer:Basic,FTPPort:Basic,Credentials:Basic:credentialsSelector,FilePath:Basic,Charset::selector?context={Ens.ContextSearch/CharacterSets},StayConnected:Connection,ConnectTimeout:Connection,SFTPAuthenticationMethods:SFTP,SFTPPublicKeyFile:SFTP,SFTPPrivateKeyFile:SFTP,SFTPPassphraseCredentials:SFTP:credentialsSelector,SFTPInteractiveDTL:SFTP,SFTPFileAccessMode:SFTP,SFTPSetFileAccessModeByClient:SFTP,SFTPRemoteCharset:SFTP:selector?context={Ens.ContextSearch/CharacterSets?internalTables=1},SFTPLocalCharset:SFTP:selector?context={Ens.ContextSearch/CharacterSets?internalTables=1};

Properties

property %SFTPPassphraseCredentialsObj as Ens.Config.Credentials;
This is the credentials object containing the values to be used for the SFTPPassphraseCredentials
Property methods: %SFTPPassphraseCredentialsObjGet(), %SFTPPassphraseCredentialsObjGetObject(), %SFTPPassphraseCredentialsObjGetObjectId(), %SFTPPassphraseCredentialsObjGetSwizzled(), %SFTPPassphraseCredentialsObjIsValid(), %SFTPPassphraseCredentialsObjNewObject(), %SFTPPassphraseCredentialsObjSet(), %SFTPPassphraseCredentialsObjSetObject(), %SFTPPassphraseCredentialsObjSetObjectId(), %SFTPPassphraseCredentialsObjUnSwizzle()
property ConnectTimeout as %Numeric (MINVAL = 0) [ InitialExpression = 5 ];
Number of seconds to wait on each connection attempt
Property methods: ConnectTimeoutDisplayToLogical(), ConnectTimeoutGet(), ConnectTimeoutIsValid(), ConnectTimeoutLogicalToDisplay(), ConnectTimeoutNormalize(), ConnectTimeoutSet()
property FTPPort as %Integer;
TCP Port on the FTP Server to connect to. For FTP the standard port is 21 and for SFTP it is 22. Leave this field blank to use the appropriate standard value.
Property methods: FTPPortDisplayToLogical(), FTPPortGet(), FTPPortIsValid(), FTPPortLogicalToDisplay(), FTPPortNormalize(), FTPPortSet()
property FTPServer as %String (MAXLEN = 1000);
FTP Server to connect to
Property methods: FTPServerDisplayToLogical(), FTPServerGet(), FTPServerIsValid(), FTPServerLogicalToDisplay(), FTPServerLogicalToOdbc(), FTPServerNormalize(), FTPServerSet()
property SFTPAuthenticationMethods as %String (MAXLEN = 10);
AuthenticationMethods supported:
Empty - use public/private key if defined, otherwise use username and password from Credentials
p - use username and password from Credentials
k - use public/private key
i - use Interactive (Challenge/Response)
For multiple combine in the order required, for example
kp
This will lead to public/private key authentication first followed by username and password
Property methods: SFTPAuthenticationMethodsDisplayToLogical(), SFTPAuthenticationMethodsGet(), SFTPAuthenticationMethodsIsValid(), SFTPAuthenticationMethodsLogicalToDisplay(), SFTPAuthenticationMethodsLogicalToOdbc(), SFTPAuthenticationMethodsNormalize(), SFTPAuthenticationMethodsSet()
property SFTPFileAccessMode as %String [ InitialExpression = "0600" ];
SFTP File Access Mode specifies the access permissions to assign to the file on the remote system when transferred.
It can be specified as either octal e.g. 0600 or symbolic such as u+rw,g+r
The default is 0600. If specifying octal 4 digits are required.
For symbolic and specifying all use 'ugo' and not 'a' e.g ugo+rw.
Property methods: SFTPFileAccessModeDisplayToLogical(), SFTPFileAccessModeGet(), SFTPFileAccessModeIsValid(), SFTPFileAccessModeLogicalToDisplay(), SFTPFileAccessModeLogicalToOdbc(), SFTPFileAccessModeNormalize(), SFTPFileAccessModeSet()
property SFTPInteractiveDTL as %String (MAXLEN = 256);
If specified this is the DTL to used to handle the Interactive Authentication - also known as the keyboard-interactive or Challenge/Response authentication. This can be a DTL to create an array of answers for the challenge response authentication See Ens.SSH.InteractiveAuth.DTL Leave blank to return just Credentials password
Property methods: SFTPInteractiveDTLDisplayToLogical(), SFTPInteractiveDTLGet(), SFTPInteractiveDTLIsValid(), SFTPInteractiveDTLLogicalToDisplay(), SFTPInteractiveDTLLogicalToOdbc(), SFTPInteractiveDTLNormalize(), SFTPInteractiveDTLSet()
property SFTPLocalCharset as %String [ InitialExpression = $CASE($system.Version.GetOS(),"Windows":"",:"UTF8") ];
Character set used by the local system for filename encoding.
For Windows the default is the empty setting which will leave local filenames as Unicode.
For Unix the default is to convert to UTF8.
This setting is used to set the LocalCharset in the %Net.SSH.Session object.
Property methods: SFTPLocalCharsetDisplayToLogical(), SFTPLocalCharsetGet(), SFTPLocalCharsetIsValid(), SFTPLocalCharsetLogicalToDisplay(), SFTPLocalCharsetLogicalToOdbc(), SFTPLocalCharsetNormalize(), SFTPLocalCharsetSet()
property SFTPPassphraseCredentials as %String;
This can be used to specify different credentials entry from which the password will be used as the Key authentication Passphrase. If this is blank the Credentials setting will be used.
This separate setting allows having both Public Key and Password authentication
Property methods: SFTPPassphraseCredentialsDisplayToLogical(), SFTPPassphraseCredentialsGet(), SFTPPassphraseCredentialsIsValid(), SFTPPassphraseCredentialsLogicalToDisplay(), SFTPPassphraseCredentialsLogicalToOdbc(), SFTPPassphraseCredentialsNormalize(), SFTPPassphraseCredentialsSet()
property SFTPPrivateKeyFile as %String (MAXLEN = 1000);
File path to a file containing the SSH private key certificate.
The password from the Credentials setting will be used as the passphrase for the private key unless SFTPPassphraseCredentials is specified, in which case the password from that will be used as the passphrase for the private key.
Property methods: SFTPPrivateKeyFileDisplayToLogical(), SFTPPrivateKeyFileGet(), SFTPPrivateKeyFileIsValid(), SFTPPrivateKeyFileLogicalToDisplay(), SFTPPrivateKeyFileLogicalToOdbc(), SFTPPrivateKeyFileNormalize(), SFTPPrivateKeyFileSet()
property SFTPPublicKeyFile as %String (MAXLEN = 1000);
File path to a file containing the SSH public key certificate
Property methods: SFTPPublicKeyFileDisplayToLogical(), SFTPPublicKeyFileGet(), SFTPPublicKeyFileIsValid(), SFTPPublicKeyFileLogicalToDisplay(), SFTPPublicKeyFileLogicalToOdbc(), SFTPPublicKeyFileNormalize(), SFTPPublicKeyFileSet()
property SFTPRemoteCharset as %String [ InitialExpression = "UTF8" ];
Character set for filenames used by the remote server.
Defaults to UTF8.
Set to empty string for no character set translation for filenames.
This setting is used to set the RemoteCharset property in the %Net.SSH.Session object.
Property methods: SFTPRemoteCharsetDisplayToLogical(), SFTPRemoteCharsetGet(), SFTPRemoteCharsetIsValid(), SFTPRemoteCharsetLogicalToDisplay(), SFTPRemoteCharsetLogicalToOdbc(), SFTPRemoteCharsetNormalize(), SFTPRemoteCharsetSet()
property SFTPSetFileAccessModeByClient as %Boolean [ InitialExpression = 1 ];
When Putting a file with requested SFTP File Access Mode the SFTP server may apply a umask. A separate SetPermissions call that might not be modified by a umask can be made to apply the requested permissions.
The default is to use an extra SetPermissions call.
If the SFTP File Access Mode is 0600 a SetPermissions call will not be made irrespective of this setting.
Note - this call may not succeed if the target file has already been collected on the server. A Warning will be issued if the SetPermissions call errors.
Property methods: SFTPSetFileAccessModeByClientDisplayToLogical(), SFTPSetFileAccessModeByClientGet(), SFTPSetFileAccessModeByClientIsValid(), SFTPSetFileAccessModeByClientLogicalToDisplay(), SFTPSetFileAccessModeByClientNormalize(), SFTPSetFileAccessModeByClientSet()
property StayConnected as %Numeric (MINVAL = -1) [ InitialExpression = -1 ];
If non-zero, stay connected to the remote system between handling Requests until idle for this number of seconds. A value of -1 means never disconnect.
Property methods: StayConnectedDisplayToLogical(), StayConnectedGet(), StayConnectedIsValid(), StayConnectedLogicalToDisplay(), StayConnectedNormalize(), StayConnectedSet()
property TranslateTable as %String;
The translate table to be used when reading or writing files.
Property methods: TranslateTableDisplayToLogical(), TranslateTableGet(), TranslateTableIsValid(), TranslateTableLogicalToDisplay(), TranslateTableLogicalToOdbc(), TranslateTableNormalize(), TranslateTableSet()

Methods

method AuthenticateSSH() as %Status [ Language = objectscript ]
method ConnectSSH(pTimeout As %Numeric = 15, pInbound As %Boolean = 0, pSFTPPort As %Integer) as %Status [ Language = objectscript ]
classmethod FileListSSHClose(QHandle As %Binary) as %Status [ Language = objectscript ]
classmethod FileListSSHExecute(ByRef QHandle As %Binary, adapter As Ens.Adapter, directory As %String, wildcards As %String, dirsOrNoDirs As %Boolean = 0, semaphoreSpec As %String = "") as %Status [ Language = objectscript ]
classmethod FileListSSHFetch(ByRef QHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status [ Language = objectscript ]
method SFTPPassphraseCredentialsSet(pInVal As %String) as %Status [ Language = objectscript ]
method System(ByRef System As %String) as %Boolean [ Language = objectscript ]
method TestConnectionSSH(pInbound) [ Language = objectscript ]

Queries

query FileListSSH(adapter As Ens.Adapter, directory As %String(MAXLEN=""), wildcards As %String, dirsOrNoDirs As %Boolean = 0, semaphoreSpec As %String = "")
Selects Name As %String, Type As %String, Size As %BigInt, DateCreated As %TimeStamp, DateModified As %TimeStamp, ItemName As %String, ItemDir As %String, SemaphoreName As %String
This query is a shadow of the FileSet query in %Library.File, using an interface to the Adapter and skipping directories The dirsOrNoDirs argument if 0 (the default) will exclude directory entries, or if 1 will return directory entries only.

Inherited Members

Inherited Methods

Subclasses