Esempio n. 1
0
        private void ValidateEndpointRange(EndpointRangeDescription endpointRange, string endpointRangeName)
        {
            if (endpointRange.StartPort < this.clusterManifestGeneratorSettings.MinAllowedPortNumber ||
                endpointRange.StartPort > this.clusterManifestGeneratorSettings.MaxAllowedPortNumber)
            {
                throw new ValidationException(
                          ClusterManagementErrorCode.PortOutOfRange,
                          endpointRangeName,
                          endpointRange.StartPort,
                          this.clusterManifestGeneratorSettings.MinAllowedPortNumber,
                          this.clusterManifestGeneratorSettings.MaxAllowedPortNumber);
            }

            if (endpointRange.EndPort < this.clusterManifestGeneratorSettings.MinAllowedPortNumber ||
                endpointRange.EndPort > this.clusterManifestGeneratorSettings.MaxAllowedPortNumber)
            {
                throw new ValidationException(
                          ClusterManagementErrorCode.PortOutOfRange,
                          endpointRangeName,
                          endpointRange.EndPort,
                          this.clusterManifestGeneratorSettings.MinAllowedPortNumber,
                          this.clusterManifestGeneratorSettings.MaxAllowedPortNumber);
            }

            if (endpointRange.StartPort > endpointRange.EndPort)
            {
                throw new ValidationException(ClusterManagementErrorCode.StartPortGreaterThanEnd, endpointRangeName);
            }
        }
Esempio n. 2
0
        private void ValidateDynamicPorts(EndpointRangeDescription endpointRange)
        {
            this.ValidateEndpointRange(endpointRange, "DynamicPorts");

            if (endpointRange.EndPort - endpointRange.StartPort < this.clusterManifestGeneratorSettings.MinDynamicPortCount)
            {
                throw new ValidationException(ClusterManagementErrorCode.InsufficientDynamicPorts, this.clusterManifestGeneratorSettings.MinDynamicPortCount);
            }
        }