org.postgresql.adba.communication.network.SyncRequest Maven / Gradle / Ivy
package org.postgresql.adba.communication.network;
import org.postgresql.adba.communication.FeFrame;
import org.postgresql.adba.communication.NetworkOutputStream;
import org.postgresql.adba.communication.NetworkRequest;
import org.postgresql.adba.communication.NetworkWriteContext;
/**
* Sync {@link NetworkRequest}.
*
* @author Daniel Sagenschneider
*/
public class SyncRequest implements NetworkRequest {
private final Portal portal;
public SyncRequest(Portal portal) {
this.portal = portal;
}
/*
* ================= NetworkRequest =========================
*/
@Override
public NetworkRequest write(NetworkWriteContext context) throws Exception {
NetworkOutputStream wire = context.getOutputStream();
wire.write(FeFrame.FrontendTag.SYNC.getByte());
wire.initPacket();
wire.completePacket();
if (portal.hasMoreToExecute()) {
return new BindRequest<>(portal);
}
// Nothing further
return null;
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy