Represents a registered server in a multiple-servers environment.
The ServerRegistration class represents a registered server in a multiple-servers environment.
Namespace:Umbraco.Cms.Core.Models
Assembly:Umbraco.Core.dll
All samples in this document will require references to the following dll:
Umbraco.Core.dll
All samples in this document will require the following using statement:
usingUmbraco.Cms.Core.Models;
Constructors
new ServerRegistration(string serverAddress, string serverIdentity, DateTime registered)
Constructor for creating a new ServerRegistration object. The necessary parameters are the serverAddress as a string, the serverIdentity as a string and the date and time of registration as a DateTime
A second constructor exists but it should not be used because it is used to reconstruct a ServerRegistration from the data source.
Properties
.Accessed
Gets the date and time the registration was last accessed.
// Given a `IServerRegistrationService` object get the first ServerRegistration and return Accessedvar serverRegistration =serverRegistrationService.GetActiveServers().FirstOrDefault();returnserverRegistration.Accessed;
.IsActive
Gets or sets a value indicating whether the server is active.
// Given a `IServerRegistrationService` object get the first ServerRegistration and return IsActivevar serverRegistration =serverRegistrationService.GetActiveServers().FirstOrDefault();returnserverRegistration.IsActive;
.IsSchedulingPublisher
Gets or sets a value indicating whether the server has the SchedulingPublisher role
// Given a `IServerRegistrationService` object get the first ServerRegistration and return IsSchedulingPublishervar serverRegistration =serverRegistrationService.GetActiveServers().FirstOrDefault();returnserverRegistration.IsSchedulingPublisher;
.Registered
Gets the date and time the registration was created.
// Given a `IServerRegistrationService` object get the first ServerRegistration and return Registeredvar serverRegistration =serverRegistrationService.GetActiveServers().FirstOrDefault();returnserverRegistration.Registered;
.ServerAddress
Gets or sets the server URL.
// Given a `IServerRegistrationService` object get the first ServerRegistration and return ServerAddressvar serverRegistration =serverRegistrationService.GetActiveServers().FirstOrDefault();returnserverRegistration.ServerAddress;
.ServerIdentity
Gets or sets the server unique identity.
// Given a `IServerRegistrationService` object get the first ServerRegistration and return ServerIdentityvar serverRegistration =serverRegistrationService.GetActiveServers().FirstOrDefault();returnserverRegistration.ServerIdentity;