Ice 3.9
C++ API Reference
Loading...
Searching...
No Matches
UserAccountMapper.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.9.0-alpha.0
4// <auto-generated>Generated from Slice file 'UserAccountMapper.ice'.</auto-generated>
5// clang-format off
6
7#ifndef IceGrid_UserAccountMapper_h_
8#define IceGrid_UserAccountMapper_h_
9
11#include <Ice/Ice.h>
12#include <IceGrid/Config.h>
13
14#ifndef ICE_DISABLE_VERSION
15# if ICE_INT_VERSION != 30950
16# error Ice version mismatch: an exact match is required for beta generated code
17# endif
18#endif
19
20#ifndef ICEGRID_API
21# if defined(ICEGRID_API_EXPORTS)
22# define ICEGRID_API ICE_DECLSPEC_EXPORT
23# else
24# define ICEGRID_API ICE_DECLSPEC_IMPORT
25# endif
26#endif
27
28// NOLINTBEGIN(modernize-concat-nested-namespaces)
29
30namespace IceGrid
31{
33}
34
35namespace IceGrid
36{
37 /// Maps user strings in server descriptors to actual user account names. You can configure the user account mapper
38 /// of an IceGrid node with the property `IceGrid.Node.UserAccountMapper`.
39 /// @remarks The Slice compiler generated this proxy class from Slice interface `::IceGrid::UserAccountMapper`.
40 /// @headerfile IceGrid/IceGrid.h
41 class ICEGRID_API UserAccountMapperPrx : public Ice::Proxy<UserAccountMapperPrx, Ice::ObjectPrx>
42 {
43 public:
44 /// Constructs a proxy from a Communicator and a proxy string.
45 /// @param communicator The communicator of the new proxy.
46 /// @param proxyString The proxy string to parse.
47 UserAccountMapperPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
48
49 /// Copy constructor. Constructs with a copy of the contents of @p other.
50 /// @param other The proxy to copy from.
51 UserAccountMapperPrx(const UserAccountMapperPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
52
53 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
54 /// @param other The proxy to move from.
55 UserAccountMapperPrx(UserAccountMapperPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
56
57 ~UserAccountMapperPrx() override;
58
59 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
60 /// @param rhs The proxy to copy from.
61 /// @return A reference to this proxy.
63 {
64 if (this != &rhs)
65 {
67 }
68 return *this;
69 }
70
71 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
72 /// @param rhs The proxy to move from.
74 {
75 if (this != &rhs)
76 {
77 Ice::ObjectPrx::operator=(std::move(rhs));
78 }
79 return *this;
80 }
81
82 /// Gets the name of the user account for the given user. This is used by IceGrid nodes to figure out the user
83 /// account to use to run servers.
84 /// @param user The value of the server descriptor's `user` attribute. When this attribute is not defined, and
85 /// the server's activation mode is `session`, the default value for `user` is the session identifier.
86 /// @param context The request context.
87 /// @return The user account name.
88 /// @throws IceGrid::UserAccountNotFoundException Thrown when no user account is found for the given user.
89 std::string getUserAccount(std::string_view user, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
90
91 /// Gets the name of the user account for the given user. This is used by IceGrid nodes to figure out the user
92 /// account to use to run servers.
93 /// @param user The value of the server descriptor's `user` attribute. When this attribute is not defined, and
94 /// the server's activation mode is `session`, the default value for `user` is the session identifier.
95 /// @param context The request context.
96 /// @return A future that becomes available when the invocation completes. This future holds:
97 /// - The user account name.
98 [[nodiscard]] std::future<std::string> getUserAccountAsync(std::string_view user, const Ice::Context& context = Ice::noExplicitContext) const;
99
100 /// Gets the name of the user account for the given user. This is used by IceGrid nodes to figure out the user
101 /// account to use to run servers.
102 /// @param user The value of the server descriptor's `user` attribute. When this attribute is not defined, and
103 /// the server's activation mode is `session`, the default value for `user` is the session identifier.
104 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
105 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
106 /// function. It accepts:
107 /// - The user account name.
108 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
109 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
110 /// function.
111 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
112 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
113 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
114 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
115 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
116 /// asynchronous case.
117 /// @param context The request context.
118 /// @return A function that can be called to cancel the invocation locally.
119 // NOLINTNEXTLINE(modernize-use-nodiscard)
120 std::function<void()> getUserAccountAsync(std::string_view user, std::function<void(std::string)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
121
122 /// @private
123 void _iceI_getUserAccount(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::string>>&, std::string_view, const Ice::Context&) const;
124
125 /// Gets the type ID of the associated Slice interface.
126 /// @return The string `"::IceGrid::UserAccountMapper"`.
127 static const char* ice_staticId() noexcept;
128
129 /// @private
130 static UserAccountMapperPrx _fromReference(IceInternal::ReferencePtr ref) { return UserAccountMapperPrx{std::move(ref)}; }
131
132 protected:
133 /// @private
134 UserAccountMapperPrx() = default;
135
136 /// @private
137 explicit UserAccountMapperPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
138 {
139 }
140 };
141}
142
143namespace IceGrid
144{
145 /// The exception that is thrown when a user account for a given session identifier can't be found.
146 /// @remarks The Slice compiler generated this exception class from Slice exception `::IceGrid::UserAccountNotFoundException`.
147 /// @headerfile IceGrid/IceGrid.h
149 {
150 public:
151 /// Gets the type ID of the associated Slice exception.
152 /// @return The string `"::IceGrid::UserAccountNotFoundException"`.
153 static const char* ice_staticId() noexcept;
154
155 [[nodiscard]] const char* ice_id() const noexcept override;
156
157 void ice_throw() const override;
158
159 protected:
160 /// @private
161 void _writeImpl(Ice::OutputStream*) const override;
162
163 /// @private
164 void _readImpl(Ice::InputStream*) override;
165 };
166}
167
168namespace IceGrid
169{
170 /// Maps user strings in server descriptors to actual user account names. You can configure the user account mapper
171 /// of an IceGrid node with the property `IceGrid.Node.UserAccountMapper`.
172 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceGrid::UserAccountMapper`.
173 /// @headerfile IceGrid/IceGrid.h
174 class ICEGRID_API UserAccountMapper : public virtual Ice::Object
175 {
176 public:
177 /// The associated proxy type.
179
180 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
181 /// @param request The incoming request.
182 /// @param sendResponse The callback to send the response.
183 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
184
185 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
186
187 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
188
189 /// Gets the name of the user account for the given user. This is used by IceGrid nodes to figure out the user
190 /// account to use to run servers.
191 /// @param user The value of the server descriptor's `user` attribute. When this attribute is not defined, and
192 /// the server's activation mode is `session`, the default value for `user` is the session identifier.
193 /// @param current The Current object of the incoming request.
194 /// @return The user account name.
195 /// @throws IceGrid::UserAccountNotFoundException Thrown when no user account is found for the given user.
196 virtual std::string getUserAccount(std::string user, const Ice::Current& current) = 0;
197
198 /// @private
199 void _iceD_getUserAccount(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
200
201 /// Gets the type ID of the associated Slice interface.
202 /// @return The string `"::IceGrid::UserAccountMapper"`.
203 static const char* ice_staticId() noexcept;
204 };
205
206 /// A shared pointer to an UserAccountMapper.
207 using UserAccountMapperPtr = std::shared_ptr<UserAccountMapper>;
208}
209
210namespace IceGrid
211{
212 /// Maps user strings in server descriptors to actual user account names. You can configure the user account mapper
213 /// of an IceGrid node with the property `IceGrid.Node.UserAccountMapper`.
214 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceGrid::UserAccountMapper`.
215 /// @headerfile IceGrid/IceGrid.h
216 class ICEGRID_API AsyncUserAccountMapper : public virtual Ice::Object
217 {
218 public:
219 /// The associated proxy type.
221
222 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
223 /// @param request The incoming request.
224 /// @param sendResponse The callback to send the response.
225 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
226
227 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
228
229 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
230
231 /// Gets the name of the user account for the given user. This is used by IceGrid nodes to figure out the user
232 /// account to use to run servers.
233 /// @param user The value of the server descriptor's `user` attribute. When this attribute is not defined, and
234 /// the server's activation mode is `session`, the default value for `user` is the session identifier.
235 /// @param response The response callback. It accepts:
236 /// - The user account name.
237 /// @param exception The exception callback.
238 /// @param current The Current object of the incoming request.
239 /// @throws IceGrid::UserAccountNotFoundException Thrown when no user account is found for the given user.
240 virtual void getUserAccountAsync(std::string user, std::function<void(std::string_view returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
241
242 /// @private
243 void _iceD_getUserAccount(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
244
245 /// Gets the type ID of the associated Slice interface.
246 /// @return The string `"::IceGrid::UserAccountMapper"`.
247 static const char* ice_staticId() noexcept;
248 };
249
250 /// A shared pointer to an AsyncUserAccountMapper.
252}
253
254// NOLINTEND(modernize-concat-nested-namespaces)
255
256#include <Ice/PopDisableWarnings.h>
257#endif
void dispatch(Ice::IncomingRequest &request, std::function< void(Ice::OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
UserAccountMapperPrx ProxyType
The associated proxy type.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
std::vector< std::string > ice_ids(const Ice::Current &current) const override
Gets the Slice interfaces supported by this object as a list of Slice type IDs.
virtual void getUserAccountAsync(std::string user, std::function< void(std::string_view returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Gets the name of the user account for the given user.
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
Maps user strings in server descriptors to actual user account names.
std::future< std::string > getUserAccountAsync(std::string_view user, const Ice::Context &context=Ice::noExplicitContext) const
Gets the name of the user account for the given user.
std::function< void()> getUserAccountAsync(std::string_view user, std::function< void(std::string)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets the name of the user account for the given user.
UserAccountMapperPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
UserAccountMapperPrx(const UserAccountMapperPrx &other) noexcept
Copy constructor.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
UserAccountMapperPrx & operator=(const UserAccountMapperPrx &rhs) noexcept
Copy assignment operator.
std::string getUserAccount(std::string_view user, const Ice::Context &context=Ice::noExplicitContext) const
Gets the name of the user account for the given user.
UserAccountMapperPrx & operator=(UserAccountMapperPrx &&rhs) noexcept
Move assignment operator.
UserAccountMapperPrx(UserAccountMapperPrx &&other) noexcept
Move constructor.
Maps user strings in server descriptors to actual user account names.
std::vector< std::string > ice_ids(const Ice::Current &current) const override
Gets the Slice interfaces supported by this object as a list of Slice type IDs.
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
UserAccountMapperPrx ProxyType
The associated proxy type.
virtual std::string getUserAccount(std::string user, const Ice::Current &current)=0
Gets the name of the user account for the given user.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
void dispatch(Ice::IncomingRequest &request, std::function< void(Ice::OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
Maps user strings in server descriptors to actual user account names.
const char * ice_id() const noexcept override
Returns the type ID of this exception.
void ice_throw() const override
Throws this exception.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
The exception that is thrown when a user account for a given session identifier can't be found.
Represents a request received by a connection.
ObjectPrx & operator=(const ObjectPrx &rhs) noexcept=default
Copy assignment operator.
The base class for all Ice proxies.
Definition Proxy.h:265
The base class for servants.
Definition Object.h:21
Represents the response to an incoming request.
Provides typed proxy functions.
Definition Proxy.h:48
Abstract base class for all exceptions defined in Slice.
std::shared_ptr< UserAccountMapper > UserAccountMapperPtr
A shared pointer to an UserAccountMapper.
std::shared_ptr< AsyncUserAccountMapper > AsyncUserAccountMapperPtr
A shared pointer to an AsyncUserAccountMapper.
Deploy and manage Ice servers.
Definition Admin.h:34
std::shared_ptr< Communicator > CommunicatorPtr
A shared pointer to a Communicator.
const Context noExplicitContext
Marker value used to indicate that no explicit request context was passed to a proxy invocation.
std::map< std::string, std::string, std::less<> > Context
Represents additional information carried by an Ice request.
Definition Context.h:28
The Ice RPC framework.
Definition SampleEvent.h:60
Provides information about an incoming request being dispatched.
Definition Current.h:18