Class ServerRegistrationService
Manages server registrations in the database.
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public sealed class ServerRegistrationService : ScopeRepositoryService, IService, IServerRegistrationService
Constructors
ServerRegistrationService(IScopeUnitOfWorkProvider, RepositoryFactory, ILogger, IEventMessagesFactory)
Initializes a new instance of the ServerRegistrationService class.
Declaration
public ServerRegistrationService(IScopeUnitOfWorkProvider uowProvider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory)
Parameters
Type | Name | Description |
---|---|---|
IScopeUnitOfWorkProvider | uowProvider | A UnitOfWork provider. |
RepositoryFactory | repositoryFactory | A repository factory. |
ILogger | logger | A logger. |
IEventMessagesFactory | eventMessagesFactory |
Properties
CurrentServerIdentity
Gets the local server identity.
Declaration
public string CurrentServerIdentity { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
DeactiveServer(String)
Deactivates a server.
Declaration
public void DeactiveServer(string serverIdentity)
Parameters
Type | Name | Description |
---|---|---|
System.String | serverIdentity | The server unique identity. |
DeactiveStaleServers(TimeSpan)
Deactivates stale servers.
Declaration
public void DeactiveStaleServers(TimeSpan staleTimeout)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | staleTimeout | The time after which a server is considered stale. |
GetActiveServers()
Return all active servers.
Declaration
public IEnumerable<IServerRegistration> GetActiveServers()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IServerRegistration> |
GetCurrentServerRole()
Gets the role of the current server.
Declaration
public ServerRole GetCurrentServerRole()
Returns
Type | Description |
---|---|
ServerRole | The role of the current server. |
TouchServer(String, String, TimeSpan)
Touches a server to mark it as active; deactivate stale servers.
Declaration
public void TouchServer(string serverAddress, string serverIdentity, TimeSpan staleTimeout)
Parameters
Type | Name | Description |
---|---|---|
System.String | serverAddress | The server url. |
System.String | serverIdentity | The server unique identity. |
System.TimeSpan | staleTimeout | The time after which a server is considered stale. |