org.infinispan.stream.impl.StreamResponseCommand Maven / Gradle / Ivy
package org.infinispan.stream.impl;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Collections;
import java.util.concurrent.CompletableFuture;
import org.infinispan.commands.remote.BaseRpcCommand;
import org.infinispan.factories.annotations.Inject;
import org.infinispan.remoting.transport.Address;
import org.infinispan.util.ByteString;
import org.infinispan.util.concurrent.CompletableFutures;
/**
* Stream response command used to handle returning intermediate or final responses from the remote node
* @param the response type
*/
public class StreamResponseCommand extends BaseRpcCommand {
public static final byte COMMAND_ID = 48;
protected ClusterStreamManager csm;
protected Object id;
protected boolean complete;
protected R response;
// Only here for CommandIdUniquenessTest
protected StreamResponseCommand() { super(null); }
public StreamResponseCommand(ByteString cacheName) {
super(cacheName);
}
public StreamResponseCommand(ByteString cacheName, Address origin, Object id, boolean complete, R response) {
super(cacheName);
setOrigin(origin);
this.id = id;
this.complete = complete;
this.response = response;
}
@Inject
public void inject(ClusterStreamManager csm) {
this.csm = csm;
}
@Override
public CompletableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy