コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// This is likely to be similar to "https://{account_name}.queue.core.windows.net".
 /// </param>
 /// <param name="authentication">
 /// An optional authentication policy used to sign requests.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 internal QueueServiceClient(Uri serviceUri, HttpPipelinePolicy authentication, QueueClientOptions options)
 {
     _uri = serviceUri;
     options ??= new QueueClientOptions();
     _pipeline             = options.Build(authentication);
     _version              = options.Version;
     _clientDiagnostics    = new ClientDiagnostics(options);
     _clientSideEncryption = QueueClientSideEncryptionOptions.CloneFrom(options._clientSideEncryptionOptions);
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueServiceClient"/>
        /// class.
        /// </summary>
        /// <param name="connectionString">
        /// A connection string includes the authentication information
        /// required for your application to access data in an Azure Storage
        /// account at runtime.
        ///
        /// For more information, see
        /// <see href="https://docs.microsoft.com/azure/storage/common/storage-configure-connection-string">
        /// Configure Azure Storage connection strings</see>.
        /// </param>
        /// <param name="options">
        /// Optional client options that define the transport pipeline
        /// policies for authentication, retries, etc., that are applied to
        /// every request.
        /// </param>
        public QueueServiceClient(string connectionString, QueueClientOptions options)
        {
            var conn = StorageConnectionString.Parse(connectionString);

            _uri = conn.QueueEndpoint;
            options ??= new QueueClientOptions();
            _pipeline             = options.Build(conn.Credentials);
            _version              = options.Version;
            _clientDiagnostics    = new ClientDiagnostics(options);
            _clientSideEncryption = QueueClientSideEncryptionOptions.CloneFrom(options._clientSideEncryptionOptions);
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// This is likely to be similar to "https://{account_name}.queue.core.windows.net".
 /// </param>
 /// <param name="authentication">
 /// An optional authentication policy used to sign requests.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 /// <param name="storageSharedKeyCredential">
 /// The shared key credential used to sign requests.
 /// </param>
 internal QueueServiceClient(
     Uri serviceUri,
     HttpPipelinePolicy authentication,
     QueueClientOptions options,
     StorageSharedKeyCredential storageSharedKeyCredential)
 {
     _uri = serviceUri;
     options ??= new QueueClientOptions();
     _pipeline                   = options.Build(authentication);
     _version                    = options.Version;
     _clientDiagnostics          = new ClientDiagnostics(options);
     _clientSideEncryption       = QueueClientSideEncryptionOptions.CloneFrom(options._clientSideEncryptionOptions);
     _storageSharedKeyCredential = storageSharedKeyCredential;
     _messageEncoding            = options.MessageEncoding;
 }
コード例 #4
0
 public QueueClientConfiguration(
     HttpPipeline pipeline,
     StorageSharedKeyCredential sharedKeyCredential,
     ClientDiagnostics clientDiagnostics,
     QueueClientOptions.ServiceVersion version,
     QueueClientSideEncryptionOptions clientSideEncryption,
     QueueMessageEncoding messageEncoding,
     SyncAsyncEventHandler <QueueMessageDecodingFailedEventArgs> queueMessageDecodingFailedHandlers)
     : base(pipeline, sharedKeyCredential, clientDiagnostics)
 {
     Version = version;
     ClientSideEncryption = clientSideEncryption;
     MessageEncoding      = messageEncoding;
     QueueMessageDecodingFailedHandlers = queueMessageDecodingFailedHandlers;
 }
コード例 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueServiceClient"/>
        /// class.
        /// </summary>
        /// <param name="connectionString">
        /// A connection string includes the authentication information
        /// required for your application to access data in an Azure Storage
        /// account at runtime.
        ///
        /// For more information, see
        /// <see href="https://docs.microsoft.com/azure/storage/common/storage-configure-connection-string">
        /// Configure Azure Storage connection strings</see>.
        /// </param>
        /// <param name="options">
        /// Optional client options that define the transport pipeline
        /// policies for authentication, retries, etc., that are applied to
        /// every request.
        /// </param>
        public QueueServiceClient(string connectionString, QueueClientOptions options)
        {
            var conn = StorageConnectionString.Parse(connectionString);

            _uri = conn.QueueEndpoint;
            options ??= new QueueClientOptions();
            _clientConfiguration = new QueueClientConfiguration(
                pipeline: options.Build(conn.Credentials),
                sharedKeyCredential: conn.Credentials as StorageSharedKeyCredential,
                clientDiagnostics: new StorageClientDiagnostics(options),
                version: options.Version,
                clientSideEncryption: QueueClientSideEncryptionOptions.CloneFrom(options._clientSideEncryptionOptions),
                messageEncoding: options.MessageEncoding,
                queueMessageDecodingFailedHandlers: options.GetMessageDecodingFailedHandlers());

            _serviceRestClient = BuildServiceRestClient();
        }
コード例 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueServiceClient"/>
        /// class.
        /// </summary>
        /// <param name="serviceUri">
        /// A <see cref="Uri"/> referencing the queue service.
        /// This is likely to be similar to "https://{account_name}.queue.core.windows.net".
        /// </param>
        /// <param name="authentication">
        /// An optional authentication policy used to sign requests.
        /// </param>
        /// <param name="options">
        /// Optional client options that define the transport pipeline
        /// policies for authentication, retries, etc., that are applied to
        /// every request.
        /// </param>
        /// <param name="storageSharedKeyCredential">
        /// The shared key credential used to sign requests.
        /// </param>
        internal QueueServiceClient(
            Uri serviceUri,
            HttpPipelinePolicy authentication,
            QueueClientOptions options,
            StorageSharedKeyCredential storageSharedKeyCredential)
        {
            Argument.AssertNotNull(serviceUri, nameof(serviceUri));
            _uri = serviceUri;
            options ??= new QueueClientOptions();

            _clientConfiguration = new QueueClientConfiguration(
                pipeline: options.Build(authentication),
                sharedKeyCredential: storageSharedKeyCredential,
                clientDiagnostics: new StorageClientDiagnostics(options),
                version: options.Version,
                clientSideEncryption: QueueClientSideEncryptionOptions.CloneFrom(options._clientSideEncryptionOptions),
                messageEncoding: options.MessageEncoding,
                queueMessageDecodingFailedHandlers: options.GetMessageDecodingFailedHandlers());

            _serviceRestClient = BuildServiceRestClient();
        }
コード例 #7
0
 public QueueClientSideDecryptor(QueueClientSideEncryptionOptions options)
 {
     _decryptor = new ClientSideDecryptor(options);
     Options    = options;
 }