Skip to main content
insightsoftware Documentation insightsoftware Documentation
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

Session Class

The Session class represents various aspects of a session such as the user id, host, port, and identifier of the currently connected Longview system.

Use the Session class in conjunction with API.GetSession to retrieve information for the current session.

Session Properties

The following table lists the properties of the Session class

Name Type Description

Group

string

Group is the Longview Group for the user in the session.

Host

string

Host is the host name of the data server in the session.

HttpProtocol

string

HttpProtocol is the http protocol for the current system.

Identifier

string

Identifier is the Longview Identifier for the session.

IsLongviewSession

boolean

IsLongviewSession indicates whether the connection is a Longview connection to a Longview data source.

IsTidemarkSession

boolean

IsTidemarkSession indicates whether the connection is a Tidemark connection to a Tidemark data source.

IsValid

boolean

IsValid returns a boolean indicating that the session object has been initialized.

Port

long

Port is the port number of the data server.

In cases where HTTP proxy has been used, the Port will return an empty string.

RDBMS

string

RDBMS is the current RDBMS for the system.

SessionID

 

SessionID is the current session ID.

UserId

string

UserId is the Longview User ID for the user in the session.

WebBridge

string

WebBridge is the web bridge for the current system.

WebBridgePath

string

WebBridgePath is the web bridge path for the current system.

WebServer

string

WebServer is the web server for the current system.

Sample Usage:

Dim LVAPI As Longview.API

Set LVAPI = New Longview.API

Dim rc As Long: rc = LVAPI.ErrorCode.NoError

 

Dim session As New session

 

rc = LVAPI.GetSession(session)

           

If rc = LVAPI.ErrorCode.NoError Then

   

        MsgBox session.Host & " " & session.Identifier & " " & session.UserId

       

ElseIf rc = LVAPI.ErrorCode.NotConnected Then

   

        MsgBox "Not connected" & vbLf & "Return code " & rc, vbOKOnly + vbExclamation, "Not Connected"

       

Else

   

        MsgBox "Error encountered" & vbLf & "Return code " & rc, vbOKOnly + vbExclamation, "Error encountered"

   

End If

Published:

Session Class

The Session class represents various aspects of a session such as the user id, host, port, and identifier of the currently connected Longview system.

Use the Session class in conjunction with API.GetSession to retrieve information for the current session.

Session Properties

The following table lists the properties of the Session class

Name Type Description

Group

string

Group is the Longview Group for the user in the session.

Host

string

Host is the host name of the data server in the session.

HttpProtocol

string

HttpProtocol is the http protocol for the current system.

Identifier

string

Identifier is the Longview Identifier for the session.

IsLongviewSession

boolean

IsLongviewSession indicates whether the connection is a Longview connection to a Longview data source.

IsTidemarkSession

boolean

IsTidemarkSession indicates whether the connection is a Tidemark connection to a Tidemark data source.

IsValid

boolean

IsValid returns a boolean indicating that the session object has been initialized.

Port

long

Port is the port number of the data server.

In cases where HTTP proxy has been used, the Port will return an empty string.

RDBMS

string

RDBMS is the current RDBMS for the system.

SessionID

 

SessionID is the current session ID.

UserId

string

UserId is the Longview User ID for the user in the session.

WebBridge

string

WebBridge is the web bridge for the current system.

WebBridgePath

string

WebBridgePath is the web bridge path for the current system.

WebServer

string

WebServer is the web server for the current system.

Sample Usage:

Dim LVAPI As Longview.API

Set LVAPI = New Longview.API

Dim rc As Long: rc = LVAPI.ErrorCode.NoError

 

Dim session As New session

 

rc = LVAPI.GetSession(session)

           

If rc = LVAPI.ErrorCode.NoError Then

   

        MsgBox session.Host & " " & session.Identifier & " " & session.UserId

       

ElseIf rc = LVAPI.ErrorCode.NotConnected Then

   

        MsgBox "Not connected" & vbLf & "Return code " & rc, vbOKOnly + vbExclamation, "Not Connected"

       

Else

   

        MsgBox "Error encountered" & vbLf & "Return code " & rc, vbOKOnly + vbExclamation, "Error encountered"

   

End If

For an optimal Community experience, Please view on Desktop