IServer

Description:

IServer is the central entry point of the library. It is the only creatable object in the hierarchy for accessing the server.

import "OxSvrSpt.idl"

Public Methods:

HRESULT Login ([in, defaultvalue("")] BSTR User, [in, defaultvalue("")] BSTR Password, [in, defaultvalue("")] BSTR Server, [in, defaultvalue("")] BSTR Port, [in, defaultvalue(pwNotEncrypted)] PasswortTypeEnum PasswortType, [in, defaultvalue()] VARIANT_BOOL DefaultSession, [out, retval] ISession ** ppSession)
HRESULT Connect ([in, defaultvalue("localhost")] BSTR Server, [in, defaultvalue("4000")] BSTR Port)
HRESULT OpenSession ([in, defaultvalue("")] BSTR SessionGUID, [in, defaultvalue("")] BSTR Alias, [out, retval] ISession ** ppSession)
HRESULT LoginBalanced ([in, defaultvalue("")] BSTR User, [in, defaultvalue("")] BSTR Password, [in, defaultvalue("")] BSTR ServerList, [in, defaultvalue(pwNotEncrypted)] PasswortTypeEnum PasswortType, [in, defaultvalue()] VARIANT_BOOL DefaultSession, [out, retval] ISession ** ppSession)
HRESULT LoginGUID ([in, defaultvalue("")] BSTR GUID, [in, defaultvalue("")] BSTR Server, [in, defaultvalue("")] BSTR Port, [in, defaultvalue()] VARIANT_BOOL DefaultSession, [out, retval] ISession ** ppSession)

Properties:

IProperties Properties [get]
IErrors Errors [get]

Documentation of Element Functions:

  • HRESULT Connect ([in, defaultvalue("localhost")] BSTR Server, [in, defaultvalue("4000")] BSTR Port)

Connect establishes a connection to the specified server.

This method currently returns the error E_NOTIMPL!

Establishing a connection to a server without logging in is necessary when the server properties are needed. These are made available in the Properties after a Connect. If these data are not needed, it is not necessary to establish a Connect to the server before logging in. The server data can be specified directly during login in this case.

Parameters:

[in]: Server (default value is localhost) IP address or name of the server to connect to

[in]: Port (default value is 4000) port of the server

  • HRESULT Login ([in, defaultvalue("")] BSTR User, [in, defaultvalue("")] BSTR Password, [in, defaultvalue("")] BSTR Server, [in, defaultvalue("")] BSTR Port, [in, defaultvalue(pwNotEncrypted)] PasswortTypeEnum PasswortType, [in, defaultvalue()] VARIANT_BOOL DefaultSession, [out, retval] ISession ** ppSession)

Login performs a login to the server and returns the corresponding session.

If a connection to a server has already been established via the Connect method before calling Login, these connection data are used for the Login if none are specified.

If both the User and Password parameters are empty or passed with an empty string, an attempt is made to perform the login via automatic Login. This must be activated in the enaio® administrator and is not equivalent to NTLMAuthentication.

Parameters:

[in]: User user account

[in]: Password password of the user account to be used

[in]: Server IP address or name of the server to connect to

[in]: Port port of the server

[in]: PasswortType indicates whether the passed password is already encrypted. If this parameter is not specified, it is assumed that the password was passed unencrypted.

[in]: DefaultSession (default value is VARIANT_FALSE) indicates whether this is the session to which the user can later attach using OpenSession.

[out]: ppSession (VB return parameter) created session for the account.

Exception handling:

errLoginUnknownUser (602) The specified user does not exist.

errLogin3TimesWrong (603) The third login attempt failed.

errLoginInvalidPassword (604) The specified password is incorrect.

errLoginLocked (605) The user account is locked.

  • HRESULT LoginBalanced ([in, defaultvalue("")] BSTR User, [in, defaultvalue("")] BSTR Password, [in, defaultvalue("")] BSTR ServerList, [in, defaultvalue(pwNotEncrypted)] PasswortTypeEnum PasswortType, [in, defaultvalue()] VARIANT_BOOL DefaultSession, [out, retval] ISession ** ppSession)

LoginBalanced performs a login to the server and returns the corresponding session.

If both the User and Password parameters are empty or passed with an empty string, an attempt is made to perform the login via automatic Login.

Parameters:

[in]: User user account

[in]: Password password of the user account to be used

[in]: ServerList list of servers to which the library should connect. This list has the following format: Server1#Port1#Weight1;Server2#Port2#Weight2#;Server3#Port3#Weight3

[in]: PasswortType indicates whether the passed password is already encrypted. If this parameter is not specified, it is assumed that the password was passed unencrypted.

[in]: DefaultSession (default value is VARIANT_FALSE) indicates whether this is the session to which the user can later attach using OpenSession.

[out]: ppSession (VB return parameter) created session for the account.

Exception handling:

errLoginUnknownUser (602) The specified user does not exist.

errLogin3TimesWrong (603) The third login attempt failed.

errLoginInvalidPassword (604) The specified password is incorrect.

errLoginLocked (605) The user account is locked.

  • HRESULT LoginGUID ([in, defaultvalue("")] BSTR GUID, [in, defaultvalue("")] BSTR Server, [in, defaultvalue("")] BSTR Port, [in, defaultvalue()] VARIANT_BOOL DefaultSession, [out, retval] ISession ** ppSession)

LoginGUID performs a login with the passed SessionGUID to the server and returns the corresponding session.

Using the SessionGUID, a connection is established with an existing session on the server.

Parameters:

[in]: GUID GUID of the server session with which the Session object should work

[in]: Server IP address or name of the server to connect to

[in]: Port port of the server

[in]: DefaultSession (default value is VARIANT_FALSE) indicates whether this is the session to which the user can later attach using OpenSession

[out]: ppSession (VB return parameter) created session for the account

Exception handling:

errLoginLocked (605) The user account is locked.

  • HRESULT OpenSession ([in, defaultvalue("")] BSTR SessionGUID, [in, defaultvalue("")] BSTR Alias, [out, retval] ISession ** ppSession)

OpenSession creates a new Session object and connects it to the DefaultSession.

Parameters:

[in]: SessionGUID GUID of the existing session with which the connection should be established

[in]: Alias arbitrary name for the call to assign errors or state

[out]: ppSession (VB return parameter) created session for the account

Documentation of Properties:

  • IErrors Errors [get]

Errors returns the error collection with the errors of the server access.

Parameters:

[out]: pVal (VB return value) error collection

  • IProperties Properties [get]

Properties returns the collection with the server properties.

Currently, the following properties are set by the OxSvrSpt library when creating the server object:

TempDir:

Contains the temporary directory where the files of the file parameters should be stored. This is initialized with the user’s temporary directory.

NotifyNeeded:

Initialized with 0.

If the value is set to a value unequal to 0 (or VARIANT_FALSE), support for notifications is activated. Then it is possible to process notifications via the event interface of the server and session objects.

The specified identifiers correspond to the parameter names.

Parameters:

[out]: pVal (VB return parameter) IProperties interface