internal void FireBeforeRequestEvent(object sender, RequestEventArgs args) { if (mBeforeRequestEvent != null) { mBeforeRequestEvent(sender, args); } }
private void ClientBeforeRequestEvent(object sender, Amazon.Runtime.RequestEventArgs e) { var client = sender as AmazonServiceClient; if (client == null) { throw new InvalidOperationException(); } var wsrea = e as WebServiceRequestEventArgs; if (wsrea == null) { throw new InvalidOperationException(); } var request = wsrea.Request; var describeTableRequest = request as DescribeTableRequest; if (describeTableRequest != null) { var keys = TableCache.Keys; if (keys.Contains(describeTableRequest.TableName)) { Assert.True(false, "Attempting to describe table that has already been described"); } } }
internal static void FileIORequestEventHandler(object sender, RequestEventArgs args) { WebServiceRequestEventArgs wsArgs = args as WebServiceRequestEventArgs; if (wsArgs != null) { string currentUserAgent = wsArgs.Headers[AWSSDKUtils.UserAgentHeader]; wsArgs.Headers[AWSSDKUtils.UserAgentHeader] = currentUserAgent + " FileIO"; } }
internal static void FileIORequestEventHandler(object sender, RequestEventArgs args) { S3RequestEventArgs s3args = args as S3RequestEventArgs; if (s3args != null) { string currentUserAgent = s3args.Headers[System.Net.HttpRequestHeader.UserAgent]; s3args.Headers[System.Net.HttpRequestHeader.UserAgent] = currentUserAgent + " FileIO"; } }
protected void RequestEventHandler(object sender, RequestEventArgs args) { S3RequestEventArgs s3args = args as S3RequestEventArgs; if (s3args != null) { string currentUserAgent = s3args.Headers[System.Net.HttpRequestHeader.UserAgent]; s3args.Headers[System.Net.HttpRequestHeader.UserAgent] = currentUserAgent + " TransferManager/" + this.GetType().Name; } }
protected void RequestEventHandler(object sender, RequestEventArgs args) { WebServiceRequestEventArgs wsArgs = args as WebServiceRequestEventArgs; if (wsArgs != null) { string currentUserAgent = wsArgs.Headers[AWSSDKUtils.UserAgentHeader]; wsArgs.Headers[AWSSDKUtils.UserAgentHeader] = currentUserAgent + " TransferManager/" + this.GetType().Name; } }
private void UserAgentRequestEventHandler(object sender, RequestEventArgs args, bool isAsync) { WebServiceRequestEventArgs wsArgs = args as WebServiceRequestEventArgs; if (wsArgs != null) { string currentUserAgent = wsArgs.Headers[AWSSDKUtils.UserAgentHeader]; wsArgs.Headers[AWSSDKUtils.UserAgentHeader] = currentUserAgent + " " + this.TableConsumer.ToString() + " " + (isAsync ? "TableAsync" : "TableSync"); } }
internal void UserAgentRequestEventHandlerSync(object sender, RequestEventArgs args) { UserAgentRequestEventHandler(sender, args, false); }
internal void FireBeforeRequestEvent(object sender, RequestEventArgs args) { if (BeforeRequestEvent != null) BeforeRequestEvent(sender, args); }
void Amazon.S3.Internal.IS3RequestEvents.FireBeforeRequestEvent(object sender, RequestEventArgs args) { ((S3Request)this).FireBeforeRequestEvent(sender, args); }
internal void UserAgentRequestEventHandler(object sender, RequestEventArgs args) { WebServiceRequestEventArgs wsArgs = args as WebServiceRequestEventArgs; if (wsArgs != null) { string currentUserAgent = wsArgs.Headers[AWSSDKUtils.UserAgentHeader]; wsArgs.Headers[AWSSDKUtils.UserAgentHeader] = currentUserAgent + " " + this.TableConsumer.ToString(); } }
private void SetDryRunParameterCallback(object sender, RequestEventArgs args) { WebServiceRequestEventArgs wsrea = args as WebServiceRequestEventArgs; if (wsrea != null) { wsrea.Parameters["DryRun"] = "true"; } }
void IRequestEvents.FireBeforeRequestEvent(object sender, RequestEventArgs args) { if (BeforeRequestEvent != null) BeforeRequestEvent(sender, args); }
void IRequestEvents.FireBeforeRequestEvent(object sender, RequestEventArgs args) { ((AmazonWebServiceRequest)this).FireBeforeRequestEvent(sender, args); }
private void UserAgentRequestEventHandler(object sender, RequestEventArgs args, bool isAsync) { WebServiceRequestEventArgs wsArgs = args as WebServiceRequestEventArgs; if (wsArgs != null) { if (wsArgs.Headers.Keys.Contains(HeaderKeys.UserAgentHeader)) { string currentUserAgent = wsArgs.Headers[HeaderKeys.UserAgentHeader]; wsArgs.Headers[HeaderKeys.UserAgentHeader] = currentUserAgent + " " + this.TableConsumer.ToString() + " " + (isAsync ? "TableAsync" : "TableSync"); } else if(wsArgs.Headers.Keys.Contains(HeaderKeys.XAmzUserAgentHeader)) { string currentUserAgent = wsArgs.Headers[HeaderKeys.XAmzUserAgentHeader]; wsArgs.Headers[HeaderKeys.XAmzUserAgentHeader] = currentUserAgent + " " + this.TableConsumer.ToString() + " " + (isAsync ? "TableAsync" : "TableSync"); } } }
private void UserAgentRequestEventHandler(object sender, RequestEventArgs args) { WebServiceRequestEventArgs wsArgs = args as WebServiceRequestEventArgs; if (wsArgs != null) { string currentUserAgent = wsArgs.Headers[AWSSDKUtils.UserAgentHeader]; wsArgs.Headers[AWSSDKUtils.UserAgentHeader] = currentUserAgent + " SessionStateProvider"; } }
internal void UserAgentRequestEventHandlerSync(object sender, RequestEventArgs args) { WebServiceRequestEventArgs wsArgs = args as WebServiceRequestEventArgs; if (wsArgs != null) { string currentUserAgent = wsArgs.Headers[AWSSDKUtils.UserAgentHeader]; wsArgs.Headers[AWSSDKUtils.UserAgentHeader] = currentUserAgent + " ArchiveTransferManager/" + this.operation; } }
void DynamoDBSessionStateStore_BeforeRequestEvent(object sender, RequestEventArgs e) { Amazon.Runtime.WebServiceRequestEventArgs args = e as Amazon.Runtime.WebServiceRequestEventArgs; if (args == null || !args.Headers.ContainsKey(UserAgentHeader)) return; args.Headers[UserAgentHeader] = args.Headers[UserAgentHeader] + " SessionStateProvider"; }
void BeforeRequestEvents(object sender, RequestEventArgs args) { var webArgs = args as WebServiceRequestEventArgs; if (webArgs != null) { var originalRequest = webArgs.Request; var rsir = originalRequest as RequestSpotInstancesRequest; if (rsir != null) { if (rsir.LaunchSpecification != null && rsir.LaunchSpecification.AllSecurityGroups != null) { int count = 1; foreach (var group in rsir.LaunchSpecification.AllSecurityGroups) { if (group != null && group.GroupId != null) { string key = "LaunchSpecification.SecurityGroupId." + count++; webArgs.Parameters[key] = group.GroupId; } } } var keysToRemove = new List<string>(); foreach (var parameter in webArgs.Parameters.Keys) { if (parameter.StartsWith("LaunchSpecification.GroupSet.", StringComparison.Ordinal)) keysToRemove.Add(parameter); } foreach (var key in keysToRemove) { webArgs.Parameters.Remove(key); } } } }