RMQ - RabbitMQ C++ Library
rmqp_rabbitcontext.h
1// Copyright 2020-2023 Bloomberg Finance L.P.
2// SPDX-License-Identifier: Apache-2.0
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// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#ifndef INCLUDED_RMQP_RABBITCONTEXT
17#define INCLUDED_RMQP_RABBITCONTEXT
18
19#include <rmqp_connection.h>
20
21#include <rmqt_credentials.h>
22#include <rmqt_endpoint.h>
23#include <rmqt_future.h>
24#include <rmqt_vhostinfo.h>
25
26#include <bsl_memory.h>
27#include <bsl_string.h>
28
29namespace BloombergLP {
30namespace rmqp {
31
39
41 public:
43 virtual ~RabbitContext();
44
53 virtual bsl::shared_ptr<Connection> createVHostConnection(
54 const bsl::string& userDefinedName,
55 const bsl::shared_ptr<rmqt::Endpoint>& endpoint,
56 const bsl::shared_ptr<rmqt::Credentials>& credentials) = 0;
57
66 virtual bsl::shared_ptr<Connection>
67 createVHostConnection(const bsl::string& userDefinedName,
68 const rmqt::VHostInfo& endpoint) = 0;
69
70 private:
71 RabbitContext(const RabbitContext&) BSLS_KEYWORD_DELETED;
72 RabbitContext& operator=(const RabbitContext&) BSLS_KEYWORD_DELETED;
73
74}; // class RabbitContext
75
76} // namespace rmqp
77} // namespace BloombergLP
78
79#endif // ! INCLUDED_RMQP_RABBITCONTEXT
Interface for spawning RabbitMQ connections.
Definition: rmqp_rabbitcontext.h:40
virtual bsl::shared_ptr< Connection > createVHostConnection(const bsl::string &userDefinedName, const rmqt::VHostInfo &endpoint)=0
Connect to a RabbitMQ broker.
virtual bsl::shared_ptr< Connection > createVHostConnection(const bsl::string &userDefinedName, const bsl::shared_ptr< rmqt::Endpoint > &endpoint, const bsl::shared_ptr< rmqt::Credentials > &credentials)=0
Connect to a RabbitMQ broker.
Holds the VHost endpoint and credentials, used to connect.
Definition: rmqt_vhostinfo.h:28