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

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

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

import org.interledger.core.InterledgerFulfillPacket;
import org.interledger.core.InterledgerPreparePacket;
import org.interledger.core.InterledgerRejectPacket;
import org.interledger.core.InterledgerResponsePacket;

import java.util.concurrent.CompletableFuture;

/**
 * Handles an incoming {@link InterledgerPreparePacket} for a single plugin, sent from a remote peer.
 */
@FunctionalInterface
public interface LinkHandler {

  /**
   * Handles an incoming {@link InterledgerPreparePacket} received from a connected peer, but that may have originated
   * from any Interledger sender in the network.
   *
   * @param incomingPreparePacket A {@link InterledgerPreparePacket} containing data about an incoming payment.
   *
   * @return A {@link CompletableFuture} that resolves to an optionally-present {@link InterledgerResponsePacket}, which
   *     will be of concrete type {@link InterledgerFulfillPacket} or {@link InterledgerRejectPacket}, if present.
   */
  InterledgerResponsePacket handleIncomingPacket(InterledgerPreparePacket incomingPreparePacket);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy