Example #1
0
 internal override void Invoke()
 {
     if (string.IsNullOrEmpty(UniqueID))
     {
         this._client     = ExternalClientFactory.ConstructReportServiceClient(ExternalLib.Endpoint.ReportEndpointName, ExternalLib.Endpoint.ExternalUserName, ExternalLib.Endpoint.ExternalUserPassword);
         this._FWDLReport = this._client.ServiceClient.GetFirmwareDownloadsRunningReport();
         this._client.ServiceClient.Close();
     }
 }
Example #2
0
        private void GetFirmwareDownloadsReport()
        {
            //TODO: Request that firmware download API accept callback parameter then wouldn't have to request a report and poll.
            Client <ReportServiceClient> c = null;

            c = InternalClientFactory.ConstructReportServiceClient(InternalLib.Endpoint.ReportEndpointName, InternalLib.Endpoint.ExternalUserName, InternalLib.Endpoint.ExternalUserPassword);
            FirmwareDownloadsReportInput fwdlReportInput = new FirmwareDownloadsReportInput();

            //Request all fwdl jobs between the begin
            fwdlReportInput.StartTime = _fwdl.FWDLBegin;
            fwdlReportInput.StopTime  = DateTime.Now;
            this._fwdlsRunningReport  = c.ServiceClient.GetFirmwareDownloadsReport(fwdlReportInput);
            c.ServiceClient.Close();
        }
Example #3
0
        internal void Run()
        {
            this._fwdlsRunningReport = null;
            Result result = null;

            while ((null == result) && !_fwdl.EventStopFWDLThread.WaitOne(3000, true))
            {
                GetFirmwareDownloadsReport();

                //TODO: FirmwareDownloadItems[0].Status is an EnumJobStatus type that is not exposed in web services, thus test status against hard string.  Request EnumJobStatus be exposed.
                if (null != _fwdlsRunningReport)
                {
                    if (0 < _fwdlsRunningReport.FirmwareDownloadItems.Length)
                    {
                        //firmware download running
                        foreach (FirmwareDownloadItem fwdlItem in _fwdlsRunningReport.FirmwareDownloadItems)
                        {
                            if ((fwdlItem.JobId == this._fwdl.CurrentFWDLJob.JobKey.value.ToString()) &&
                                (fwdlItem.Status != "Running" && fwdlItem.Status != "Initializing"))
                            {
                                result = new Result();

                                if ("Successful" == _fwdlsRunningReport.FirmwareDownloadItems[0].Status)
                                {
                                    result.ActionResultType = EnumResultCodeType.SUCCESS;
                                }
                                else
                                {
                                    result.ActionResultType = EnumResultCodeType.FAILURE;
                                }

                                InternalLib.Listener.InternalAPIController.DataArrived(this._fwdl.CurrentFWDLJob.UniqueID, result, this._fwdl.CurrentFWDLJob.JobKey.value);
                                break;
                            }
                        }
                    }
                }
            }

            _fwdl.EventFWDLThreadStopped.Set();
        }
Example #4
0
        public int GetEndpointsCompletedForCurrentJob()
        {
            int iEndpointsComplete = 0;
            //TODO: Request that firmware download API accept callback parameter then wouldn't have to request a report and poll.
            Client <ReportServiceClient> c = null;

            c = InternalClientFactory.ConstructReportServiceClient(InternalLib.Endpoint.ReportEndpointName, InternalLib.Endpoint.ExternalUserName, InternalLib.Endpoint.ExternalUserPassword);
            FirmwareDownloadsReportInput fwdlReportInput = new FirmwareDownloadsReportInput();

            //Request all fwdl jobs between the begin
            fwdlReportInput.StartTime = FWDLBegin;
            fwdlReportInput.StopTime  = DateTime.Now;
            FirmwareDownloadsReport _fwdlsRunningReport = c.ServiceClient.GetFirmwareDownloadsReport(fwdlReportInput);

            c.ServiceClient.Close();


            //TODO: FirmwareDownloadItems[0].Status is an EnumJobStatus type that is not exposed in web services, thus test status against hard string.  Request EnumJobStatus be exposed.
            if (null != _fwdlsRunningReport)
            {
                if (0 < _fwdlsRunningReport.FirmwareDownloadItems.Length)
                {
                    //firmware download running
                    foreach (FirmwareDownloadItem fwdlItem in _fwdlsRunningReport.FirmwareDownloadItems)
                    {
                        if (fwdlItem.JobId == CurrentFWDLJob.JobKey.value.ToString())
                        {
                            iEndpointsComplete = fwdlItem.CountOfEndpointsComplete;
                            break;
                        }
                    }
                }
            }

            return(iEndpointsComplete);
        }