예제 #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (party_ != null)
            {
                hash ^= Party.GetHashCode();
            }
            if (Result != 0)
            {
                hash ^= Result.GetHashCode();
            }
            if (DeploymentId.Length != 0)
            {
                hash ^= DeploymentId.GetHashCode();
            }
            if (DeploymentName.Length != 0)
            {
                hash ^= DeploymentName.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
예제 #2
0
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hash = DeploymentId.GetHashCode();
         // Suitable nullity checks etc, of course :)
         if (DeploymentName != null)
         {
             hash = hash * 17 + DeploymentName.GetHashCode();
         }
         if (DeploymentCategory != null)
         {
             hash = hash * 17 + DeploymentCategory.GetHashCode();
         }
         if (DeploymentTenantId != null)
         {
             hash = hash * 17 + DeploymentTenantId.GetHashCode();
         }
         if (DeploymentVersion != null)
         {
             hash = hash * 17 + DeploymentVersion.GetHashCode();
         }
         return(hash);
     }
 }
예제 #3
0
        /// <inheritdoc/>
        protected override async Task <object> CallGitHubApi(DialogContext dc, Octokit.GitHubClient gitHubClient, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (Owner != null && Name != null && DeploymentId != null && Options != null)
            {
                var ownerValue        = Owner.GetValue(dc.State);
                var nameValue         = Name.GetValue(dc.State);
                var deploymentIdValue = DeploymentId.GetValue(dc.State);
                var optionsValue      = Options.GetValue(dc.State);
                return(await gitHubClient.Repository.Deployment.Status.GetAll(ownerValue, nameValue, (Int32)deploymentIdValue, optionsValue).ConfigureAwait(false));
            }
            if (Owner != null && Name != null && DeploymentId != null)
            {
                var ownerValue        = Owner.GetValue(dc.State);
                var nameValue         = Name.GetValue(dc.State);
                var deploymentIdValue = DeploymentId.GetValue(dc.State);
                return(await gitHubClient.Repository.Deployment.Status.GetAll(ownerValue, nameValue, (Int32)deploymentIdValue).ConfigureAwait(false));
            }
            if (RepositoryId != null && DeploymentId != null && Options != null)
            {
                var repositoryIdValue = RepositoryId.GetValue(dc.State);
                var deploymentIdValue = DeploymentId.GetValue(dc.State);
                var optionsValue      = Options.GetValue(dc.State);
                return(await gitHubClient.Repository.Deployment.Status.GetAll((Int64)repositoryIdValue, (Int32)deploymentIdValue, optionsValue).ConfigureAwait(false));
            }
            if (RepositoryId != null && DeploymentId != null)
            {
                var repositoryIdValue = RepositoryId.GetValue(dc.State);
                var deploymentIdValue = DeploymentId.GetValue(dc.State);
                return(await gitHubClient.Repository.Deployment.Status.GetAll((Int64)repositoryIdValue, (Int32)deploymentIdValue).ConfigureAwait(false));
            }

            throw new ArgumentNullException("Required [deploymentId] arguments missing for GitHubClient.Repository.Deployment.Status.GetAll");
        }
예제 #4
0
 public override int GetHashCode()
 {
     unchecked {
         return ((DeploymentId != null ? DeploymentId.GetHashCode() : 0) * 397) ^
                (Name != null ? Name.GetHashCode() : 0);
     }
 }
        public override int GetHashCode()
        {
            int result = DeploymentId != null?DeploymentId.GetHashCode() : 0;

            result = 31 * result + (Role != null ? Role.GetHashCode() : 0);
            result = 31 * result + (RoleInstance != null ? RoleInstance.GetHashCode() : 0);
            result = 31 * result + (CounterName != null ? CounterName.GetHashCode() : 0);
            result = 31 * result + (int)(_eventTickCount ^ (_eventTickCount >> 32));
            return(result);
        }
예제 #6
0
        public async Task <IClusterClient> CreateOrleansClient()
        {
            if (DeploymentId.IsNullOrWhiteSpace())
            {
                throw new ConfigurationErrorsException($"Cannot connect to Azure silos with null deploymentId.");
            }

            if (DataConnectionString.IsNullOrWhiteSpace())
            {
                throw new ConfigurationErrorsException($"Cannot connect to Azure silos with null connectionString.");
            }

            Log.Info($"Initializing Orleans Client.");
            Exception lastException = null;

            for (var i = 0; i < MaxRetries; i++)
            {
                if (i > 0)
                {
                    // Pause to let Primary silo start up and register
                    await Task.Delay(StartupRetryPause);
                }

                try {
                    var client = new ClientBuilder()
                                 .UseConfiguration(Configuration)
                                 .AddClusterConnectionLostHandler((sender, e) => Log.Info("Orleans cluster connection lost."))
                                 .Build();
                    // Connect will throw if cannot find Gateways
                    await client.Connect();

                    return(client);
                } catch (Exception exc) {
                    lastException = exc;
                    exc.Report("Error initializing Orleans Client. Will retry.");
                }
            }

            if (lastException != null)
            {
                throw new OrleansException($"Could not Initialize Client for DeploymentId={DeploymentId}.", lastException);
            }
            else
            {
                throw new OrleansException($"Could not Initialize Client for DeploymentId={DeploymentId}.");
            }
        }
예제 #7
0
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hash = (Key != null) ? Key.GetHashCode() : 0;
         // Suitable nullity checks etc, of course :)
         hash = (DeploymentId != null) ? hash * 17 + DeploymentId.GetHashCode() : hash;
         hash = (Name != null) ? hash * 17 + Name.GetHashCode() : hash;
         hash = (DefinitionKey != null) ? hash * 17 + DefinitionKey.GetHashCode() : hash;
         hash = (ProcessDefinitionDescription != null) ? hash * 17 + ProcessDefinitionDescription.GetHashCode() : hash;
         hash = (ProcessDefinitionResource != null) ? hash * 17 + ProcessDefinitionResource.GetHashCode() : hash;
         hash = (ProcessDefinitionDiagramResourceName != null) ? hash * 17 + ProcessDefinitionDiagramResourceName.GetHashCode() : hash;
         hash = hash * 17 + ProcessDefinitionHasStartFormKey.GetHashCode();
         hash = hash * 17 + ProcessDefinitionHasGraphicalNotation.GetHashCode();
         hash = hash * 17 + IsSuspended.GetHashCode();
         hash = (TenantId != null) ? hash * 17 + TenantId.GetHashCode() : hash;
         return(hash);
     }
 }
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || (o as PerformanceData) == null)
            {
                return(false);
            }

            var that = (PerformanceData)o;

            if (_eventTickCount != that._eventTickCount)
            {
                return(false);
            }
            if (CounterName != null ? !CounterName.Equals(that.CounterName) : that.CounterName != null)
            {
                return(false);
            }
            if (DeploymentId != null ? !DeploymentId.Equals(that.DeploymentId) : that.DeploymentId != null)
            {
                return(false);
            }
            if (Role != null ? !Role.Equals(that.Role) : that.Role != null)
            {
                return(false);
            }
            if (RoleInstance != null ? !RoleInstance.Equals(that.RoleInstance) : that.RoleInstance != null)
            {
                return(false);
            }

            return(true);
        }
        /// <inheritdoc />
        public Deployment GetById(DeploymentId deploymentId)
        {
            var deployment = GetAll().Single(_ => _.Id == deploymentId);

            return(deployment);
        }
예제 #10
0
        public bool Equals(BpmnDefinition other)
        {
            // Check for null
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            // Check for same reference
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            // Not Check DeploymentId, because generated Guid

            // Check for same value
            return(((DeploymentId == null && other.DeploymentId == null) || (DeploymentId != null && other.DeploymentId != null && DeploymentId.Equals(other.DeploymentId))) &&
                   ((Name == null && other.Name == null) || (Name != null && other.Name != null && Name.Equals(other.Name))) &&
                   ((DefinitionKey == null && other.DefinitionKey == null) || (DefinitionKey != null && other.DefinitionKey != null && DefinitionKey.Equals(other.DefinitionKey))) &&
                   ((ProcessDefinitionDescription == null && other.ProcessDefinitionDescription == null) || (ProcessDefinitionDescription != null && other.ProcessDefinitionDescription != null && ProcessDefinitionDescription.Equals(other.ProcessDefinitionDescription))) &&
                   ((ProcessDefinitionDiagramResourceName == null && other.ProcessDefinitionDiagramResourceName == null) || (ProcessDefinitionDiagramResourceName != null && other.ProcessDefinitionDiagramResourceName != null && ProcessDefinitionDiagramResourceName.Equals(other.ProcessDefinitionDiagramResourceName))) &&
                   (ProcessDefinitionHasStartFormKey.Equals(other.ProcessDefinitionHasStartFormKey)) &&
                   (ProcessDefinitionHasGraphicalNotation.Equals(other.ProcessDefinitionHasGraphicalNotation)) &&
                   (IsSuspended.Equals(other.IsSuspended)) &&
                   ((TenantId == null && other.TenantId == null) || (TenantId != null && other.TenantId != null && TenantId.Equals(other.TenantId))));
        }