Skip to content

Commit

Permalink
HEAD:(zeroc-ice/ice@88f1b26f27) DataStorm: Fixes for Session Establis…
Browse files Browse the repository at this point in the history
…hment and Reconnection (zeroc-ice/ice#3333)
  • Loading branch information
pepone authored and temp committed Jan 14, 2025
1 parent 65adc87 commit f94f266
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 104 deletions.
76 changes: 52 additions & 24 deletions slice2cpp/cpp/src/DataStorm/Contract.h
Original file line number Diff line number Diff line change
Expand Up @@ -744,31 +744,52 @@ class NodePrx : public ::Ice::Proxy<NodePrx, ::Ice::ObjectPrx>
void _iceI_initiateCreateSession(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>&, const ::std::optional<NodePrx>&, const ::Ice::Context&) const;
/// \endcond

/// Initiate the creation of a subscriber session with a node, after the target node has announced a topic
/// writer for which this node has a corresponding topic reader, or after the node has called
/// Node::initiateCreateSession.
/// @param subscriber The subscriber node initiating the session. The proxy is never null.
/// @param session The subscriber session being created. The proxy is never null.
/// @param fromRelay Indicates if the session is being created from a relay node.
/// Initiates the creation of a subscriber session with a node. The subscriber node sends this request to a
/// publisher node in one of the following scenarios:
///
/// - The subscriber has received a topic writer announcement from the publisher and has a matching topic
/// reader.
/// - The publisher node has previously sent a initiateCreateSession request.
///
/// The publisher node dispatching this request then sends a confirmCreateSession request to the subscriber node
/// to continue session establishment. If an active session already exists with the subscriber node, the
/// request is ignored.
/// @param subscriber The subscriber node initiating the session. This proxy is never null.
/// @param session The subscriber session being created. This proxy is never null.
/// @param fromRelay Indicates whether the session is being created from a relay node.
/// @param context The Context map to send with the invocation.
void createSession(const ::std::optional<NodePrx>& subscriber, const ::std::optional<SubscriberSessionPrx>& session, bool fromRelay, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

/// Initiate the creation of a subscriber session with a node, after the target node has announced a topic
/// writer for which this node has a corresponding topic reader, or after the node has called
/// Node::initiateCreateSession.
/// @param subscriber The subscriber node initiating the session. The proxy is never null.
/// @param session The subscriber session being created. The proxy is never null.
/// @param fromRelay Indicates if the session is being created from a relay node.
/// Initiates the creation of a subscriber session with a node. The subscriber node sends this request to a
/// publisher node in one of the following scenarios:
///
/// - The subscriber has received a topic writer announcement from the publisher and has a matching topic
/// reader.
/// - The publisher node has previously sent a initiateCreateSession request.
///
/// The publisher node dispatching this request then sends a confirmCreateSession request to the subscriber node
/// to continue session establishment. If an active session already exists with the subscriber node, the
/// request is ignored.
/// @param subscriber The subscriber node initiating the session. This proxy is never null.
/// @param session The subscriber session being created. This proxy is never null.
/// @param fromRelay Indicates whether the session is being created from a relay node.
/// @param context The Context map to send with the invocation.
/// @return The future object for the invocation.
[[nodiscard]] ::std::future<void> createSessionAsync(const ::std::optional<NodePrx>& subscriber, const ::std::optional<SubscriberSessionPrx>& session, bool fromRelay, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

/// Initiate the creation of a subscriber session with a node, after the target node has announced a topic
/// writer for which this node has a corresponding topic reader, or after the node has called
/// Node::initiateCreateSession.
/// @param subscriber The subscriber node initiating the session. The proxy is never null.
/// @param session The subscriber session being created. The proxy is never null.
/// @param fromRelay Indicates if the session is being created from a relay node.
/// Initiates the creation of a subscriber session with a node. The subscriber node sends this request to a
/// publisher node in one of the following scenarios:
///
/// - The subscriber has received a topic writer announcement from the publisher and has a matching topic
/// reader.
/// - The publisher node has previously sent a initiateCreateSession request.
///
/// The publisher node dispatching this request then sends a confirmCreateSession request to the subscriber node
/// to continue session establishment. If an active session already exists with the subscriber node, the
/// request is ignored.
/// @param subscriber The subscriber node initiating the session. This proxy is never null.
/// @param session The subscriber session being created. This proxy is never null.
/// @param fromRelay Indicates whether the session is being created from a relay node.
/// @param response The response callback.
/// @param ex The exception callback.
/// @param sent The sent callback.
Expand Down Expand Up @@ -1589,12 +1610,19 @@ class Node : public virtual ::Ice::Object
void _iceD_initiateCreateSession(::Ice::IncomingRequest&, ::std::function<void(::Ice::OutgoingResponse)>);
/// \endcond

/// Initiate the creation of a subscriber session with a node, after the target node has announced a topic
/// writer for which this node has a corresponding topic reader, or after the node has called
/// Node::initiateCreateSession.
/// @param subscriber The subscriber node initiating the session. The proxy is never null.
/// @param session The subscriber session being created. The proxy is never null.
/// @param fromRelay Indicates if the session is being created from a relay node.
/// Initiates the creation of a subscriber session with a node. The subscriber node sends this request to a
/// publisher node in one of the following scenarios:
///
/// - The subscriber has received a topic writer announcement from the publisher and has a matching topic
/// reader.
/// - The publisher node has previously sent a initiateCreateSession request.
///
/// The publisher node dispatching this request then sends a confirmCreateSession request to the subscriber node
/// to continue session establishment. If an active session already exists with the subscriber node, the
/// request is ignored.
/// @param subscriber The subscriber node initiating the session. This proxy is never null.
/// @param session The subscriber session being created. This proxy is never null.
/// @param fromRelay Indicates whether the session is being created from a relay node.
/// @param current The Current object for the invocation.
virtual void createSession(::std::optional<NodePrx> subscriber, ::std::optional<SubscriberSessionPrx> session, bool fromRelay, const ::Ice::Current& current) = 0;
/// \cond INTERNAL
Expand Down
53 changes: 35 additions & 18 deletions slice2cs/cpp/src/DataStorm/Contract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -911,15 +911,24 @@ public partial interface Node : Ice.Object
void initiateCreateSession(NodePrx? publisher, Ice.Current current);

/// <summary>
/// Initiate the creation of a subscriber session with a node, after the target node has announced a topic
/// writer for which this node has a corresponding topic reader, or after the node has called
/// Node::initiateCreateSession.
/// Initiates the creation of a subscriber session with a node.
/// The subscriber node sends this request to a
/// publisher node in one of the following scenarios:
///
/// - The subscriber has received a topic writer announcement from the publisher and has a matching topic
/// reader.
/// - The publisher node has previously sent a initiateCreateSession request.
///
/// The publisher node dispatching this request then sends a confirmCreateSession request to the subscriber node
/// to continue session establishment. If an active session already exists with the subscriber node, the
/// request is ignored.
///
/// </summary>
/// <param name="subscriber">The subscriber node initiating the session. The proxy is never null.
/// <param name="subscriber">The subscriber node initiating the session. This proxy is never null.
/// </param>
/// <param name="session">The subscriber session being created. The proxy is never null.
/// <param name="session">The subscriber session being created. This proxy is never null.
/// </param>
/// <param name="fromRelay">Indicates if the session is being created from a relay node.</param>
/// <param name="fromRelay">Indicates whether the session is being created from a relay node.</param>
/// <param name="current">The Current object for the dispatch.</param>

void createSession(NodePrx? subscriber, SubscriberSessionPrx? session, bool fromRelay, Ice.Current current);
Expand Down Expand Up @@ -1352,29 +1361,37 @@ public interface NodePrx : Ice.ObjectPrx
global::System.Threading.Tasks.Task initiateCreateSessionAsync(NodePrx? publisher, global::System.Collections.Generic.Dictionary<string, string>? context = null, global::System.IProgress<bool>? progress = null, global::System.Threading.CancellationToken cancel = default);

/// <summary>
/// Initiate the creation of a subscriber session with a node, after the target node has announced a topic
/// writer for which this node has a corresponding topic reader, or after the node has called
/// Node::initiateCreateSession.
/// Initiates the creation of a subscriber session with a node.
/// The subscriber node sends this request to a
/// publisher node in one of the following scenarios:
///
/// - The subscriber has received a topic writer announcement from the publisher and has a matching topic
/// reader.
/// - The publisher node has previously sent a initiateCreateSession request.
///
/// The publisher node dispatching this request then sends a confirmCreateSession request to the subscriber node
/// to continue session establishment. If an active session already exists with the subscriber node, the
/// request is ignored.
///
/// </summary>
/// <param name="subscriber">The subscriber node initiating the session. The proxy is never null.
/// <param name="subscriber">The subscriber node initiating the session. This proxy is never null.
/// </param>
/// <param name="session">The subscriber session being created. The proxy is never null.
/// <param name="session">The subscriber session being created. This proxy is never null.
/// </param>
/// <param name="fromRelay">Indicates if the session is being created from a relay node.</param>
/// <param name="fromRelay">Indicates whether the session is being created from a relay node.</param>
/// <param name="context">The Context map to send with the invocation.</param>

void createSession(NodePrx? subscriber, SubscriberSessionPrx? session, bool fromRelay, global::System.Collections.Generic.Dictionary<string, string>? context = null);

/// <summary>
/// Initiate the creation of a subscriber session with a node, after the target node has announced a topic
/// writer for which this node has a corresponding topic reader, or after the node has called
/// Node::initiateCreateSession.
/// Initiates the creation of a subscriber session with a node.
/// The subscriber node sends this request to a
/// </summary>
/// <param name="subscriber">The subscriber node initiating the session. The proxy is never null.
/// <param name="subscriber">The subscriber node initiating the session. This proxy is never null.
/// </param>
/// <param name="session">The subscriber session being created. The proxy is never null.
/// <param name="session">The subscriber session being created. This proxy is never null.
/// </param>
/// <param name="fromRelay">Indicates if the session is being created from a relay node.</param>
/// <param name="fromRelay">Indicates whether the session is being created from a relay node.</param>
/// <param name="context">Context map to send with the invocation.</param>
/// <param name="progress">Sent progress provider.</param>
/// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
Expand Down
19 changes: 13 additions & 6 deletions slice2java/cpp/src/DataStorm/DataStormContract/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,19 @@ public interface Node extends com.zeroc.Ice.Object
void initiateCreateSession(NodePrx publisher, com.zeroc.Ice.Current current);

/**
* Initiate the creation of a subscriber session with a node, after the target node has announced a topic
* writer for which this node has a corresponding topic reader, or after the node has called
* Node::initiateCreateSession.
* @param subscriber The subscriber node initiating the session. The proxy is never null.
* @param session The subscriber session being created. The proxy is never null.
* @param fromRelay Indicates if the session is being created from a relay node.
* Initiates the creation of a subscriber session with a node. The subscriber node sends this request to a
* publisher node in one of the following scenarios:
*
* - The subscriber has received a topic writer announcement from the publisher and has a matching topic
* reader.
* - The publisher node has previously sent a initiateCreateSession request.
*
* The publisher node dispatching this request then sends a confirmCreateSession request to the subscriber node
* to continue session establishment. If an active session already exists with the subscriber node, the
* request is ignored.
* @param subscriber The subscriber node initiating the session. This proxy is never null.
* @param session The subscriber session being created. This proxy is never null.
* @param fromRelay Indicates whether the session is being created from a relay node.
* @param current The Current object for the invocation.
**/
void createSession(NodePrx subscriber, SubscriberSessionPrx session, boolean fromRelay, com.zeroc.Ice.Current current);
Expand Down
Loading

0 comments on commit f94f266

Please sign in to comment.