Esempio n. 1
0
        public BatchChangeset GetChangeset(string id)
        {
            BatchChangeset set = new BatchChangeset(this, id);

            _changesets.Add(set);
            return(set);
        }
Esempio n. 2
0
        public BatchChangeset GetChangeset()
        {
            BatchChangeset set = new BatchChangeset(this);

            _changesets.Add(set);
            return(set);
        }
Esempio n. 3
0
        public void Add(AstoriaRequest request)
        {
            if (currentBatch == null)
            {
                currentBatch = new BatchRequest(request.Workspace);
            }

            if (request.Verb == RequestVerb.Get)
            {
                currentBatch.Add(request);
            }
            else
            {
                if (currentChangeset == null)
                {
                    currentChangeset = currentBatch.GetChangeset();
                }
                currentChangeset.Add(request);
            }

            if (currentBatch.TotalRequests >= Size && AutoSubmit)
            {
                Finish();
            }
        }
Esempio n. 4
0
        public void Finish()
        {
            if (currentBatch != null)
            {
                currentBatch.GetResponse().Verify();
            }

            currentBatch     = null;
            currentChangeset = null;
        }
Esempio n. 5
0
        public virtual AstoriaResponse GetResponse()
        {
            LogRequest();

            OnSend(this);

            // NOTHING should come in between this and actually sending the request
#if !ClientSKUFramework
            SetupAPICallLog();
#endif
            AstoriaResponse response;
            if (AstoriaTestProperties.BatchAllRequests)
            {
                BatchRequest batchRequest = new BatchRequest(Workspace);
                if (Verb_Internal == RequestVerb.Get)
                {
                    batchRequest.Add(this);
                }
                else
                {
                    BatchChangeset changeset = batchRequest.GetChangeset();
                    changeset.Add(this);
                }
                BatchResponse batchResponse = batchRequest.GetResponse() as BatchResponse;
                response = batchResponse.Responses.FirstOrDefault();
            }
            else
            {
                response = RequestSender.SendRequest(this);
            }

#if !ClientSKUFramework
            // NOTHING should come in between this and actually recieving the response
            RetrieveAPICallLog();
#endif

            OnReceive(this, response);

            return(response);
        }
Esempio n. 6
0
 public void Add(BatchChangeset changeset)
 {
     _changesets.Add(changeset);
 }