コード例 #1
0
 private void SetRetryPolicyInterceptor(Protocol.IBatchRequest request)
 {
     if (null != this.Policy)
     {
         request.RetryPolicy = this.Policy;
     }
 }
コード例 #2
0
ファイル: BatchRequestTimeout.cs プロジェクト: QITIE/ADLSTool
        private void SetTimeoutInterceptor(Protocol.IBatchRequest request)
        {
            if (this.ClientTimeout.HasValue)
            {
                request.Timeout = this.ClientTimeout.Value;
            }
            ITimeoutOptions timeoutOptions = request.Options as ITimeoutOptions;

            if (this.ServerTimeout.HasValue && timeoutOptions != null)
            {
                //TODO: It would be nice if the Parameters.ServerTimeout property were a TimeSpan not an int
                timeoutOptions.Timeout = (int)this.ServerTimeout.Value.TotalSeconds;
            }
        }
コード例 #3
0
        private void SetODATAPredicates(Protocol.IBatchRequest request)
        {
            IODataFilter filterOptions = request.Options as IODataFilter;
            IODataExpand expandOptions = request.Options as IODataExpand;
            IODataSelect selectOptions = request.Options as IODataSelect;

            if (filterOptions != null)
            {
                filterOptions.Filter = this._details.FilterClause;
            }
            else if (!string.IsNullOrEmpty(this._details.FilterClause))
            {
                //Note: We explicitly set this to be "detailLevel" for clarity for the customer even though at this scope there is no detailLevel param
                throw new ArgumentException(string.Format(BatchErrorMessages.TypeDoesNotSupportFilterClause, request.GetType()), "detailLevel");
            }

            if (expandOptions != null)
            {
                expandOptions.Expand = this._details.ExpandClause;
            }
            else if (!string.IsNullOrEmpty(this._details.ExpandClause))
            {
                //Note: We explicitly set this to be "detailLevel" for clarity for the customer even though at this scope there is no detailLevel param
                throw new ArgumentException(string.Format(BatchErrorMessages.TypeDoesNotSupportExpandClause, request.GetType()), "detailLevel");
            }

            if (selectOptions != null)
            {
                selectOptions.Select = this._details.SelectClause;
            }
            else if (!string.IsNullOrEmpty(this._details.SelectClause))
            {
                //Note: We explicitly set this to be "detailLevel" for clarity for the customer even though at this scope there is no detailLevel param
                throw new ArgumentException(string.Format(BatchErrorMessages.TypeDoesNotSupportSelectClause, request.GetType()), "detailLevel");
            }
        }
コード例 #4
0
 /// <summary>
 /// Does nothing.
 /// </summary>
 private static void NOOP(ref Protocol.IBatchRequest request)
 {
 }
コード例 #5
0
 /// <summary>
 /// A replacment interceptor that calls our modification interceptor.
 /// </summary>
 private new void ReplacementInterceptHandler(ref Protocol.IBatchRequest request)
 {
     _modInterceptor(request);
 }