private object[] OnEndQueryWorkItems(IAsyncResult result) { WorkItemQueryResult workItemQueryResult = this.EndQueryWorkItems(result); return(new object[] { workItemQueryResult }); }
public WorkItemQueryResult QueryWorkItems(string groupName, string tenantTier, string workItemType, WorkItemStatus status, int pageSize, byte[] bookmark) { WorkItemQueryResult result2; using (ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler> workloadClient = new ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler>(this.WorkloadUri, this.Cert)) { WorkItemQueryResult result = null; workloadClient.CallSymphony(delegate { result = workloadClient.Proxy.QueryWorkItems(groupName, tenantTier, workItemType, status, pageSize, bookmark); }, this.WorkloadUri.ToString()); result2 = result; } return(result2); }
private WorkItemInfo[] QueryWorkItems(WorkItemStatus status, string type) { WorkItemQueryResult workItemQueryResult = new WorkItemQueryResult(); List <WorkItemInfo> list = new List <WorkItemInfo>(); base.Context.Logger.Log(MigrationEventType.Information, "Querying for workitems of Type: {0} Status: {1}", new object[] { type, status }); try { do { workItemQueryResult = this.symphonyProxy.QueryWorkItems(this.ForestName, null, type, status, 1000, workItemQueryResult.Bookmark); list.AddRange(workItemQueryResult.WorkItems); }while (workItemQueryResult.HasMoreResults); } catch (Exception ex) { if (ex is MigrationTransientException || ex is MigrationPermanentException || ex is InvalidOperationException) { base.Context.Logger.Log(MigrationEventType.Error, "Error querying workitems. Forest: {0} Type: {1} Status: {2} Exception: {3}", new object[] { this.ForestName, type, status, ex }); throw new ErrorQueryingWorkItemException(ex); } throw; } base.Context.Logger.Log(MigrationEventType.Information, "Found {0} workitems for query of Forest: {1} Type: {2} Status: {3}", new object[] { list.Count, this.ForestName, type, status }); this.queriedCount += list.Count; return(list.ToArray()); }