DatabaseLabel class | QSYS API Reference Guide
Estimated reading time: 5 minutes
The DatabaseLabel class provides static methods for managing and interacting with database labels in a DataGate environment.
Namespace: ASNA.DataGate.Client.DatabaseLabel Assembly: ASNA.QSys.DataGate.Client.dll
Inheritance: Object
Remarks
This class includes methods for creating, changing, and removing databases, as well as retrieving and manipulating labels. Labels are used to identify and manage databases in the DataGate environment. They can be retrieved either individually, by name, or as a collection. The class also provides methods for labeling and unlabeling databases, and for creating new label objects.
Methods
| Signature | Description |
|---|---|
| ChangeDatabase(SourceProfile, ILabel) | Modifies database label |
| CreateDatabase(SourceProfile, Boolean, ILabel) | Creates a database |
| CreateDatabase(SourceProfile, Boolean, ILabel, Int32) | Creates a database |
| CreateLabelObject() | Creates an ILabel object with default values |
| GetLabel(SourceProfile, String) | Retrieves a specific label from a given server. |
| GetLabels(SourceProfile) | Creates a list of all labels in a given server |
| LabelDatabase(SourceProfile, ILabel, Boolean&) | Create a label for an existing database |
| RemoveDatabase(SourceProfile) | Completely erases a database and its label. |
| UnlabelDatabase(SourceProfile) | Remove a label on a database |
void ChangeDatabase(SourceProfile serverAndCredentials, ILabel label)
Modifies database label
void ChangeDatabase(SourceProfile serverAndCredentials, ILabel label)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| SourceProfile | serverAndCredentials | Object identifying the server, user and password, or kerberos SPN. |
| ILabel | label | Label details |
void CreateDatabase(SourceProfile serverAndCredentials, bool bIsSecured, ILabel label)
Creates a database
void CreateDatabase(SourceProfile serverAndCredentials, bool bIsSecured, ILabel label)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| SourceProfile | serverAndCredentials | Object identifying the server and client credentials. |
| Boolean | bIsSecured | Whether the database is secure |
| ILabel | label | Label details for the database |
void CreateDatabase(SourceProfile serverAndCredentials, bool bIsSecured, ILabel pLabel, int tcpPort)
Creates a database
void CreateDatabase(SourceProfile serverAndCredentials, bool bIsSecured, ILabel pLabel, int tcpPort)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| SourceProfile | serverAndCredentials | Object identifying the server and client credentials. |
| Boolean | bIsSecured | Whether the database is secure |
| ILabel | pLabel | Label details for the database |
| Int32 | tcpPort | The TCP port number the server listens to. |
ILabel CreateLabelObject()
Creates an ILabel object with default values
ILabel CreateLabelObject()
ILabel GetLabel(SourceProfile sp, string lblName)
Retrieves a specific label from a given server.
Remarks
This method uses the method to retrieve all labels from the server specified in the source profile.It then uses LINQ to filter the labels based on the provided name, using a case-insensitive comparison.If a label with the provided name is found, it is returned; otherwise, the method returns null.
ILabel GetLabel(SourceProfile sp, string lblName)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| SourceProfile | sp | The source profile containing server and user credentials. |
| String | lblName | The name of the label to retrieve. |
Returns
| Type | Description |
|---|---|
| ILabel | The label matching the provided name, or null if no match is found. |
ILabel[] GetLabels(SourceProfile sp)
Creates a list of all labels in a given server
ILabel[] GetLabels(SourceProfile sp)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| SourceProfile | sp | Connection parameters defining the machine to to search, server TCP port, user credentials, and Krb5 SPN. |
Returns
| Type | Description |
|---|---|
| ILabel[] | Array of labels |
void LabelDatabase(SourceProfile serverAndCredentials, ILabel label, Boolean& bExists)
Create a label for an existing database
void LabelDatabase(SourceProfile serverAndCredentials, ILabel label, Boolean& bExists)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| SourceProfile | serverAndCredentials | Server name and credentials for DG access. |
| ILabel | label | Label details |
| Boolean& | bExists | Modified to reflect whether the database exists |
void RemoveDatabase(SourceProfile sourceProfile)
Completely erases a database and its label.
void RemoveDatabase(SourceProfile sourceProfile)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| SourceProfile | sourceProfile | Provides server host name, port, database label to delete, and user credentials. |
void UnlabelDatabase(SourceProfile source)
Remove a label on a database
void UnlabelDatabase(SourceProfile source)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| SourceProfile | source | Provides Label name, server, port, and access credentials. |