/*
 * Copyright 2017-present Open Networking Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.atomix.cluster.messaging;

import java.util.concurrent.CompletableFuture;

/**
 * Message subscription.
 */
public interface Subscription {

  /**
   * Returns the subscription topic.
   *
   * @return the subscription topic
   */
  String topic();

  /**
   * Closes the subscription, causing it to be unregistered.
   *
   * @return a future to be completed once the subscription has been closed
   */
  CompletableFuture<Void> close();

}

@@ -704,28 +704,379 @@
 %0A * 
-Message subscription
+%7B@link ClusterEventService%7D subscription context.%0A * %3Cp%3E%0A * The subscription represents a node's subscription to a specific topic. A %7B@code Subscription%7D instance is returned%0A * once an %7B@link ClusterEventService%7D subscription has been propagated. The subscription context can be used to%0A * unsubscribe the node from the given %7B@link #topic()%7D by calling %7B@link #close()%7D
 .%0A *
@@ -1175,34 +1175,59 @@
 urn the 
-subscription topic
+topic to which the subscriber is subscribed
 %0A   */%0A 
@@ -1311,16 +1311,261 @@
 stered.%0A
+   * %3Cp%3E%0A   * When the subscription is closed, the subscriber will be unregistered and the change will be propagated to all%0A   * the members of the cluster. The returned future will be completed once the change has been propagated to all nodes.%0A
    *%0A   

Add subscription documentation.