Class ServerState

Holds information about the state of a server

Inheritance
System.Object
ServerState
Implements
System.IEquatable<ServerState>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Events.Clients
Assembly: EPiServer.Events.dll
Version: 8.11.0
Syntax
public class ServerState : IEquatable<ServerState>

Constructors

ServerState(String, String)

Initializes a new instance of the ServerState class with the current time set as the first and last contact.

Declaration
public ServerState(string serverName, string applicationName)
Parameters
Type Name Description
System.String serverName

Name of the server.

System.String applicationName

Name of the application.

ServerState(String, String, DateTime, DateTime, Boolean)

Initializes a new instance of the ServerState class.

Declaration
public ServerState(string serverName, string applicationName, DateTime firstContact, DateTime lastContact, bool active)
Parameters
Type Name Description
System.String serverName

Name of the server.

System.String applicationName

Name of the application.

System.DateTime firstContact

The time of the first contact.

System.DateTime lastContact

The time of the last contact.

System.Boolean active

A value indicating if the server is currently active.

Fields

ServerAndApplicationNameComparer

Gets an equality comparer instance that only compare the server name of ServerState objects.

Declaration
public static readonly IEqualityComparer<ServerState> ServerAndApplicationNameComparer
Field Value
Type Description
System.Collections.Generic.IEqualityComparer<ServerState>

ServerNameComparer

Gets an equality comparer instance that only compare the server name of ServerState objects.

Declaration
public static readonly IEqualityComparer<ServerState> ServerNameComparer
Field Value
Type Description
System.Collections.Generic.IEqualityComparer<ServerState>

Properties

Active

Gets a value indicating whether this server is active.

Declaration
public bool Active { get; }
Property Value
Type Description
System.Boolean

ApplicationName

Gets the name of the IIS application that this state represents.

Declaration
public string ApplicationName { get; }
Property Value
Type Description
System.String

FirstContact

Gets the time of the first contact between this server and the current one.

Declaration
public DateTime FirstContact { get; }
Property Value
Type Description
System.DateTime

LastContact

Gets the time of the last contact between this server and the current one.

Declaration
public DateTime LastContact { get; }
Property Value
Type Description
System.DateTime

ServerName

Gets the name of the server that this state represents.

Declaration
public string ServerName { get; }
Property Value
Type Description
System.String

Methods

Equals(ServerState)

Indicates whether the current ServerState instance is equal to another ServerState instance.

Declaration
public bool Equals(ServerState other)
Parameters
Type Name Description
ServerState other

A ServerState instance to compare with this instance.

Returns
Type Description
System.Boolean

true if the current object is equal to the other parameter; otherwise, false.

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

true if the specified System.Object is equal to this instance; otherwise, false.

Overrides
System.Object.Equals(System.Object)

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
System.Object.GetHashCode()

Matches(String, String)

Checks if the current instance matches the specified server and application name.

Declaration
public bool Matches(string serverName, string applicationName)
Parameters
Type Name Description
System.String serverName

Name of the server to match against.

System.String applicationName

Name of the application to match against.

Returns
Type Description
System.Boolean

True if the current instance matches the provided names; otherwise false.

ToString()

Returns a System.String that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents this instance.

Overrides
System.Object.ToString()

Implements

System.IEquatable<T>