All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.interledger.link.Connectable Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
package org.interledger.link;

import java.io.Closeable;
import java.util.concurrent.CompletableFuture;

/**
 * Defines how to connect and disconnect.
 */
public interface Connectable extends Closeable {

  boolean CONNECTED = true;
  boolean NOT_CONNECTED = false;

  /**
   * 

Connect to the remote peer.

* * @return A {@link CompletableFuture} with the result of this call. */ CompletableFuture connect(); /** * Disconnect from the remote peer. * * @return A {@link CompletableFuture} with the result of this call. */ CompletableFuture disconnect(); @Override default void close() { disconnect().join(); } /** *

Determines if this Connectable is connected or not. If authentication is required, this method * will return false until an authenticated session is opened.

* * @return {@code true} if this Connectable is connected; {@code false} otherwise. */ boolean isConnected(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy