LoginStringParser

Overview

The LoginStringParser class allows to parse semicolon-separated login strings. The main difference between LoginStringParser and SemicolonSeparatedString classes are several new properties added to the former class. These properties simplify access to commonly used login strings elements like user name or password.

The LoginStringParser class is intended to be used in Data Abstract-based servers to parse LoginEx strings passed to the Login service. For example, Relativity uses LoginStringParser instance to parse LoginEx strings used to log on to the Relativity server.

Here is the sample C# code that shows how to access the LoginEx string elements using the LoginStringParser class:

LoginStringParser lLoginString = new LoginStringParser(@"User Id=""DAUser"";Password=""pwd"";Domain=""SampleDomain"";Schema=""SampleSchema""");

Console.WriteLine("User:{0}, Password:{1}, Domain: {2}", lLoginString.Username, lLoginString.Password, lLoginString["Domain"]);

Note: If property description mentions more than 1 possible LoginString entry name returned by this name then this means than mentioned names are accessed from left to right. In other words if LoginEx string contains both Connection and ConnectionName entries then Connection prperty will get value of the Connection entry.

Location


Properties


Connection

Gets the name of requested database connection.

This property's accessor returns value of one of the following LoginEx string entries: Connection, ConnectionName, Connection Name or null if connection name was not specified in the provided login string.

 

property Connection: String read write;

 

String Connection { get; set; }

 

Property Connection() As String

Password

Gets the log on password.

This property's accessor returns value of one of the following LoginEx string entries: Password, Pwd or null if password was not specified in the provided login string.

 

property Password: String read write;

 

String Password { get; set; }

 

Property Password() As String

Username

Gets the user login name.

This property's accessor returns value of one of the following LoginEx string entries: User, UserId, User Id, UserName, User Name' or null if user login name was not specified in the provided login string.

 

property Username: String read write;

 

String Username { get; set; }

 

Property Username() As String

Instance Methods


constructor

Creates a new instance of the LoginStringParser class and parses provided LoginEx string.

 

constructor(loginString: String)

 

LoginStringParser(String loginString)

 

Sub New(loginString As String)

Parameters:

  • loginString: LoginEx string to parse

GetValues

Returns list of all key-value entries of the current LoginEx string.

 

method GetValues(excludeCredentials: Boolean): IDictionary<String, String>

 

IDictionary<String, String> GetValues(Boolean excludeCredentials)

 

Function GetValues(excludeCredentials As Boolean) As IDictionary<String, String>

Parameters:

  • excludeCredentials: flag indicating whether user credentials should be excluded from the method call result