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