Establishing a session

A 1010data Insights Platform session is an instance of a particular user ID logged into the platform within a certain environment. A session is comprised of a dedicated set of resources that can serve a single request at a time.

A single platform session may have multiple Session objects attached to it. When a user logs into the platform, if no session is active, a new one is created. If a session is currently active for that user, the login type determines if the current session is possessed by the user; a new session is started after the current one is killed; or the connection fails if an active session exists. Currently, each user ID can only have one platform session associated with it. For more information, see Login Types.

In this example, the Session object is created in the Main() method. The new Session object testSession takes four parameters:
  • a URI (gateway)
  • a valid Insights Platform user name (user)
  • that user's password (pwd)
  • the login type, which is LoginType.POSSESS in this example

If you are connecting via a proxy server, your gateway string contains your proxy server address and any credentials. For more information, see Connecting via proxy.

using System;
using TenTenSDK;

public class DocumentationExample {
    public static void PrintTable(Session testSession, String path) {
    }

    public static void Main() {
        Uri gateway = new Uri("https://www2.1010data.com/cgi-bin/gw.k");
        String user = "[USER_NAME]";
        String pwd = "[USER_PASSWORD]";
        String path = "[TABLE_PATH]";
        Session testSession = new Session(gateway, user, pwd,
                                          LoginType.POSSESS);
        PrintTable(testSession, path);
    }
}
Note: [USER_NAME], [USER_PASSWORD], and [TABLE_PATH] are placeholders for valid Insights Platform user name, password, and table path.