/// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static SecondaryReplicatorStatus GetFromJsonProperties(JsonReader reader)
        {
            var kind = default(ReplicaRole?);
            var replicationQueueStatus = default(ReplicatorQueueStatus);
            var lastReplicationOperationReceivedTimeUtc = default(DateTime?);
            var isInBuild       = default(bool?);
            var copyQueueStatus = default(ReplicatorQueueStatus);
            var lastCopyOperationReceivedTimeUtc = default(DateTime?);
            var lastAcknowledgementSentTimeUtc   = default(DateTime?);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("Kind", propName, StringComparison.Ordinal) == 0)
                {
                    kind = ReplicaRoleConverter.Deserialize(reader);
                }
                else if (string.Compare("ReplicationQueueStatus", propName, StringComparison.Ordinal) == 0)
                {
                    replicationQueueStatus = ReplicatorQueueStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("LastReplicationOperationReceivedTimeUtc", propName, StringComparison.Ordinal) == 0)
                {
                    lastReplicationOperationReceivedTimeUtc = reader.ReadValueAsDateTime();
                }
                else if (string.Compare("IsInBuild", propName, StringComparison.Ordinal) == 0)
                {
                    isInBuild = reader.ReadValueAsBool();
                }
                else if (string.Compare("CopyQueueStatus", propName, StringComparison.Ordinal) == 0)
                {
                    copyQueueStatus = ReplicatorQueueStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("LastCopyOperationReceivedTimeUtc", propName, StringComparison.Ordinal) == 0)
                {
                    lastCopyOperationReceivedTimeUtc = reader.ReadValueAsDateTime();
                }
                else if (string.Compare("LastAcknowledgementSentTimeUtc", propName, StringComparison.Ordinal) == 0)
                {
                    lastAcknowledgementSentTimeUtc = reader.ReadValueAsDateTime();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new SecondaryReplicatorStatus(
                       kind: kind,
                       replicationQueueStatus: replicationQueueStatus,
                       lastReplicationOperationReceivedTimeUtc: lastReplicationOperationReceivedTimeUtc,
                       isInBuild: isInBuild,
                       copyQueueStatus: copyQueueStatus,
                       lastCopyOperationReceivedTimeUtc: lastCopyOperationReceivedTimeUtc,
                       lastAcknowledgementSentTimeUtc: lastAcknowledgementSentTimeUtc));
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static StatefulServiceReplicaInfo GetFromJsonProperties(JsonReader reader)
        {
            var replicaStatus = default(ReplicaStatus?);
            var healthState   = default(HealthState?);
            var nodeName      = default(NodeName);
            var address       = default(string);
            var lastInBuildDurationInSeconds = default(string);
            var replicaRole = default(ReplicaRole?);
            var replicaId   = default(ReplicaId);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("ReplicaStatus", propName, StringComparison.Ordinal) == 0)
                {
                    replicaStatus = ReplicaStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("HealthState", propName, StringComparison.Ordinal) == 0)
                {
                    healthState = HealthStateConverter.Deserialize(reader);
                }
                else if (string.Compare("NodeName", propName, StringComparison.Ordinal) == 0)
                {
                    nodeName = NodeNameConverter.Deserialize(reader);
                }
                else if (string.Compare("Address", propName, StringComparison.Ordinal) == 0)
                {
                    address = reader.ReadValueAsString();
                }
                else if (string.Compare("LastInBuildDurationInSeconds", propName, StringComparison.Ordinal) == 0)
                {
                    lastInBuildDurationInSeconds = reader.ReadValueAsString();
                }
                else if (string.Compare("ReplicaRole", propName, StringComparison.Ordinal) == 0)
                {
                    replicaRole = ReplicaRoleConverter.Deserialize(reader);
                }
                else if (string.Compare("ReplicaId", propName, StringComparison.Ordinal) == 0)
                {
                    replicaId = ReplicaIdConverter.Deserialize(reader);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new StatefulServiceReplicaInfo(
                       replicaStatus: replicaStatus,
                       healthState: healthState,
                       nodeName: nodeName,
                       address: address,
                       lastInBuildDurationInSeconds: lastInBuildDurationInSeconds,
                       replicaRole: replicaRole,
                       replicaId: replicaId));
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static ReconfigurationInformation GetFromJsonProperties(JsonReader reader)
        {
            var previousConfigurationRole   = default(ReplicaRole?);
            var reconfigurationPhase        = default(ReconfigurationPhase?);
            var reconfigurationType         = default(ReconfigurationType?);
            var reconfigurationStartTimeUtc = default(DateTime?);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("PreviousConfigurationRole", propName, StringComparison.Ordinal) == 0)
                {
                    previousConfigurationRole = ReplicaRoleConverter.Deserialize(reader);
                }
                else if (string.Compare("ReconfigurationPhase", propName, StringComparison.Ordinal) == 0)
                {
                    reconfigurationPhase = ReconfigurationPhaseConverter.Deserialize(reader);
                }
                else if (string.Compare("ReconfigurationType", propName, StringComparison.Ordinal) == 0)
                {
                    reconfigurationType = ReconfigurationTypeConverter.Deserialize(reader);
                }
                else if (string.Compare("ReconfigurationStartTimeUtc", propName, StringComparison.Ordinal) == 0)
                {
                    reconfigurationStartTimeUtc = reader.ReadValueAsDateTime();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new ReconfigurationInformation(
                       previousConfigurationRole: previousConfigurationRole,
                       reconfigurationPhase: reconfigurationPhase,
                       reconfigurationType: reconfigurationType,
                       reconfigurationStartTimeUtc: reconfigurationStartTimeUtc));
        }
Esempio n. 4
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static DeployedStatefulServiceReplicaInfo GetFromJsonProperties(JsonReader reader)
        {
            var serviceName                = default(ServiceName);
            var serviceTypeName            = default(string);
            var serviceManifestName        = default(string);
            var codePackageName            = default(string);
            var partitionId                = default(PartitionId);
            var replicaStatus              = default(ReplicaStatus?);
            var address                    = default(string);
            var servicePackageActivationId = default(string);
            var hostProcessId              = default(string);
            var replicaId                  = default(ReplicaId);
            var replicaRole                = default(ReplicaRole?);
            var reconfigurationInformation = default(ReconfigurationInformation);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("ServiceName", propName, StringComparison.Ordinal) == 0)
                {
                    serviceName = ServiceNameConverter.Deserialize(reader);
                }
                else if (string.Compare("ServiceTypeName", propName, StringComparison.Ordinal) == 0)
                {
                    serviceTypeName = reader.ReadValueAsString();
                }
                else if (string.Compare("ServiceManifestName", propName, StringComparison.Ordinal) == 0)
                {
                    serviceManifestName = reader.ReadValueAsString();
                }
                else if (string.Compare("CodePackageName", propName, StringComparison.Ordinal) == 0)
                {
                    codePackageName = reader.ReadValueAsString();
                }
                else if (string.Compare("PartitionId", propName, StringComparison.Ordinal) == 0)
                {
                    partitionId = PartitionIdConverter.Deserialize(reader);
                }
                else if (string.Compare("ReplicaStatus", propName, StringComparison.Ordinal) == 0)
                {
                    replicaStatus = ReplicaStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("Address", propName, StringComparison.Ordinal) == 0)
                {
                    address = reader.ReadValueAsString();
                }
                else if (string.Compare("ServicePackageActivationId", propName, StringComparison.Ordinal) == 0)
                {
                    servicePackageActivationId = reader.ReadValueAsString();
                }
                else if (string.Compare("HostProcessId", propName, StringComparison.Ordinal) == 0)
                {
                    hostProcessId = reader.ReadValueAsString();
                }
                else if (string.Compare("ReplicaId", propName, StringComparison.Ordinal) == 0)
                {
                    replicaId = ReplicaIdConverter.Deserialize(reader);
                }
                else if (string.Compare("ReplicaRole", propName, StringComparison.Ordinal) == 0)
                {
                    replicaRole = ReplicaRoleConverter.Deserialize(reader);
                }
                else if (string.Compare("ReconfigurationInformation", propName, StringComparison.Ordinal) == 0)
                {
                    reconfigurationInformation = ReconfigurationInformationConverter.Deserialize(reader);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new DeployedStatefulServiceReplicaInfo(
                       serviceName: serviceName,
                       serviceTypeName: serviceTypeName,
                       serviceManifestName: serviceManifestName,
                       codePackageName: codePackageName,
                       partitionId: partitionId,
                       replicaStatus: replicaStatus,
                       address: address,
                       servicePackageActivationId: servicePackageActivationId,
                       hostProcessId: hostProcessId,
                       replicaId: replicaId,
                       replicaRole: replicaRole,
                       reconfigurationInformation: reconfigurationInformation));
        }