
org.postgresql.adba.communication.network.CloseRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pgadba Show documentation
Show all versions of pgadba Show documentation
ADBA implementation for PostgreSQL
The newest version!
package org.postgresql.adba.communication.network;
import org.postgresql.adba.communication.FrontendTag;
import org.postgresql.adba.communication.NetworkOutputStream;
import org.postgresql.adba.communication.NetworkRequest;
import org.postgresql.adba.communication.NetworkResponse;
import org.postgresql.adba.communication.NetworkWriteContext;
import org.postgresql.adba.submissions.CloseSubmission;
/**
* Close {@link NetworkRequest}.
*
* @author Daniel Sagenschneider
*/
public class CloseRequest implements NetworkRequest {
private final CloseSubmission submission;
/**
* Instantiate.
*
* @param submission the submission this request connects to
*/
public CloseRequest(CloseSubmission submission) {
this.submission = submission;
}
@Override
public NetworkRequest write(NetworkWriteContext context) throws Exception {
// Send the close
NetworkOutputStream wire = context.getOutputStream();
wire.write(FrontendTag.TERMINATE.getByte());
wire.initPacket();
wire.completePacket();
wire.close();
// Nothing further
return null;
}
@Override
public NetworkResponse getRequiredResponse() {
return new CloseResponse(submission);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy