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