Interface IServerRegistrationService
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IServerRegistrationService
Methods
View SourceDeactiveServer(String)
Deactivates a server.
Declaration
void DeactiveServer(string serverIdentity)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | serverIdentity | The server unique identity. |
DeactiveStaleServers(TimeSpan)
Deactivates stale servers.
Declaration
void DeactiveStaleServers(TimeSpan staleTimeout)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | staleTimeout | The time after which a server is considered stale. |
GetActiveServers(Boolean)
Return all active servers.
Declaration
IEnumerable<IServerRegistration>? GetActiveServers(bool refresh = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | refresh | A value indicating whether to force-refresh the cache. |
Returns
| Type | Description |
|---|---|
| System.Nullable<IEnumerable<IServerRegistration>> | All active servers. |
Remarks
By default this method will rely on the repository's cache, which is updated each
time the current server is touched, and the period depends on the configuration. Use the
refresh parameter to force a cache refresh and reload active servers
from the database.
GetCurrentServerRole()
Gets the role of the current server.
Declaration
ServerRole GetCurrentServerRole()
Returns
| Type | Description |
|---|---|
| ServerRole | The role of the current server. |
GetServers(Boolean)
Return all servers (active and inactive).
Declaration
IEnumerable<IServerRegistration> GetServers(bool refresh = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | refresh | A value indicating whether to force-refresh the cache. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IServerRegistration> | All servers. |
Remarks
By default this method will rely on the repository's cache, which is updated each
time the current server is touched, and the period depends on the configuration. Use the
refresh parameter to force a cache refresh and reload all servers
from the database.
TouchServer(String, TimeSpan)
Touches a server to mark it as active; deactivate stale servers.
Declaration
void TouchServer(string serverAddress, TimeSpan staleTimeout)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | serverAddress | The server URL. |
| TimeSpan | staleTimeout | The time after which a server is considered stale. |