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

org.postgresql.adba.communication.network.CloseResponse Maven / Gradle / Ivy

The newest version!
package org.postgresql.adba.communication.network;

import java.io.IOException;
import jdk.incubator.sql2.Submission;
import org.postgresql.adba.communication.NetworkReadContext;
import org.postgresql.adba.communication.NetworkResponse;

public class CloseResponse implements NetworkResponse {

  private final Submission submission;

  public CloseResponse(Submission submission) {
    this.submission = submission;
  }

  @Override
  public NetworkResponse read(NetworkReadContext context) throws IOException {
    submission.getCompletionStage().toCompletableFuture().complete(null);
    return null;
  }

  @Override
  public NetworkResponse handleException(Throwable ex) {
    submission.getCompletionStage().toCompletableFuture().completeExceptionally(ex);
    return null;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy