1010data .NET SDK
TenTenSDK.Session Class Reference

A connection to the 1010data Insights Platform. More...

Inherits IDisposable.

Public Member Functions

 Session (Uri uri, String owner, String group, String password, LoginType type, String logPath=null, bool append=false, int retries=Int32.MaxValue, int waitsec=10)
 Constructs a session by logging into a SAM pool, which is a group pool of IDs. More...
 
 Session (String uri, String owner, String group, String password, LoginType type, String logPath=null, bool append=false, int retries=Int32.MaxValue, int waitsec=10)
 
 Session (Uri uri, String username, String password, LoginType type, String logPath=null, bool append=false)
 Constructs a session with a non-pool login. More...
 
 Session (String uri, String username, String password, LoginType type, String logPath=null, bool append=false)
 
void Dispose ()
 
void ClearCache ()
 Clears the session's cache.
 
void FlushPool ()
 Flush the pool this session is using.
 
Table RunQuery (Query query)
 Runs a query on this session. More...
 
Table OpenTable (String tablePath)
 Opens a table at the specific path. More...
 

Static Public Member Functions

static void Authenticate (Uri uri, String username, String password)
 Authenticates a user/uri with a password. More...
 
static void Authenticate (String uri, String username, String password)
 
static void FlushPool (Uri uri, String owner, String groupname, String password)
 Flushes the SAM pool. This ensures that usernames returned from this point on are fresh and not already logged in. More...
 
static void FlushPool (String uri, String owner, String groupname, String password)
 
static void ResetPool (Uri uri, String owner, String groupname, String password)
 
static void ResetPool (String uri, String owner, String groupname, String password)
 
static int WarmPool (Uri uri, String owner, String groupname, String password, Query[] queries=null)
 Warm a SAM pool. More...
 
static int WarmPool (String uri, String owner, String groupname, String password, Query[] queries=null)
 

Public Attributes

readonly long SessionIndex
 Unique index for this session (starts counting from 1).
 

Properties

static IDownloadPolicy SystemPolicy [get, set]
 Default Download for newly created policies. More...
 
IDownloadPolicy SessionPolicy [get, set]
 Session download policy.
 
TransferMode Mode [get, set]
 TransferMode of the session.
 
int ReturnCode [get]
 Return code for the last transaction performed on this session. More...
 
String Message [get]
 Message returned by the last transaction performed on ths session.
 
String Log [set]
 Sets where session transactions are logged.
 
String EncryptedPassword [get]
 The encrypted password; this can be used with TenUp.
 
String Passphrase [set]
 Passphrase for this session; null removes the passphrase.
 
String SessionID [get]
 Gets the SessionID for later use.
 
String UserID [get]
 Gets the current UserID.
 

Detailed Description

A connection to the 1010data Insights Platform.

Constructor & Destructor Documentation

TenTenSDK.Session.Session ( Uri  uri,
String  owner,
String  group,
String  password,
LoginType  type,
String  logPath = null,
bool  append = false,
int  retries = Int32.MaxValue,
int  waitsec = 10 
)

Constructs a session by logging into a SAM pool, which is a group pool of IDs.

Parameters
uriUri to login with
ownerThe username of the owner of the group
groupThe groupID
passwordThe group owner password
typeThe login type, which indicates what to do if logging into an active session
logPathThe initial path to log to (null means no logging)
appendIf logging should append or not
TenTenSDK.Session.Session ( Uri  uri,
String  username,
String  password,
LoginType  type,
String  logPath = null,
bool  append = false 
)

Constructs a session with a non-pool login.

Parameters
uriUri to login with
usernameUsername to log in with
passwordUser's password
typeThe login type, which indicates what to do if logging into an active session
logPathThe initial path to log to (null means no logging)
appendIf logging should append or not

Member Function Documentation

static void TenTenSDK.Session.Authenticate ( Uri  uri,
String  username,
String  password 
)
static

Authenticates a user/uri with a password.

Parameters
uriGateway to authenticate with
usernameUsername of user to authenticate
passwordUser's password
Exceptions
InvalidCredentialExceptionon failure (i.e. bad password).
static void TenTenSDK.Session.FlushPool ( Uri  uri,
String  owner,
String  groupname,
String  password 
)
static

Flushes the SAM pool. This ensures that usernames returned from this point on are fresh and not already logged in.

Parameters
uriThe URI for the 1010 connection.
ownerThe owner of the group.
groupnameThe group to be flushed.
passwordPassword for the owner ID.
Table TenTenSDK.Session.OpenTable ( String  tablePath)

Opens a table at the specific path.

Parameters
tablePathThe table to open
Returns
A table at the given path

References TenTenSDK.Query.QueryTable().

static void TenTenSDK.Session.ResetPool ( Uri  uri,
String  owner,
String  groupname,
String  password 
)
static

Reset a SAM pool. This will log out and release all userIDs in the pool. Only use this if you have exclusive access to this SAM pool it will release UIDs that could otherwise be in use. Mostly intended for the development cycle.

Parameters
uriThe URI for the 1010 connection.
ownerThe owner of the group.
groupnameThe group to be reset.
passwordPassword for the owner ID.
Table TenTenSDK.Session.RunQuery ( Query  query)

Runs a query on this session.

Parameters
queryThe query object
Returns
A table representing the query results

References TenTenSDK.Query.BasePath, TenTenSDK.Query.Ops, and TenTenSDK.Query.Results.

static int TenTenSDK.Session.WarmPool ( Uri  uri,
String  owner,
String  groupname,
String  password,
Query[]  queries = null 
)
static

Warm a SAM pool.

Parameters
uriThe URI for the 1010 connection
ownerthe owner of the group
groupnameThe group to be warmed
passwordPassword for the group
queriesAn optional array of Query objects, which will each be run in all the warmed sessions.
Returns
Number of users warmed.

Property Documentation

int TenTenSDK.Session.ReturnCode
get

Return code for the last transaction performed on this session.

Exceptions
TenTenSDKExceptionIF there's an issue getting the return code.
IDownloadPolicy TenTenSDK.Session.SystemPolicy
staticgetset

Default Download for newly created policies.

Note that mutating this with SetPolicies will not change the policies of already created sessions.