コード例 #1
0
        protected override void ProcessRecord()
        {
            var farmServerParams = new FarmServerParamHandler(Name, Farm, UseDnsLookup.IsPresent);
            var farmManager = farmServerParams.GetWebFarmManager();

            switch(State)
            {
                case State.Online:
                    farmManager.TakeOnline(WriteObject);
                    break;
                case State.Offline:
                    farmManager.TakeOffline(Force.ToBool(), WriteObject);
                    break;
                case State.Available:
                    farmManager.SetAvailable(WriteObject);
                    break;
                case State.DisallowNewConnections:
                    farmManager.DisallowNewConnections(WriteObject);
                    break;
                case State.Healthy:
                    farmManager.SetHealthy(WriteObject);
                    break;
                case State.Unavailable:
                    farmManager.SetUnavailable(Force.ToBool(), WriteObject);
                    break;
                case State.Unhealthy:
                    farmManager.SetUnhealthy(WriteObject);
                    break;
                default:
                    throw new Exception(string.Format("State [{0}] not supported.", State));
            }
        }
コード例 #2
0
 protected override void ProcessRecord()
 {
     var farmServerParams = new FarmServerParamHandler(Name, Farm, UseDnsLookup.IsPresent);
     var farmManager = farmServerParams.GetWebFarmManager();
     WriteObject(farmManager.FarmServers, true);
 }