Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
UserAccountMapper.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.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 != 30850
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 /// @headerfile IceGrid/IceGrid.h
40 class ICEGRID_API UserAccountMapperPrx : public Ice::Proxy<UserAccountMapperPrx, Ice::ObjectPrx>
41 {
42 public:
43 /// Constructs a proxy from a Communicator and a proxy string.
44 /// @param communicator The communicator of the new proxy.
45 /// @param proxyString The proxy string to parse.
46 UserAccountMapperPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
47
48 /// Copy constructor. Constructs with a copy of the contents of @p other.
49 /// @param other The proxy to copy from.
50 UserAccountMapperPrx(const UserAccountMapperPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
51
52 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
53 /// @param other The proxy to move from.
54 UserAccountMapperPrx(UserAccountMapperPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
55
56 ~UserAccountMapperPrx() override;
57
58 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
59 /// @param rhs The proxy to copy from.
60 /// @return A reference to this proxy.
62 {
63 if (this != &rhs)
64 {
66 }
67 return *this;
68 }
69
70 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
71 /// @param rhs The proxy to move from.
73 {
74 if (this != &rhs)
75 {
76 Ice::ObjectPrx::operator=(std::move(rhs));
77 }
78 return *this;
79 }
80
81 /// Gets the name of the user account for the given user. This is used by IceGrid nodes to figure out the user
82 /// account to use to run servers.
83 /// @param user The value of the server descriptor's `user` attribute. When this attribute is not defined, and
84 /// the server's activation mode is `session`, the default value for `user` is the session identifier.
85 /// @param context The request context.
86 /// @return The user account name.
87 /// @throws IceGrid::UserAccountNotFoundException Thrown when no user account is found for the given user.
88 std::string getUserAccount(std::string_view user, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
89
90 /// Gets the name of the user account for the given user. This is used by IceGrid nodes to figure out the user
91 /// account to use to run servers.
92 /// @param user The value of the server descriptor's `user` attribute. When this attribute is not defined, and
93 /// the server's activation mode is `session`, the default value for `user` is the session identifier.
94 /// @param context The request context.
95 /// @return A future that becomes available when the invocation completes. This future holds:
96 /// - The user account name.
97 [[nodiscard]] std::future<std::string> getUserAccountAsync(std::string_view user, const Ice::Context& context = Ice::noExplicitContext) const;
98
99 /// Gets the name of the user account for the given user. This is used by IceGrid nodes to figure out the user
100 /// account to use to run servers.
101 /// @param user The value of the server descriptor's `user` attribute. When this attribute is not defined, and
102 /// the server's activation mode is `session`, the default value for `user` is the session identifier.
103 /// @param response The response callback. It accepts:
104 /// - The user account name.
105 /// @param exception The exception callback.
106 /// @param sent The sent callback.
107 /// @param context The request context.
108 /// @return A function that can be called to cancel the invocation locally.
109 // NOLINTNEXTLINE(modernize-use-nodiscard)
110 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;
111
112 /// @private
113 void _iceI_getUserAccount(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::string>>&, std::string_view, const Ice::Context&) const;
114
115 /// Gets the type ID of the associated Slice interface.
116 /// @return The string `"::IceGrid::UserAccountMapper"`.
117 static const char* ice_staticId() noexcept;
118
119 /// @private
120 static UserAccountMapperPrx _fromReference(IceInternal::ReferencePtr ref) { return UserAccountMapperPrx{std::move(ref)}; }
121
122 protected:
123 /// @private
124 UserAccountMapperPrx() = default;
125
126 /// @private
127 explicit UserAccountMapperPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
128 {
129 }
130 };
131}
132
133namespace IceGrid
134{
135 /// The exception that is thrown when a user account for a given session identifier can't be found.
136 /// @headerfile IceGrid/IceGrid.h
138 {
139 public:
140 /// Gets the type ID of the associated Slice exception.
141 /// @return The string `"::IceGrid::UserAccountNotFoundException"`.
142 static const char* ice_staticId() noexcept;
143
144 [[nodiscard]] const char* ice_id() const noexcept override;
145
146 void ice_throw() const override;
147
148 protected:
149 /// @private
150 void _writeImpl(Ice::OutputStream*) const override;
151
152 /// @private
153 void _readImpl(Ice::InputStream*) override;
154 };
155}
156
157namespace IceGrid
158{
159 /// Maps user strings in server descriptors to actual user account names. You can configure the user account mapper
160 /// of an IceGrid node with the property `IceGrid.Node.UserAccountMapper`.
161 /// @headerfile IceGrid/IceGrid.h
162 class ICEGRID_API UserAccountMapper : public virtual Ice::Object
163 {
164 public:
165 /// The associated proxy type.
167
168 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
169 /// @param request The incoming request.
170 /// @param sendResponse The callback to send the response.
171 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
172
173 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
174
175 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
176
177 /// Gets the name of the user account for the given user. This is used by IceGrid nodes to figure out the user
178 /// account to use to run servers.
179 /// @param user The value of the server descriptor's `user` attribute. When this attribute is not defined, and
180 /// the server's activation mode is `session`, the default value for `user` is the session identifier.
181 /// @param current The Current object of the incoming request.
182 /// @return The user account name.
183 /// @throws IceGrid::UserAccountNotFoundException Thrown when no user account is found for the given user.
184 virtual std::string getUserAccount(std::string user, const Ice::Current& current) = 0;
185
186 /// @private
187 void _iceD_getUserAccount(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
188
189 /// Gets the type ID of the associated Slice interface.
190 /// @return The string `"::IceGrid::UserAccountMapper"`.
191 static const char* ice_staticId() noexcept;
192 };
193
194 /// A shared pointer to an UserAccountMapper.
195 using UserAccountMapperPtr = std::shared_ptr<UserAccountMapper>;
196}
197
198// NOLINTEND(modernize-concat-nested-namespaces)
199
200#include <Ice/PopDisableWarnings.h>
201#endif
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 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:232
The base class for servants.
Definition Object.h:21
Represents the response to an incoming request.
Provides typed proxy functions.
Definition Proxy.h:45
Abstract base class for all Ice exceptions defined in Slice.
std::shared_ptr< UserAccountMapper > UserAccountMapperPtr
A shared pointer to an UserAccountMapper.
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:59
Provides information about an incoming request being dispatched.
Definition Current.h:18