Class ConnectionDescriptor
- Namespace
- ArcanaDevelopment.adTempus.Shared
- Assembly
- ArcanaDevelopment.adTempus.Shared.dll
Stores information parsed from an adTempus connection string.
public sealed class ConnectionDescriptor
- Inheritance
-
objectConnectionDescriptor
Constructors
ConnectionDescriptor()
public ConnectionDescriptor()
ConnectionDescriptor(string, int?, string)
public ConnectionDescriptor(string server, int? port, string instance)
Parameters
| Name | Type | Description |
|---|---|---|
server |
string | |
port |
int? | |
instance |
string |
Properties
AdditionalProperties
public Dictionary<string, string> AdditionalProperties { get; }
Property Value
- Dictionary<string, string>
ComputerName
public string ComputerName { get; set; }
Property Value
- string
DnsIdentity
public string DnsIdentity { get; }
Property Value
- string
Identity
public ConnectionDescriptor.IdentityInfo Identity { get; set; }
Property Value
InstanceName
public string InstanceName { get; set; }
Property Value
- string
PortNumber
public int PortNumber { get; set; }
Property Value
- int
SPN
The SPN to use when connecting to the server.
public string SPN { get; set; }
Property Value
- string
SecurityType
public ConnectionSecurityType SecurityType { get; set; }
Property Value
UseDefaultInstance
public bool UseDefaultInstance { get; set; }
Property Value
- bool
UseDefaultPort
public bool UseDefaultPort { get; set; }
Property Value
- bool
Methods
BuildConnectionDescriptor(string, int?, string)
public static string BuildConnectionDescriptor(string computerName, int? portNumber, string instanceName)
Parameters
| Name | Type | Description |
|---|---|---|
computerName |
string | |
portNumber |
int? | |
instanceName |
string |
Returns
- string
BuildServiceURL(string, int, string, string, ConnectionSecurityType)
Creates the URL for an adTempus service
public static string BuildServiceURL(string computerName, int portNumber, string instanceName, string serviceName, ConnectionSecurityType securityMode)
Parameters
| Name | Type | Description |
|---|---|---|
computerName |
string | |
portNumber |
int | |
instanceName |
string | |
serviceName |
string | |
securityMode |
ConnectionSecurityType |
Returns
- string
GetAdditionalProperty(string, string)
Gets the value from AdditionalProperties with the specified key.
public string GetAdditionalProperty(string key, string defaultValue = null)
Parameters
| Name | Type | Description |
|---|---|---|
key |
string | |
defaultValue |
string | The value returned if the key is not found. |
Returns
- string
The value for the specified key, or defaultValue if the key is not found.
GetConnectionURL(string)
Gets the URL that is used to connect to the service.
public string GetConnectionURL(string serviceName)
Parameters
| Name | Type | Description |
|---|---|---|
serviceName |
string |
Returns
- string
GetEndpointAddress(string)
public EndpointAddress GetEndpointAddress(string url)
Parameters
| Name | Type | Description |
|---|---|---|
url |
string |
Returns
- EndpointAddress
Parse(string)
Parses a connection string.
public static ConnectionDescriptor Parse(string target)
Parameters
| Name | Type | Description |
|---|---|---|
target |
string |
Returns
- ConnectionDescriptor
A ConnectionDescriptor containing information parsed from the target, or null if the target cannot be parsed.
Remarks
This method parses a user-entered target address. Following are valid address forms:
- servername
- servername:port
- servername:port\instance
- servername\instance
- Deprecated formats still recognized by Parse:
- servername,port
- servername\instance,port
- servername,port\instance Any of these formats can also be followed by "," and additional configuration options
ReadAdditionalProperties(string)
Reads additional configuration properties set in the connection string.
public void ReadAdditionalProperties(string source)
Parameters
| Name | Type | Description |
|---|---|---|
source |
string |
Remarks
Following the base connectionstring, additional properties can be specified in the form: ,key 1=value 1,key2,key3=value 3
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.