Ejemplo n.º 1
0
        /// <summary>
        /// Gets messaging options for this node.
        /// </summary>
        public async Task <NodeMessagingOptions> GetNodeMessagingOptionsAsync()
        {
            CoordinatorEnableResponseData response =
                await ExecuteAtQueryAsync <CoordinatorEnableResponseData>(new CoordinatorEnableCommandExt());

            if (response.Options == null)
            {
                throw new InvalidOperationException("No valid coordinator state returned.");
            }

            return(response.Options.Value);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets a value that indicates whether this node is a coordinator node.
        /// </summary>
        /// <returns>True if this is a coordinator node</returns>
        public virtual async Task <bool> IsCoordinator()
        {
            CoordinatorEnableResponseData response =
                await ExecuteAtQueryAsync <CoordinatorEnableResponseData>(new CoordinatorEnableCommand());

            if (response.EnableState == null)
            {
                throw new InvalidOperationException("No valid coordinator state returned.");
            }

            return(response.EnableState.Value == CoordinatorEnableState.Coordinator);
        }