Ejemplo n.º 1
0
        internal static ThreeTierConfiguration DeserializeThreeTierConfiguration(JsonElement element)
        {
            Optional <NetworkConfiguration>          networkConfiguration   = default;
            CentralServerConfiguration               centralServer          = default;
            ApplicationServerConfiguration           applicationServer      = default;
            DatabaseConfiguration                    databaseServer         = default;
            Optional <HighAvailabilityConfiguration> highAvailabilityConfig = default;
            SapDeploymentType deploymentType   = default;
            string            appResourceGroup = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("networkConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("centralServer"))
                {
                    centralServer = CentralServerConfiguration.DeserializeCentralServerConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("applicationServer"))
                {
                    applicationServer = ApplicationServerConfiguration.DeserializeApplicationServerConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("databaseServer"))
                {
                    databaseServer = DatabaseConfiguration.DeserializeDatabaseConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("highAvailabilityConfig"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    highAvailabilityConfig = HighAvailabilityConfiguration.DeserializeHighAvailabilityConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("deploymentType"))
                {
                    deploymentType = new SapDeploymentType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("appResourceGroup"))
                {
                    appResourceGroup = property.Value.GetString();
                    continue;
                }
            }
            return(new ThreeTierConfiguration(deploymentType, appResourceGroup, networkConfiguration.Value, centralServer, applicationServer, databaseServer, highAvailabilityConfig.Value));
        }
Ejemplo n.º 2
0
 internal ThreeTierConfiguration(SapDeploymentType deploymentType, string appResourceGroup, NetworkConfiguration networkConfiguration, CentralServerConfiguration centralServer, ApplicationServerConfiguration applicationServer, DatabaseConfiguration databaseServer, HighAvailabilityConfiguration highAvailabilityConfig) : base(deploymentType, appResourceGroup)
 {
     NetworkConfiguration   = networkConfiguration;
     CentralServer          = centralServer;
     ApplicationServer      = applicationServer;
     DatabaseServer         = databaseServer;
     HighAvailabilityConfig = highAvailabilityConfig;
     DeploymentType         = deploymentType;
 }
Ejemplo n.º 3
0
        public ThreeTierConfiguration(string appResourceGroup, CentralServerConfiguration centralServer, ApplicationServerConfiguration applicationServer, DatabaseConfiguration databaseServer) : base(appResourceGroup)
        {
            if (appResourceGroup == null)
            {
                throw new ArgumentNullException(nameof(appResourceGroup));
            }
            if (centralServer == null)
            {
                throw new ArgumentNullException(nameof(centralServer));
            }
            if (applicationServer == null)
            {
                throw new ArgumentNullException(nameof(applicationServer));
            }
            if (databaseServer == null)
            {
                throw new ArgumentNullException(nameof(databaseServer));
            }

            CentralServer     = centralServer;
            ApplicationServer = applicationServer;
            DatabaseServer    = databaseServer;
            DeploymentType    = SapDeploymentType.ThreeTier;
        }