private CreateBucketCommand(IServiceClient client, Uri endpoint, ExecutionContext context, string bucketName) : base(client, endpoint, context) { OssUtils.CheckBucketName(bucketName); _bucketName = bucketName; }
public ServiceResponse Send(ServiceRequest request, ExecutionContext context) { SignRequest(request, context); var response = SendCore(request, context); HandleResponse(response, context.ResponseHandlers); return response; }
private AbortMultipartUploadCommand(IServiceClient client, Uri endpoint, ExecutionContext context, AbortMultipartUploadRequest abortMultipartUploadRequest) : base(client, endpoint, context) { _abortMultipartUploadRequest = abortMultipartUploadRequest; }
private SetObjectAclCommand(IServiceClient client, Uri endpoint, ExecutionContext context, SetObjectAclRequest request) : base(client, endpoint, context) { _request = request; }
public static SetObjectAclCommand Create(IServiceClient client, Uri endpoint, ExecutionContext context, SetObjectAclRequest request) { OssUtils.CheckBucketName(request.BucketName); OssUtils.CheckObjectKey(request.Key); return new SetObjectAclCommand(client, endpoint, context, request); }
private SetBucketAclCommand(IServiceClient client, Uri endpoint, ExecutionContext context, string bucketName, SetBucketAclRequest request) : base(client, endpoint, context) { OssUtils.CheckBucketName(bucketName); _bucketName = bucketName; _request = request; }
private DeleteObjectCommand(IServiceClient client, Uri endpoint, ExecutionContext context, string bucketName, string key) : base(client, endpoint, context) { OssUtils.CheckBucketName(bucketName); OssUtils.CheckObjectKey(key); _bucketName = bucketName; _key = key; }
public static AbortMultipartUploadCommand Create(IServiceClient client, Uri endpoint, ExecutionContext context, AbortMultipartUploadRequest abortMultipartUploadRequest) { OssUtils.CheckBucketName(abortMultipartUploadRequest.BucketName); OssUtils.CheckObjectKey(abortMultipartUploadRequest.Key); if (string.IsNullOrEmpty(abortMultipartUploadRequest.UploadId)) throw new ArgumentException(Resources.ExceptionIfArgumentStringIsNullOrEmpty, "uploadId"); return new AbortMultipartUploadCommand(client, endpoint, context, abortMultipartUploadRequest); }
private SetBucketLoggingCommand(IServiceClient client, Uri endpoint, ExecutionContext context, string bucketName, SetBucketLoggingRequest setBucketLoggingRequest) : base(client, endpoint, context) { OssUtils.CheckBucketName(setBucketLoggingRequest.BucketName); OssUtils.CheckBucketName(setBucketLoggingRequest.TargetBucket); if (!OssUtils.IsLoggingPrefixValid(setBucketLoggingRequest.TargetPrefix)) throw new ArgumentException("Invalid logging prefix " + setBucketLoggingRequest.TargetPrefix); _bucketName = bucketName; _setBucketLoggingRequest = setBucketLoggingRequest; }
public ExecutionContext Build() { var context = new ExecutionContext { Signer = CreateSigner(Bucket, Key), Credentials = Credentials }; foreach(var h in ResponseHandlers) { context.ResponseHandlers.Add(h); } return context; }
private SetBucketWebsiteCommand(IServiceClient client, Uri endpoint, ExecutionContext context, string bucketName, SetBucketWebsiteRequest setBucketWebsiteRequest) : base(client, endpoint, context) { OssUtils.CheckBucketName(bucketName); if (string.IsNullOrEmpty(setBucketWebsiteRequest.IndexDocument)) throw new ArgumentException("index document must not be empty"); if (!OssUtils.IsWebpageValid(setBucketWebsiteRequest.IndexDocument)) throw new ArgumentException("Invalid index document, must be end with .html"); if (!string.IsNullOrEmpty(setBucketWebsiteRequest.ErrorDocument) && !OssUtils.IsWebpageValid(setBucketWebsiteRequest.ErrorDocument)) throw new ArgumentException("Invalid error document, must be end with .html"); _bucketName = bucketName; _setBucketWebsiteRequest = setBucketWebsiteRequest; }
public static DeleteObjectCommand Create(IServiceClient client, Uri endpoint, ExecutionContext context, string bucketName, string key) { return new DeleteObjectCommand(client, endpoint, context, bucketName, key); }
protected abstract IAsyncResult BeginSendCore(ServiceRequest request, ExecutionContext context, AsyncCallback callback, Object state);
public IAsyncResult BeginSend(ServiceRequest request, ExecutionContext context, AsyncCallback callback, object state) { SignRequest(request, context); return BeginSendCore(request, context, callback, state); }
protected OssCommand(IServiceClient client, Uri endpoint, ExecutionContext context) { Client = client; Endpoint = endpoint; Context = context; }
protected abstract ServiceResponse SendCore(ServiceRequest request, ExecutionContext context);
public static SetBucketAclCommand Create(IServiceClient client, Uri endpoint, ExecutionContext context, string bucketName, SetBucketAclRequest request) { return new SetBucketAclCommand(client, endpoint, context, bucketName, request); }
private static void SignRequest(ServiceRequest request, ExecutionContext context) { if (context.Signer != null) context.Signer.Sign(request, context.Credentials); }
public static CreateBucketCommand Create(IServiceClient client, Uri endpoint, ExecutionContext context, string bucketName) { return new CreateBucketCommand(client, endpoint, context, bucketName); }
public ServiceResponse Send(ServiceRequest request, ExecutionContext context) { return(SendImpl(request, context, 0)); }