Class ManagementServiceProxy
Represents a proxy that wraps the calls to the management service.
Inheritance
Implements
Inherited Members
Namespace: TimeCockpit.Data.RoutingService
Assembly: TimeCockpit.Data.dll
Syntax
public class ManagementServiceProxy : IManagementService, IUnsecuredManagementService, IRoutingService
Properties
ChangeCredentialsFunction
Gets or sets a function called when the password needs to be changed for a user.
Declaration
public Func<IRoutingService, Credentials> ChangeCredentialsFunction { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Func<TimeCockpit.Data.RoutingService.IRoutingService, TimeCockpit.Data.RoutingService.Credentials> |
EndpointAddress
Gets the name of the endpoit address to use, null if config-file defined.
Declaration
public string EndpointAddress { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Password
Gets the username that is used to access the management service.
Declaration
public string Password { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
UserName
Gets the username that is used to access the management service.
Declaration
public string UserName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
AlterUser(ConnectionInformation)
Alters an existing user entry.
Declaration
public void AlterUser(ConnectionInformation info)
Parameters
| Type | Name | Description |
|---|---|---|
| WebManagementService.ConnectionInformation | info | A instance of WebManagementService.ConnectionInformation |
ChangePassword(Guid, String)
Changes the password for a given user.
Declaration
public void ChangePassword(Guid passwordChangeToken, string newPassword)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | passwordChangeToken | The password change token. |
| System.String | newPassword | The new password. |
ChangePasswordAuthenticated(String, String, String)
Changes the password.
Declaration
public void ChangePasswordAuthenticated(string userName, string oldPassword, string newPassword)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userName | Name of the user. |
| System.String | oldPassword | The old password. |
| System.String | newPassword | The new password. |
Create(String, String, String)
Creates a management proxy using username, password and an endpoint name.
Declaration
public static ManagementServiceProxy Create(string endpointAddress, string userName = null, string password = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | endpointAddress | the address of the endpoint. |
| System.String | userName | the username to use. |
| System.String | password | the password for the user. |
Returns
| Type | Description |
|---|---|
| ManagementServiceProxy | returns an new management proxy with given credentials. |
CreateUserAndJoinTenant(String, String, String, String, Boolean, Boolean)
Creates a user in the userinfo table without registering for tenant creation. The user joins another tenant
Declaration
public void CreateUserAndJoinTenant(string userName, string firstName, string lastName, string tenant, bool admin, bool disabled)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userName | The username of the user. |
| System.String | firstName | The firstname of the user. |
| System.String | lastName | The lastname of the user. |
| System.String | tenant | The tenant name the user should join. |
| System.Boolean | admin | Indicates whether the user is admin or not |
| System.Boolean | disabled | Obsolete parameter, ignored. |
DeleteUser(String)
Deletes a user from its tenant and from the management context
Declaration
public void DeleteUser(string username)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | username | The username of the user to delete. |
GetConnectionInformation(String)
Gets a set of connection information of a certain user
Declaration
public ConnectionInformation GetConnectionInformation(string userName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userName | The user name to fetch the connection information for |
Returns
| Type | Description |
|---|---|
| WebManagementService.ConnectionInformation | An instance of WebManagementService.ConnectionInformation |
GetConnectionInformation(String, String)
Gets a set of connection information of a certain user
Declaration
public ConnectionInformation GetConnectionInformation(string userName, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userName | The user name to fetch the connection information for |
| System.String | password | The password of the user |
Returns
| Type | Description |
|---|---|
| WebManagementService.ConnectionInformation | An instance of WebManagementService.ConnectionInformation |
Remarks
This method should only be used the
GetConnectionInformation(String, String, Boolean)
Gets a set of connection information of a certain user
Declaration
public ConnectionInformation GetConnectionInformation(string userName, string password, bool callChangePasswordFunction)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userName | The user name to fetch the connection information for |
| System.String | password | The password of the user |
| System.Boolean | callChangePasswordFunction | Indicates, if the ChangePasswordFunction should be called. |
Returns
| Type | Description |
|---|---|
| WebManagementService.ConnectionInformation | An instance of WebManagementService.ConnectionInformation |
Remarks
This method should only be used the
GetConnectionInformationExtended(String)
Gets a set of connection information of a certain user
Declaration
public ConnectionInformation GetConnectionInformationExtended(string userName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userName | The user name to fetch the connection information for |
Returns
| Type | Description |
|---|---|
| WebManagementService.ConnectionInformation | An instance of WebManagementService.ConnectionInformation |
GetConnectionInformationExtendedAsync(String)
Declaration
public Task<ConnectionInformation> GetConnectionInformationExtendedAsync(string userName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userName |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<WebManagementService.ConnectionInformation> |
GetDownloadFilename(String)
Gets the filename referencing the provided software version.
Declaration
public string GetDownloadFilename(string version)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | version | Software version to get filename for. |
Returns
| Type | Description |
|---|---|
| System.String | The filename referencing the provided software version or null if the current user should not use this version. |
Remarks
The user should not use the version if it is not compatible with his tenant or the tenant is deprecated (pre-ownership).
GetStatus()
Checks if a service that provides WebManagementService.ConnectionInformation is ready to provide the latter.
Declaration
public RoutingServiceStatus GetStatus()
Returns
| Type | Description |
|---|---|
| TimeCockpit.Data.RoutingService.RoutingServiceStatus | an instance of TimeCockpit.Data.RoutingService.RoutingServiceStatus |
GetUsers(String)
Fetches all the users that share one tenant.
Declaration
public IList<ConnectionInformation> GetUsers(string tenantName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | tenantName | The name of the tenant to fetch the user for. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<WebManagementService.ConnectionInformation> | A list of WebManagementService.ConnectionInformation objects. |
GetVersionInformation()
Gets the version information for the current user/tenant.
Declaration
public VersionInformationOverview GetVersionInformation()
Returns
| Type | Description |
|---|---|
| WebManagementService.VersionInformationOverview | The version information for the current user/tenant or null if the user uses a deprecated (pre-ownership) tenant. |
RegisterForTenantCreation(String, String, String, String, String, Boolean)
Registers a user and adds an entry in the UserInfo table.
Declaration
public void RegisterForTenantCreation(string userName, string password, string firstName, string lastName, string company, bool admin)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userName | The username of the user. |
| System.String | password | The password of the user. |
| System.String | firstName | The firstname of the user. |
| System.String | lastName | The lastname of the user. |
| System.String | company | The company of the user. |
| System.Boolean | admin | Indicates whether the user is admin or not |
ResetPassword(String)
Resets the password for a given user.
Declaration
public void ResetPassword(string userName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userName | Name of the user to change the password for. |