Class DatabaseServer
Represents a database server known in the system, which can serve as the host for one or more translation memory containers (TranslationMemoryContainer). A translation memory container is a database that contains one or more server-based translation memories.
Inheritance
Implements
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class DatabaseServer : IEquatable<DatabaseServer>, IPermissionCheck
Constructors
DatabaseServer(TranslationProviderServer)
Creates a new database server. Note that you have to call Save() to persist the database server object, after setting all the required properties.
Declaration
public DatabaseServer(TranslationProviderServer server)
Parameters
Type | Name | Description |
---|---|---|
TranslationProviderServer | server | The translation provider server with which the database server should be registered. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
Properties
AuthenticationType
Gets or sets the type of authentication that is used when the application server communicates with this database server.
Declaration
public DatabaseServerAuthenticationType AuthenticationType { get; set; }
Property Value
Type | Description |
---|---|
DatabaseServerAuthenticationType |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to set AuthenticationType of an entity that no longer exists. |
Containers
Gets all the translation memory containers that are hosted on this database server.
Declaration
public ReadOnlyCollection<TranslationMemoryContainer> Containers { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<TranslationMemoryContainer> |
Remarks
If the list of containers has been pre-loaded, the in-memory collection of containers is returned, otherwise the list of containers is retrieved from the server on-demand.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |
Description
Gets or sets the description of the database server.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Note that you have to call Save() to persists the change after setting this property.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to get/set description of an entity that no longer exists. |
Id
Gets the unique Id for this database server.
Declaration
public Guid Id { get; }
Property Value
Type | Description |
---|---|
System.Guid |
Remarks
This is auto-generated by the system when the database server is created.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to get the unique ID of an entity that no longer exists. |
IsDeleted
Returns
true
if this translation memory has been deleted.
Declaration
public bool IsDeleted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsDirty
Returns
true
if this database server has unsaved changes.
Declaration
public bool IsDirty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsNewObject
Gets a value indicating whether this instance is new object.
Declaration
public bool IsNewObject { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
LinkedResourceGroupPaths
Gets or sets the collection of paths for the linked resource groups.
Declaration
public string[] LinkedResourceGroupPaths { get; set; }
Property Value
Type | Description |
---|---|
System.String[] |
Name
Gets or sets the friendly name of the database server.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Note that you have to call Save() to persists the change after setting this property.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to get or set name of an entity that no longer exists. |
ParentResourceGroupDescription
Gets the parent resource group description.
Declaration
public string ParentResourceGroupDescription { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ParentResourceGroupName
Gets or sets the parent resource group name.
Declaration
public string ParentResourceGroupName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ParentResourceGroupPath
Gets the parent resource group path.
Declaration
public string ParentResourceGroupPath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Password
Gets or sets the password for the user name specified in UserName that is used for authentication when the application server communicates with this database server.
Declaration
public string Password { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
The password is only used when AuthenticationType is set to Database.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to set Password of an entity that no longer exists. |
ServerName
Gets or sets the DNS name or IP address of this database server.
Declaration
public string ServerName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This property can not be changed after the database server has been created.
Exceptions
Type | Condition |
---|---|
NullPropertyException | Thrown when trying to set this property to null or an empty string. |
System.InvalidOperationException | Thrown when trying to set this property after initial creation of the database server. |
ObjectDeletedException | Thrown when trying to get/set ServerName of an entity that no longer exists. |
ServerType
Gets or sets the database server type.
Declaration
public DatabaseServerType ServerType { get; set; }
Property Value
Type | Description |
---|---|
DatabaseServerType |
Remarks
This property can not be changed after the database server has been created.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to set ServerType of an entity that no longer exists. |
System.InvalidOperationException | Thrown when trying to set this property after initial creation of the database server. |
TranslationProviderServer
Gets the translation provider server on which this database server is registered.
Declaration
public TranslationProviderServer TranslationProviderServer { get; }
Property Value
Type | Description |
---|---|
TranslationProviderServer |
UserName
Gets or sets the user name used for authentication together with the password specified in Password when the application server communicates with this database server.
Declaration
public string UserName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
The user name is only used when AuthenticationType is set to Database.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to set UserName of an entity that no longer exists. |
Methods
Delete()
Deletes this database server and all its containers from the system.
Declaration
public void Delete()
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |
ObjectNotSavedException | Thrown when this object has not been initially saved yet. |
Equals(DatabaseServer)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(DatabaseServer other)
Parameters
Type | Name | Description |
---|---|---|
DatabaseServer | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current object is equal to the |
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | The |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
HasPermission(String)
Gets whether this object has the permission with the specified name.
Declaration
public bool HasPermission(string permission)
Parameters
Type | Name | Description |
---|---|---|
System.String | permission | The permission name. |
Returns
Type | Description |
---|---|
System.Boolean | is the object has the specified permission.
|
Save()
Saves this database server.
Declaration
public void Save()
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |
Events
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |