コード例 #1
0
 protected override void InternalProcessRecord()
 {
     base.InternalProcessRecord();
     using (OnboardingService onboardingService = new MsoOnboardingService())
     {
         ResultCode?result = null;
         try
         {
             result = new ResultCode?(onboardingService.SetServiceInstanceMap(this.map));
         }
         catch (Exception exception)
         {
             this.WriteError(exception, ErrorCategory.ResourceUnavailable, null, true);
         }
         if (result != null && result.Value == ResultCode.Success)
         {
             this.Configuration = ServiceInstanceMapSerializer.ConvertServiceInstanceMapToXml(this.map);
             base.WriteObject(new BposPlacementConfiguration(this.Configuration));
         }
         else
         {
             string errorStringForResultcode = MsoOnboardingService.GetErrorStringForResultcode(result);
             this.WriteError(new CouldNotUpdateServiceInstanceMapException(errorStringForResultcode), ErrorCategory.InvalidData, null, true);
         }
     }
 }
コード例 #2
0
 protected override void InternalProcessRecord()
 {
     base.InternalProcessRecord();
     try
     {
         using (OnboardingService onboardingService = new MsoOnboardingService())
         {
             ServiceInstanceMapValue map = null;
             try
             {
                 map = onboardingService.GetServiceInstanceMap();
             }
             catch (Exception exception)
             {
                 this.WriteError(exception, ErrorCategory.ResourceUnavailable, null, true);
             }
             string configuration = ServiceInstanceMapSerializer.ConvertServiceInstanceMapToXml(map);
             base.WriteObject(new BposPlacementConfiguration(configuration));
         }
     }
     catch (CouldNotCreateMsoOnboardingServiceException exception2)
     {
         this.WriteError(exception2, ErrorCategory.ObjectNotFound, null, true);
     }
     catch (InvalidServiceInstanceMapXmlFormatException exception3)
     {
         this.WriteError(exception3, ErrorCategory.InvalidData, null, true);
     }
     catch (Exception exception4)
     {
         this.WriteError(exception4, ErrorCategory.InvalidOperation, null, true);
     }
 }
コード例 #3
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (!base.HasErrors)
     {
         try
         {
             this.map = ServiceInstanceMapSerializer.ConvertXmlToServiceInstanceMap(this.Configuration);
         }
         catch (InvalidServiceInstanceMapXmlFormatException exception)
         {
             this.WriteError(exception, ErrorCategory.InvalidData, null, true);
         }
     }
     TaskLogger.LogExit();
 }