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