Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
Router.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.3
4// <auto-generated>Generated from Slice file 'Router.ice'.</auto-generated>
5// clang-format off
6
7#ifndef Glacier2_Router_h_
8#define Glacier2_Router_h_
9
11#include <Ice/Ice.h>
12#include <Ice/Router.h>
13#include "PermissionsVerifier.h"
14#include "Session.h"
15#include <Glacier2/Config.h>
16
17#ifndef ICE_DISABLE_VERSION
18# if ICE_INT_VERSION / 100 != 308
19# error Ice version mismatch!
20# endif
21# if ICE_INT_VERSION % 100 >= 50
22# error Beta header file detected
23# endif
24# if ICE_INT_VERSION % 100 < 3
25# error Ice patch level mismatch!
26# endif
27#endif
28
29#ifndef GLACIER2_API
30# if defined(GLACIER2_API_EXPORTS)
31# define GLACIER2_API ICE_DECLSPEC_EXPORT
32# else
33# define GLACIER2_API ICE_DECLSPEC_IMPORT
34# endif
35#endif
36
37// NOLINTBEGIN(modernize-concat-nested-namespaces)
38
39/// Communicate through firewalls and across NATs.
40namespace Glacier2
41{
42 class RouterPrx;
43}
44
45namespace Glacier2
46{
47 /// The Glacier2 specialization of the ::Ice::RouterPrx interface.
48 /// @remarks The Slice compiler generated this proxy class from Slice interface `::Glacier2::Router`.
49 /// @headerfile Glacier2/Glacier2.h
50 class GLACIER2_API RouterPrx : public Ice::Proxy<RouterPrx, ::Ice::RouterPrx>
51 {
52 public:
53#if defined(__GNUC__) && !defined(__clang__)
54# pragma GCC diagnostic push
55# pragma GCC diagnostic ignored "-Wextra" // initialize all virtual bases in correct order
56#endif
57
58 /// Constructs a proxy from a Communicator and a proxy string.
59 /// @param communicator The communicator of the new proxy.
60 /// @param proxyString The proxy string to parse.
61 RouterPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
62
63 /// Copy constructor. Constructs with a copy of the contents of @p other.
64 /// @param other The proxy to copy from.
65 RouterPrx(const RouterPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
66
67 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
68 /// @param other The proxy to move from.
69 RouterPrx(RouterPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
70
71 ~RouterPrx() override;
72
73 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
74 /// @param rhs The proxy to copy from.
75 /// @return A reference to this proxy.
76 RouterPrx& operator=(const RouterPrx& rhs) noexcept
77 {
78 if (this != &rhs)
79 {
81 }
82 return *this;
83 }
84
85 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
86 /// @param rhs The proxy to move from.
87 RouterPrx& operator=(RouterPrx&& rhs) noexcept
88 {
89 if (this != &rhs)
90 {
91 Ice::ObjectPrx::operator=(std::move(rhs));
92 }
93 return *this;
94 }
95
96 /// Gets a unique category that identifies the client (caller) in the router. This category must be used in the
97 /// identities of all the client's callback objects.
98 /// @param context The request context.
99 /// @return The category. It's an empty string when `Glacier2.Server.Endpoints` is not configured.
100 std::string getCategoryForClient(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
101
102 /// Gets a unique category that identifies the client (caller) in the router. This category must be used in the
103 /// identities of all the client's callback objects.
104 /// @param context The request context.
105 /// @return A future that becomes available when the invocation completes. This future holds:
106 /// - The category. It's an empty string when `Glacier2.Server.Endpoints` is not configured.
107 [[nodiscard]] std::future<std::string> getCategoryForClientAsync(const Ice::Context& context = Ice::noExplicitContext) const;
108
109 /// Gets a unique category that identifies the client (caller) in the router. This category must be used in the
110 /// identities of all the client's callback objects.
111 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
112 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
113 /// function. It accepts:
114 /// - The category. It's an empty string when `Glacier2.Server.Endpoints` is not configured.
115 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
116 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
117 /// function.
118 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
119 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
120 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
121 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
122 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
123 /// asynchronous case.
124 /// @param context The request context.
125 /// @return A function that can be called to cancel the invocation locally.
126 // NOLINTNEXTLINE(modernize-use-nodiscard)
127 std::function<void()> getCategoryForClientAsync(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;
128
129 /// @private
130 void _iceI_getCategoryForClient(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::string>>&, const Ice::Context&) const;
131
132 /// Creates a session for the client (caller) with the router. If a ::Glacier2::SessionManagerPrx is configured,
133 /// a proxy to a ::Glacier2::SessionPrx object is returned to the client. Otherwise, null is returned and only an
134 /// internal session (i.e., not visible to the client) is created.
135 /// If a non-null session proxy is returned, it must be configured to route through the router that created it.
136 /// This occurs automatically when the router is configured as the client's default router at the time the
137 /// session proxy is created in the client application; otherwise, the client must configure the session proxy
138 /// explicitly.
139 /// @param userId The user ID.
140 /// @param password The password.
141 /// @param context The request context.
142 /// @return A proxy for the newly created session, or null if no ::Glacier2::SessionManagerPrx is configured.
143 /// @throws Glacier2::CannotCreateSessionException Thrown when the session cannot be created.
144 /// @throws Glacier2::PermissionDeniedException Thrown when an authentication or authorization failure occurs.
145 /// @see ::Glacier2::SessionPrx
146 /// @see ::Glacier2::SessionManagerPrx
147 /// @see ::Glacier2::PermissionsVerifierPrx
148 std::optional<SessionPrx> createSession(std::string_view userId, std::string_view password, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
149
150 /// Creates a session for the client (caller) with the router. If a ::Glacier2::SessionManagerPrx is configured,
151 /// a proxy to a ::Glacier2::SessionPrx object is returned to the client. Otherwise, null is returned and only an
152 /// internal session (i.e., not visible to the client) is created.
153 /// If a non-null session proxy is returned, it must be configured to route through the router that created it.
154 /// This occurs automatically when the router is configured as the client's default router at the time the
155 /// session proxy is created in the client application; otherwise, the client must configure the session proxy
156 /// explicitly.
157 /// @param userId The user ID.
158 /// @param password The password.
159 /// @param context The request context.
160 /// @return A future that becomes available when the invocation completes. This future holds:
161 /// - A proxy for the newly created session, or null if no ::Glacier2::SessionManagerPrx is configured.
162 /// @see ::Glacier2::SessionPrx
163 /// @see ::Glacier2::SessionManagerPrx
164 /// @see ::Glacier2::PermissionsVerifierPrx
165 [[nodiscard]] std::future<std::optional<SessionPrx>> createSessionAsync(std::string_view userId, std::string_view password, const Ice::Context& context = Ice::noExplicitContext) const;
166
167 /// Creates a session for the client (caller) with the router. If a ::Glacier2::SessionManagerPrx is configured,
168 /// a proxy to a ::Glacier2::SessionPrx object is returned to the client. Otherwise, null is returned and only an
169 /// internal session (i.e., not visible to the client) is created.
170 /// If a non-null session proxy is returned, it must be configured to route through the router that created it.
171 /// This occurs automatically when the router is configured as the client's default router at the time the
172 /// session proxy is created in the client application; otherwise, the client must configure the session proxy
173 /// explicitly.
174 /// @param userId The user ID.
175 /// @param password The password.
176 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
177 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
178 /// function. It accepts:
179 /// - A proxy for the newly created session, or null if no ::Glacier2::SessionManagerPrx is configured.
180 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
181 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
182 /// function.
183 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
184 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
185 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
186 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
187 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
188 /// asynchronous case.
189 /// @param context The request context.
190 /// @return A function that can be called to cancel the invocation locally.
191 /// @see ::Glacier2::SessionPrx
192 /// @see ::Glacier2::SessionManagerPrx
193 /// @see ::Glacier2::PermissionsVerifierPrx
194 // NOLINTNEXTLINE(modernize-use-nodiscard)
195 std::function<void()> createSessionAsync(std::string_view userId, std::string_view password, std::function<void(std::optional<::Glacier2::SessionPrx>)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
196
197 /// @private
198 void _iceI_createSession(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<SessionPrx>>>&, std::string_view, std::string_view, const Ice::Context&) const;
199
200 /// Creates a per-client session with the router. The user is authenticated through the SSL certificate(s)
201 /// associated with the connection. If an ::Glacier2::SSLSessionManagerPrx is configured, a proxy to a ::Glacier2::SessionPrx
202 /// object is returned to the client. Otherwise, null is returned and only an internal session (i.e., not
203 /// visible to the client) is created.
204 /// If a non-null session proxy is returned, it must be configured to route through the router that created it.
205 /// This occurs automatically when the router is configured as the client's default router at the time the
206 /// session proxy is created in the client application; otherwise, the client must configure the session proxy
207 /// explicitly.
208 /// @param context The request context.
209 /// @return A proxy for the newly created session, or null if no ::Glacier2::SSLSessionManagerPrx is configured.
210 /// @throws Glacier2::CannotCreateSessionException Thrown when the session cannot be created.
211 /// @throws Glacier2::PermissionDeniedException Thrown when an authentication or authorization failure occurs.
212 /// @see ::Glacier2::SessionPrx
213 /// @see ::Glacier2::SSLSessionManagerPrx
214 /// @see ::Glacier2::SSLPermissionsVerifierPrx
215 std::optional<SessionPrx> createSessionFromSecureConnection(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
216
217 /// Creates a per-client session with the router. The user is authenticated through the SSL certificate(s)
218 /// associated with the connection. If an ::Glacier2::SSLSessionManagerPrx is configured, a proxy to a ::Glacier2::SessionPrx
219 /// object is returned to the client. Otherwise, null is returned and only an internal session (i.e., not
220 /// visible to the client) is created.
221 /// If a non-null session proxy is returned, it must be configured to route through the router that created it.
222 /// This occurs automatically when the router is configured as the client's default router at the time the
223 /// session proxy is created in the client application; otherwise, the client must configure the session proxy
224 /// explicitly.
225 /// @param context The request context.
226 /// @return A future that becomes available when the invocation completes. This future holds:
227 /// - A proxy for the newly created session, or null if no ::Glacier2::SSLSessionManagerPrx is configured.
228 /// @see ::Glacier2::SessionPrx
229 /// @see ::Glacier2::SSLSessionManagerPrx
230 /// @see ::Glacier2::SSLPermissionsVerifierPrx
231 [[nodiscard]] std::future<std::optional<SessionPrx>> createSessionFromSecureConnectionAsync(const Ice::Context& context = Ice::noExplicitContext) const;
232
233 /// Creates a per-client session with the router. The user is authenticated through the SSL certificate(s)
234 /// associated with the connection. If an ::Glacier2::SSLSessionManagerPrx is configured, a proxy to a ::Glacier2::SessionPrx
235 /// object is returned to the client. Otherwise, null is returned and only an internal session (i.e., not
236 /// visible to the client) is created.
237 /// If a non-null session proxy is returned, it must be configured to route through the router that created it.
238 /// This occurs automatically when the router is configured as the client's default router at the time the
239 /// session proxy is created in the client application; otherwise, the client must configure the session proxy
240 /// explicitly.
241 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
242 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
243 /// function. It accepts:
244 /// - A proxy for the newly created session, or null if no ::Glacier2::SSLSessionManagerPrx is configured.
245 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
246 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
247 /// function.
248 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
249 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
250 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
251 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
252 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
253 /// asynchronous case.
254 /// @param context The request context.
255 /// @return A function that can be called to cancel the invocation locally.
256 /// @see ::Glacier2::SessionPrx
257 /// @see ::Glacier2::SSLSessionManagerPrx
258 /// @see ::Glacier2::SSLPermissionsVerifierPrx
259 // NOLINTNEXTLINE(modernize-use-nodiscard)
260 std::function<void()> createSessionFromSecureConnectionAsync(std::function<void(std::optional<::Glacier2::SessionPrx>)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
261
262 /// @private
263 void _iceI_createSessionFromSecureConnection(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<SessionPrx>>>&, const Ice::Context&) const;
264
265 /// Keeps the session with this router alive.
266 /// @param context The request context.
267 /// @throws Glacier2::SessionNotExistException Thrown when no session exists for the caller (client).
268 [[deprecated("As of Ice 3.8, this operation no longer keeps the session alive; it only verifies that the session exists.")]] void refreshSession(const Ice::Context& context = Ice::noExplicitContext) const;
269
270 /// Keeps the session with this router alive.
271 /// @param context The request context.
272 /// @return A future that becomes available when the invocation completes.
273 [[deprecated("As of Ice 3.8, this operation no longer keeps the session alive; it only verifies that the session exists.")]] [[nodiscard]] std::future<void> refreshSessionAsync(const Ice::Context& context = Ice::noExplicitContext) const;
274
275 /// Keeps the session with this router alive.
276 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
277 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
278 /// function.
279 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
280 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
281 /// function.
282 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
283 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
284 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
285 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
286 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
287 /// asynchronous case.
288 /// @param context The request context.
289 /// @return A function that can be called to cancel the invocation locally.
290 // NOLINTNEXTLINE(modernize-use-nodiscard)
291 [[deprecated("As of Ice 3.8, this operation no longer keeps the session alive; it only verifies that the session exists.")]] std::function<void()> refreshSessionAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
292
293 /// @private
294 void _iceI_refreshSession(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const Ice::Context&) const;
295
296 /// Destroys the session of the caller with this router.
297 /// @param context The request context.
298 /// @throws Glacier2::SessionNotExistException Thrown when no session exists for the caller (client).
300
301 /// Destroys the session of the caller with this router.
302 /// @param context The request context.
303 /// @return A future that becomes available when the invocation completes.
304 [[nodiscard]] std::future<void> destroySessionAsync(const Ice::Context& context = Ice::noExplicitContext) const;
305
306 /// Destroys the session of the caller with this router.
307 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
308 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
309 /// function.
310 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
311 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
312 /// function.
313 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
314 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
315 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
316 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
317 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
318 /// asynchronous case.
319 /// @param context The request context.
320 /// @return A function that can be called to cancel the invocation locally.
321 // NOLINTNEXTLINE(modernize-use-nodiscard)
322 std::function<void()> destroySessionAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
323
324 /// @private
325 void _iceI_destroySession(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const Ice::Context&) const;
326
327 /// Gets the idle timeout used by the server-side of the connection.
328 /// @param context The request context.
329 /// @return The idle timeout (in seconds).
330 std::int64_t getSessionTimeout(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
331
332 /// Gets the idle timeout used by the server-side of the connection.
333 /// @param context The request context.
334 /// @return A future that becomes available when the invocation completes. This future holds:
335 /// - The idle timeout (in seconds).
336 [[nodiscard]] std::future<std::int64_t> getSessionTimeoutAsync(const Ice::Context& context = Ice::noExplicitContext) const;
337
338 /// Gets the idle timeout used by the server-side of the connection.
339 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
340 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
341 /// function. It accepts:
342 /// - The idle timeout (in seconds).
343 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
344 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
345 /// function.
346 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
347 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
348 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
349 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
350 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
351 /// asynchronous case.
352 /// @param context The request context.
353 /// @return A function that can be called to cancel the invocation locally.
354 // NOLINTNEXTLINE(modernize-use-nodiscard)
355 std::function<void()> getSessionTimeoutAsync(std::function<void(std::int64_t)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
356
357 /// @private
358 void _iceI_getSessionTimeout(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::int64_t>>&, const Ice::Context&) const;
359
360 /// Gets the idle timeout used by the server-side of the connection.
361 /// @param context The request context.
362 /// @return The idle timeout (in seconds).
363 std::int32_t getACMTimeout(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
364
365 /// Gets the idle timeout used by the server-side of the connection.
366 /// @param context The request context.
367 /// @return A future that becomes available when the invocation completes. This future holds:
368 /// - The idle timeout (in seconds).
369 [[nodiscard]] std::future<std::int32_t> getACMTimeoutAsync(const Ice::Context& context = Ice::noExplicitContext) const;
370
371 /// Gets the idle timeout used by the server-side of the connection.
372 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
373 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
374 /// function. It accepts:
375 /// - The idle timeout (in seconds).
376 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
377 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
378 /// function.
379 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
380 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
381 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
382 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
383 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
384 /// asynchronous case.
385 /// @param context The request context.
386 /// @return A function that can be called to cancel the invocation locally.
387 // NOLINTNEXTLINE(modernize-use-nodiscard)
388 std::function<void()> getACMTimeoutAsync(std::function<void(std::int32_t)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
389
390 /// @private
391 void _iceI_getACMTimeout(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::int32_t>>&, const Ice::Context&) const;
392
393 /// Gets the type ID of the associated Slice interface.
394 /// @return The string `"::Glacier2::Router"`.
395 static const char* ice_staticId() noexcept;
396
397 /// @private
398 static RouterPrx _fromReference(IceInternal::ReferencePtr ref) { return RouterPrx{std::move(ref)}; }
399
400 protected:
401 /// @private
402 RouterPrx() = default;
403
404 /// @private
405 explicit RouterPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
406 {
407 }
408
409#if defined(__GNUC__) && !defined(__clang__)
410# pragma GCC diagnostic pop
411#endif
412 };
413}
414
415namespace Glacier2
416{
417 /// The exception that is thrown when a client tries to destroy a session with a router, but no session exists for
418 /// this client.
419 /// @remarks The Slice compiler generated this exception class from Slice exception `::Glacier2::SessionNotExistException`.
420 /// @see RouterPrx::destroySession
421 /// @headerfile Glacier2/Glacier2.h
423 {
424 public:
425 /// Gets the type ID of the associated Slice exception.
426 /// @return The string `"::Glacier2::SessionNotExistException"`.
427 static const char* ice_staticId() noexcept;
428
429 [[nodiscard]] const char* ice_id() const noexcept override;
430
431 void ice_throw() const override;
432
433 protected:
434 /// @private
435 void _writeImpl(Ice::OutputStream*) const override;
436
437 /// @private
438 void _readImpl(Ice::InputStream*) override;
439 };
440}
441
442namespace Glacier2
443{
444 /// The Glacier2 specialization of the ::Ice::RouterPrx interface.
445 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Glacier2::Router`.
446 /// @headerfile Glacier2/Glacier2.h
447 class GLACIER2_API Router : public virtual ::Ice::Router
448 {
449 public:
450 /// The associated proxy type.
451 using ProxyType = RouterPrx;
452
453 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
454 /// @param request The incoming request.
455 /// @param sendResponse The callback to send the response.
456 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
457
458 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
459
460 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
461
462 /// Gets a unique category that identifies the client (caller) in the router. This category must be used in the
463 /// identities of all the client's callback objects.
464 /// @param current The Current object of the incoming request.
465 /// @return The category. It's an empty string when `Glacier2.Server.Endpoints` is not configured.
466 [[nodiscard]] virtual std::string getCategoryForClient(const Ice::Current& current) const = 0;
467
468 /// @private
469 void _iceD_getCategoryForClient(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
470
471 /// Creates a session for the client (caller) with the router. If a ::Glacier2::SessionManagerPrx is configured,
472 /// a proxy to a ::Glacier2::SessionPrx object is returned to the client. Otherwise, null is returned and only an
473 /// internal session (i.e., not visible to the client) is created.
474 /// If a non-null session proxy is returned, it must be configured to route through the router that created it.
475 /// This occurs automatically when the router is configured as the client's default router at the time the
476 /// session proxy is created in the client application; otherwise, the client must configure the session proxy
477 /// explicitly.
478 /// @param userId The user ID.
479 /// @param password The password.
480 /// @param current The Current object of the incoming request.
481 /// @return A proxy for the newly created session, or null if no ::Glacier2::SessionManagerPrx is configured.
482 /// @throws Glacier2::CannotCreateSessionException Thrown when the session cannot be created.
483 /// @throws Glacier2::PermissionDeniedException Thrown when an authentication or authorization failure occurs.
484 /// @see ::Glacier2::SessionPrx
485 /// @see ::Glacier2::SessionManagerPrx
486 /// @see ::Glacier2::PermissionsVerifierPrx
487 virtual std::optional<SessionPrx> createSession(std::string userId, std::string password, const Ice::Current& current) = 0;
488
489 /// @private
490 void _iceD_createSession(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
491
492 /// Creates a per-client session with the router. The user is authenticated through the SSL certificate(s)
493 /// associated with the connection. If an ::Glacier2::SSLSessionManagerPrx is configured, a proxy to a ::Glacier2::SessionPrx
494 /// object is returned to the client. Otherwise, null is returned and only an internal session (i.e., not
495 /// visible to the client) is created.
496 /// If a non-null session proxy is returned, it must be configured to route through the router that created it.
497 /// This occurs automatically when the router is configured as the client's default router at the time the
498 /// session proxy is created in the client application; otherwise, the client must configure the session proxy
499 /// explicitly.
500 /// @param current The Current object of the incoming request.
501 /// @return A proxy for the newly created session, or null if no ::Glacier2::SSLSessionManagerPrx is configured.
502 /// @throws Glacier2::CannotCreateSessionException Thrown when the session cannot be created.
503 /// @throws Glacier2::PermissionDeniedException Thrown when an authentication or authorization failure occurs.
504 /// @see ::Glacier2::SessionPrx
505 /// @see ::Glacier2::SSLSessionManagerPrx
506 /// @see ::Glacier2::SSLPermissionsVerifierPrx
507 virtual std::optional<SessionPrx> createSessionFromSecureConnection(const Ice::Current& current) = 0;
508
509 /// @private
510 void _iceD_createSessionFromSecureConnection(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
511
512 /// Keeps the session with this router alive.
513 /// @param current The Current object of the incoming request.
514 /// @throws Glacier2::SessionNotExistException Thrown when no session exists for the caller (client).
515 virtual void refreshSession(const Ice::Current& current) = 0;
516
517 /// @private
518 void _iceD_refreshSession(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
519
520 /// Destroys the session of the caller with this router.
521 /// @param current The Current object of the incoming request.
522 /// @throws Glacier2::SessionNotExistException Thrown when no session exists for the caller (client).
523 virtual void destroySession(const Ice::Current& current) = 0;
524
525 /// @private
526 void _iceD_destroySession(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
527
528 /// Gets the idle timeout used by the server-side of the connection.
529 /// @param current The Current object of the incoming request.
530 /// @return The idle timeout (in seconds).
531 [[nodiscard]] virtual std::int64_t getSessionTimeout(const Ice::Current& current) const = 0;
532
533 /// @private
534 void _iceD_getSessionTimeout(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
535
536 /// Gets the idle timeout used by the server-side of the connection.
537 /// @param current The Current object of the incoming request.
538 /// @return The idle timeout (in seconds).
539 [[nodiscard]] virtual std::int32_t getACMTimeout(const Ice::Current& current) const = 0;
540
541 /// @private
542 void _iceD_getACMTimeout(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
543
544 /// Gets the type ID of the associated Slice interface.
545 /// @return The string `"::Glacier2::Router"`.
546 static const char* ice_staticId() noexcept;
547 };
548
549 /// A shared pointer to a Router.
550 using RouterPtr = std::shared_ptr<Router>;
551}
552
553namespace Glacier2
554{
555 /// The Glacier2 specialization of the ::Ice::RouterPrx interface.
556 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Glacier2::Router`.
557 /// @headerfile Glacier2/Glacier2.h
558 class GLACIER2_API AsyncRouter : public virtual ::Ice::AsyncRouter
559 {
560 public:
561 /// The associated proxy type.
563
564 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
565 /// @param request The incoming request.
566 /// @param sendResponse The callback to send the response.
567 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
568
569 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
570
571 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
572
573 /// Gets a unique category that identifies the client (caller) in the router. This category must be used in the
574 /// identities of all the client's callback objects.
575 /// @param response The response callback. It accepts:
576 /// - The category. It's an empty string when `Glacier2.Server.Endpoints` is not configured.
577 /// @param exception The exception callback.
578 /// @param current The Current object of the incoming request.
579 virtual void getCategoryForClientAsync(std::function<void(std::string_view returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) const = 0;
580
581 /// @private
582 void _iceD_getCategoryForClient(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
583
584 /// Creates a session for the client (caller) with the router. If a ::Glacier2::SessionManagerPrx is configured,
585 /// a proxy to a ::Glacier2::SessionPrx object is returned to the client. Otherwise, null is returned and only an
586 /// internal session (i.e., not visible to the client) is created.
587 /// If a non-null session proxy is returned, it must be configured to route through the router that created it.
588 /// This occurs automatically when the router is configured as the client's default router at the time the
589 /// session proxy is created in the client application; otherwise, the client must configure the session proxy
590 /// explicitly.
591 /// @param userId The user ID.
592 /// @param password The password.
593 /// @param response The response callback. It accepts:
594 /// - A proxy for the newly created session, or null if no ::Glacier2::SessionManagerPrx is configured.
595 /// @param exception The exception callback.
596 /// @param current The Current object of the incoming request.
597 /// @throws Glacier2::CannotCreateSessionException Thrown when the session cannot be created.
598 /// @throws Glacier2::PermissionDeniedException Thrown when an authentication or authorization failure occurs.
599 /// @see ::Glacier2::SessionPrx
600 /// @see ::Glacier2::SessionManagerPrx
601 /// @see ::Glacier2::PermissionsVerifierPrx
602 virtual void createSessionAsync(std::string userId, std::string password, std::function<void(const std::optional<SessionPrx>& returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
603
604 /// @private
605 void _iceD_createSession(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
606
607 /// Creates a per-client session with the router. The user is authenticated through the SSL certificate(s)
608 /// associated with the connection. If an ::Glacier2::SSLSessionManagerPrx is configured, a proxy to a ::Glacier2::SessionPrx
609 /// object is returned to the client. Otherwise, null is returned and only an internal session (i.e., not
610 /// visible to the client) is created.
611 /// If a non-null session proxy is returned, it must be configured to route through the router that created it.
612 /// This occurs automatically when the router is configured as the client's default router at the time the
613 /// session proxy is created in the client application; otherwise, the client must configure the session proxy
614 /// explicitly.
615 /// @param response The response callback. It accepts:
616 /// - A proxy for the newly created session, or null if no ::Glacier2::SSLSessionManagerPrx is configured.
617 /// @param exception The exception callback.
618 /// @param current The Current object of the incoming request.
619 /// @throws Glacier2::CannotCreateSessionException Thrown when the session cannot be created.
620 /// @throws Glacier2::PermissionDeniedException Thrown when an authentication or authorization failure occurs.
621 /// @see ::Glacier2::SessionPrx
622 /// @see ::Glacier2::SSLSessionManagerPrx
623 /// @see ::Glacier2::SSLPermissionsVerifierPrx
624 virtual void createSessionFromSecureConnectionAsync(std::function<void(const std::optional<SessionPrx>& returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
625
626 /// @private
627 void _iceD_createSessionFromSecureConnection(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
628
629 /// Keeps the session with this router alive.
630 /// @param response The response callback.
631 /// @param exception The exception callback.
632 /// @param current The Current object of the incoming request.
633 /// @throws Glacier2::SessionNotExistException Thrown when no session exists for the caller (client).
634 virtual void refreshSessionAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
635
636 /// @private
637 void _iceD_refreshSession(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
638
639 /// Destroys the session of the caller with this router.
640 /// @param response The response callback.
641 /// @param exception The exception callback.
642 /// @param current The Current object of the incoming request.
643 /// @throws Glacier2::SessionNotExistException Thrown when no session exists for the caller (client).
644 virtual void destroySessionAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
645
646 /// @private
647 void _iceD_destroySession(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
648
649 /// Gets the idle timeout used by the server-side of the connection.
650 /// @param response The response callback. It accepts:
651 /// - The idle timeout (in seconds).
652 /// @param exception The exception callback.
653 /// @param current The Current object of the incoming request.
654 virtual void getSessionTimeoutAsync(std::function<void(std::int64_t returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) const = 0;
655
656 /// @private
657 void _iceD_getSessionTimeout(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
658
659 /// Gets the idle timeout used by the server-side of the connection.
660 /// @param response The response callback. It accepts:
661 /// - The idle timeout (in seconds).
662 /// @param exception The exception callback.
663 /// @param current The Current object of the incoming request.
664 virtual void getACMTimeoutAsync(std::function<void(std::int32_t returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) const = 0;
665
666 /// @private
667 void _iceD_getACMTimeout(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
668
669 /// Gets the type ID of the associated Slice interface.
670 /// @return The string `"::Glacier2::Router"`.
671 static const char* ice_staticId() noexcept;
672 };
673
674 /// A shared pointer to an AsyncRouter.
675 using AsyncRouterPtr = std::shared_ptr<AsyncRouter>;
676}
677
678// NOLINTEND(modernize-concat-nested-namespaces)
679
680#include <Ice/PopDisableWarnings.h>
681#endif
RouterPrx ProxyType
The associated proxy type.
Definition Router.h:562
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.
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,...
virtual void createSessionFromSecureConnectionAsync(std::function< void(const std::optional< SessionPrx > &returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Creates a per-client session with the router.
virtual void getSessionTimeoutAsync(std::function< void(std::int64_t returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current) const =0
Gets the idle timeout used by the server-side of the connection.
virtual void refreshSessionAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Keeps the session with this router alive.
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
virtual void createSessionAsync(std::string userId, std::string password, std::function< void(const std::optional< SessionPrx > &returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Creates a session for the client (caller) with the router.
virtual void getCategoryForClientAsync(std::function< void(std::string_view returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current) const =0
Gets a unique category that identifies the client (caller) in the router.
virtual void destroySessionAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Destroys the session of the caller with this router.
virtual void getACMTimeoutAsync(std::function< void(std::int32_t returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current) const =0
Gets the idle timeout used by the server-side of the connection.
The Glacier2 specialization of the Ice::RouterPrx interface.
Definition Router.h:559
std::optional< SessionPrx > createSessionFromSecureConnection(const Ice::Context &context=Ice::noExplicitContext) const
Creates a per-client session with the router.
std::future< std::int64_t > getSessionTimeoutAsync(const Ice::Context &context=Ice::noExplicitContext) const
Gets the idle timeout used by the server-side of the connection.
std::int32_t getACMTimeout(const Ice::Context &context=Ice::noExplicitContext) const
Gets the idle timeout used by the server-side of the connection.
std::function< void()> getACMTimeoutAsync(std::function< void(std::int32_t)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets the idle timeout used by the server-side of the connection.
std::int64_t getSessionTimeout(const Ice::Context &context=Ice::noExplicitContext) const
Gets the idle timeout used by the server-side of the connection.
std::future< void > destroySessionAsync(const Ice::Context &context=Ice::noExplicitContext) const
Destroys the session of the caller with this router.
std::future< std::optional< SessionPrx > > createSessionFromSecureConnectionAsync(const Ice::Context &context=Ice::noExplicitContext) const
Creates a per-client session with the router.
void destroySession(const Ice::Context &context=Ice::noExplicitContext) const
Destroys the session of the caller with this router.
RouterPrx(const RouterPrx &other) noexcept
Copy constructor.
Definition Router.h:65
std::optional< SessionPrx > createSession(std::string_view userId, std::string_view password, const Ice::Context &context=Ice::noExplicitContext) const
Creates a session for the client (caller) with the router.
std::future< void > refreshSessionAsync(const Ice::Context &context=Ice::noExplicitContext) const
Keeps the session with this router alive.
RouterPrx & operator=(RouterPrx &&rhs) noexcept
Move assignment operator.
Definition Router.h:87
std::function< void()> getSessionTimeoutAsync(std::function< void(std::int64_t)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets the idle timeout used by the server-side of the connection.
void refreshSession(const Ice::Context &context=Ice::noExplicitContext) const
Keeps the session with this router alive.
std::string getCategoryForClient(const Ice::Context &context=Ice::noExplicitContext) const
Gets a unique category that identifies the client (caller) in the router.
RouterPrx & operator=(const RouterPrx &rhs) noexcept
Copy assignment operator.
Definition Router.h:76
std::future< std::string > getCategoryForClientAsync(const Ice::Context &context=Ice::noExplicitContext) const
Gets a unique category that identifies the client (caller) in the router.
RouterPrx(RouterPrx &&other) noexcept
Move constructor.
Definition Router.h:69
std::function< void()> createSessionAsync(std::string_view userId, std::string_view password, std::function< void(std::optional<::Glacier2::SessionPrx >)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Creates a session for the client (caller) with the router.
std::function< void()> refreshSessionAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Keeps the session with this router alive.
RouterPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
Definition Router.h:61
std::function< void()> destroySessionAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Destroys the session of the caller with this router.
std::future< std::optional< SessionPrx > > createSessionAsync(std::string_view userId, std::string_view password, const Ice::Context &context=Ice::noExplicitContext) const
Creates a session for the client (caller) with the router.
std::function< void()> getCategoryForClientAsync(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 a unique category that identifies the client (caller) in the router.
std::function< void()> createSessionFromSecureConnectionAsync(std::function< void(std::optional<::Glacier2::SessionPrx >)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Creates a per-client session with the router.
std::future< std::int32_t > getACMTimeoutAsync(const Ice::Context &context=Ice::noExplicitContext) const
Gets the idle timeout used by the server-side of the connection.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
The Glacier2 specialization of the Ice::RouterPrx interface.
Definition Router.h:51
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 client tries to destroy a session with a router,...
Definition Router.h:423
Represents an intermediary object that routes requests and replies between clients and Ice objects th...
Definition Router.h:428
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
Represents the response to an incoming request.
Provides typed proxy functions.
Definition Proxy.h:48
Represents an intermediary object that routes requests and replies between clients and Ice objects th...
Definition Router.h:328
Abstract base class for all exceptions defined in Slice.
std::shared_ptr< AsyncRouter > AsyncRouterPtr
A shared pointer to an AsyncRouter.
Definition Router.h:675
std::shared_ptr< Router > RouterPtr
A shared pointer to a Router.
Definition Router.h:550
Communicate through firewalls and across NATs.
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:34
The Ice RPC framework.
Definition SampleEvent.h:66
Provides information about an incoming request being dispatched.
Definition Current.h:18