AWS SDK for C++  0.12.9
AWS SDK for C++
SimpleDBClient.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 #pragma once
17 #include <aws/sdb/SimpleDBErrors.h>
27 #include <aws/core/NoResult.h>
30 #include <future>
31 #include <functional>
32 
33 namespace Aws
34 {
35 
36 namespace Http
37 {
38  class HttpClient;
39  class HttpClientFactory;
40 } // namespace Http
41 
42 namespace Utils
43 {
44  template< typename R, typename E> class Outcome;
45 
46 namespace Threading
47 {
48  class Executor;
49 } // namespace Threading
50 
51 namespace Xml
52 {
53  class XmlDocument;
54 } // namespace Xml
55 } // namespace Utils
56 
57 namespace Auth
58 {
59  class AWSCredentials;
60  class AWSCredentialsProvider;
61 } // namespace Auth
62 
63 namespace Client
64 {
65  class RetryStrategy;
66 } // namespace Client
67 
68 namespace SimpleDB
69 {
70 
71 namespace Model
72 {
73  class BatchDeleteAttributesRequest;
74  class BatchPutAttributesRequest;
75  class CreateDomainRequest;
76  class DeleteAttributesRequest;
77  class DeleteDomainRequest;
78  class DomainMetadataRequest;
79  class GetAttributesRequest;
80  class ListDomainsRequest;
81  class PutAttributesRequest;
83 
94 
95  typedef std::future<BatchDeleteAttributesOutcome> BatchDeleteAttributesOutcomeCallable;
96  typedef std::future<BatchPutAttributesOutcome> BatchPutAttributesOutcomeCallable;
97  typedef std::future<CreateDomainOutcome> CreateDomainOutcomeCallable;
98  typedef std::future<DeleteAttributesOutcome> DeleteAttributesOutcomeCallable;
99  typedef std::future<DeleteDomainOutcome> DeleteDomainOutcomeCallable;
100  typedef std::future<DomainMetadataOutcome> DomainMetadataOutcomeCallable;
101  typedef std::future<GetAttributesOutcome> GetAttributesOutcomeCallable;
102  typedef std::future<ListDomainsOutcome> ListDomainsOutcomeCallable;
103  typedef std::future<PutAttributesOutcome> PutAttributesOutcomeCallable;
104  typedef std::future<SelectOutcome> SelectOutcomeCallable;
105 } // namespace Model
106 
108 
109  typedef std::function<void(const SimpleDBClient*, const Model::BatchDeleteAttributesRequest&, const Model::BatchDeleteAttributesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > BatchDeleteAttributesResponseReceivedHandler;
110  typedef std::function<void(const SimpleDBClient*, const Model::BatchPutAttributesRequest&, const Model::BatchPutAttributesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > BatchPutAttributesResponseReceivedHandler;
111  typedef std::function<void(const SimpleDBClient*, const Model::CreateDomainRequest&, const Model::CreateDomainOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateDomainResponseReceivedHandler;
112  typedef std::function<void(const SimpleDBClient*, const Model::DeleteAttributesRequest&, const Model::DeleteAttributesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteAttributesResponseReceivedHandler;
113  typedef std::function<void(const SimpleDBClient*, const Model::DeleteDomainRequest&, const Model::DeleteDomainOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteDomainResponseReceivedHandler;
114  typedef std::function<void(const SimpleDBClient*, const Model::DomainMetadataRequest&, const Model::DomainMetadataOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DomainMetadataResponseReceivedHandler;
115  typedef std::function<void(const SimpleDBClient*, const Model::GetAttributesRequest&, const Model::GetAttributesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetAttributesResponseReceivedHandler;
116  typedef std::function<void(const SimpleDBClient*, const Model::ListDomainsRequest&, const Model::ListDomainsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListDomainsResponseReceivedHandler;
117  typedef std::function<void(const SimpleDBClient*, const Model::PutAttributesRequest&, const Model::PutAttributesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutAttributesResponseReceivedHandler;
118  typedef std::function<void(const SimpleDBClient*, const Model::SelectRequest&, const Model::SelectOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > SelectResponseReceivedHandler;
119 
137  {
138  public:
140 
146 
151  SimpleDBClient(const Auth::AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
152 
157  SimpleDBClient(const std::shared_ptr<Auth::AWSCredentialsProvider>& credentialsProvider,
158  const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
159 
160  virtual ~SimpleDBClient();
161 
169  virtual Model::BatchDeleteAttributesOutcome BatchDeleteAttributes(const Model::BatchDeleteAttributesRequest& request) const;
170 
180  virtual Model::BatchDeleteAttributesOutcomeCallable BatchDeleteAttributesCallable(const Model::BatchDeleteAttributesRequest& request) const;
181 
191  virtual void BatchDeleteAttributesAsync(const Model::BatchDeleteAttributesRequest& request, const BatchDeleteAttributesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
192 
233  virtual Model::BatchPutAttributesOutcome BatchPutAttributes(const Model::BatchPutAttributesRequest& request) const;
234 
277  virtual Model::BatchPutAttributesOutcomeCallable BatchPutAttributesCallable(const Model::BatchPutAttributesRequest& request) const;
278 
321  virtual void BatchPutAttributesAsync(const Model::BatchPutAttributesRequest& request, const BatchPutAttributesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
322 
332  virtual Model::CreateDomainOutcome CreateDomain(const Model::CreateDomainRequest& request) const;
333 
345  virtual Model::CreateDomainOutcomeCallable CreateDomainCallable(const Model::CreateDomainRequest& request) const;
346 
358  virtual void CreateDomainAsync(const Model::CreateDomainRequest& request, const CreateDomainResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
359 
371  virtual Model::DeleteAttributesOutcome DeleteAttributes(const Model::DeleteAttributesRequest& request) const;
372 
386  virtual Model::DeleteAttributesOutcomeCallable DeleteAttributesCallable(const Model::DeleteAttributesRequest& request) const;
387 
401  virtual void DeleteAttributesAsync(const Model::DeleteAttributesRequest& request, const DeleteAttributesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
402 
409  virtual Model::DeleteDomainOutcome DeleteDomain(const Model::DeleteDomainRequest& request) const;
410 
419  virtual Model::DeleteDomainOutcomeCallable DeleteDomainCallable(const Model::DeleteDomainRequest& request) const;
420 
429  virtual void DeleteDomainAsync(const Model::DeleteDomainRequest& request, const DeleteDomainResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
430 
436  virtual Model::DomainMetadataOutcome DomainMetadata(const Model::DomainMetadataRequest& request) const;
437 
445  virtual Model::DomainMetadataOutcomeCallable DomainMetadataCallable(const Model::DomainMetadataRequest& request) const;
446 
454  virtual void DomainMetadataAsync(const Model::DomainMetadataRequest& request, const DomainMetadataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
455 
464  virtual Model::GetAttributesOutcome GetAttributes(const Model::GetAttributesRequest& request) const;
465 
476  virtual Model::GetAttributesOutcomeCallable GetAttributesCallable(const Model::GetAttributesRequest& request) const;
477 
488  virtual void GetAttributesAsync(const Model::GetAttributesRequest& request, const GetAttributesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
489 
500  virtual Model::ListDomainsOutcome ListDomains(const Model::ListDomainsRequest& request) const;
501 
514  virtual Model::ListDomainsOutcomeCallable ListDomainsCallable(const Model::ListDomainsRequest& request) const;
515 
528  virtual void ListDomainsAsync(const Model::ListDomainsRequest& request, const ListDomainsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
529 
561  virtual Model::PutAttributesOutcome PutAttributes(const Model::PutAttributesRequest& request) const;
562 
596  virtual Model::PutAttributesOutcomeCallable PutAttributesCallable(const Model::PutAttributesRequest& request) const;
597 
631  virtual void PutAttributesAsync(const Model::PutAttributesRequest& request, const PutAttributesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
632 
645  virtual Model::SelectOutcome Select(const Model::SelectRequest& request) const;
646 
661  virtual Model::SelectOutcomeCallable SelectCallable(const Model::SelectRequest& request) const;
662 
677  virtual void SelectAsync(const Model::SelectRequest& request, const SelectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
678 
679 
680  private:
681  void init(const Client::ClientConfiguration& clientConfiguration);
682 
684  void BatchDeleteAttributesAsyncHelper(const Model::BatchDeleteAttributesRequest& request, const BatchDeleteAttributesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
685  void BatchPutAttributesAsyncHelper(const Model::BatchPutAttributesRequest& request, const BatchPutAttributesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
686  void CreateDomainAsyncHelper(const Model::CreateDomainRequest& request, const CreateDomainResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
687  void DeleteAttributesAsyncHelper(const Model::DeleteAttributesRequest& request, const DeleteAttributesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
688  void DeleteDomainAsyncHelper(const Model::DeleteDomainRequest& request, const DeleteDomainResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
689  void DomainMetadataAsyncHelper(const Model::DomainMetadataRequest& request, const DomainMetadataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
690  void GetAttributesAsyncHelper(const Model::GetAttributesRequest& request, const GetAttributesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
691  void ListDomainsAsyncHelper(const Model::ListDomainsRequest& request, const ListDomainsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
692  void PutAttributesAsyncHelper(const Model::PutAttributesRequest& request, const PutAttributesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
693  void SelectAsyncHelper(const Model::SelectRequest& request, const SelectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
694 
695  Aws::String m_uri;
696  std::shared_ptr<Utils::Threading::Executor> m_executor;
697  };
698 
699 } // namespace SimpleDB
700 } // namespace Aws
std::function< void(const SimpleDBClient *, const Model::DomainMetadataRequest &, const Model::DomainMetadataOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DomainMetadataResponseReceivedHandler
std::future< DeleteAttributesOutcome > DeleteAttributesOutcomeCallable
std::function< void(const SimpleDBClient *, const Model::SelectRequest &, const Model::SelectOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > SelectResponseReceivedHandler
Aws::Utils::Outcome< NoResult, Aws::Client::AWSError< SimpleDBErrors > > PutAttributesOutcome
std::future< DeleteDomainOutcome > DeleteDomainOutcomeCallable
Aws::Utils::Outcome< NoResult, Aws::Client::AWSError< SimpleDBErrors > > DeleteDomainOutcome
Aws::Utils::Outcome< NoResult, Aws::Client::AWSError< SimpleDBErrors > > DeleteAttributesOutcome
Aws::Utils::Outcome< NoResult, Aws::Client::AWSError< SimpleDBErrors > > CreateDomainOutcome
Aws::Utils::Outcome< DomainMetadataResult, Aws::Client::AWSError< SimpleDBErrors > > DomainMetadataOutcome
std::function< void(const SimpleDBClient *, const Model::DeleteDomainRequest &, const Model::DeleteDomainOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DeleteDomainResponseReceivedHandler
Aws::Utils::Outcome< NoResult, Aws::Client::AWSError< SimpleDBErrors > > BatchPutAttributesOutcome
std::function< void(const SimpleDBClient *, const Model::DeleteAttributesRequest &, const Model::DeleteAttributesOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DeleteAttributesResponseReceivedHandler
std::future< GetAttributesOutcome > GetAttributesOutcomeCallable
std::function< void(const SimpleDBClient *, const Model::ListDomainsRequest &, const Model::ListDomainsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > ListDomainsResponseReceivedHandler
Aws::Client::AWSXMLClient BASECLASS
std::function< void(const SimpleDBClient *, const Model::PutAttributesRequest &, const Model::PutAttributesOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > PutAttributesResponseReceivedHandler
Aws::Utils::Outcome< SelectResult, Aws::Client::AWSError< SimpleDBErrors > > SelectOutcome
std::future< CreateDomainOutcome > CreateDomainOutcomeCallable
#define AWS_SIMPLEDB_API
std::future< ListDomainsOutcome > ListDomainsOutcomeCallable
std::function< void(const SimpleDBClient *, const Model::BatchDeleteAttributesRequest &, const Model::BatchDeleteAttributesOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > BatchDeleteAttributesResponseReceivedHandler
Aws::Utils::Outcome< NoResult, Aws::Client::AWSError< SimpleDBErrors > > BatchDeleteAttributesOutcome
Aws::Utils::Outcome< ListDomainsResult, Aws::Client::AWSError< SimpleDBErrors > > ListDomainsOutcome
std::function< void(const SimpleDBClient *, const Model::BatchPutAttributesRequest &, const Model::BatchPutAttributesOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > BatchPutAttributesResponseReceivedHandler
std::future< PutAttributesOutcome > PutAttributesOutcomeCallable
std::future< SelectOutcome > SelectOutcomeCallable
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
std::future< BatchDeleteAttributesOutcome > BatchDeleteAttributesOutcomeCallable
Aws::Utils::Outcome< GetAttributesResult, Aws::Client::AWSError< SimpleDBErrors > > GetAttributesOutcome
std::future< BatchPutAttributesOutcome > BatchPutAttributesOutcomeCallable
std::function< void(const SimpleDBClient *, const Model::CreateDomainRequest &, const Model::CreateDomainOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > CreateDomainResponseReceivedHandler
std::future< DomainMetadataOutcome > DomainMetadataOutcomeCallable
std::function< void(const SimpleDBClient *, const Model::GetAttributesRequest &, const Model::GetAttributesOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > GetAttributesResponseReceivedHandler
JSON (JavaScript Object Notation).