org.infinispan.xsite.XSiteAdminCommand Maven / Gradle / Ivy
package org.infinispan.xsite;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import org.infinispan.commands.remote.BaseRpcCommand;
import org.infinispan.commons.marshall.MarshallUtil;
import org.infinispan.util.ByteString;
import org.infinispan.util.concurrent.CompletableFutures;
/**
* Command used for handling XSiteReplication administrative operations.
*
* @author Mircea Markus
* @since 5.2
*/
public class XSiteAdminCommand extends BaseRpcCommand {
public static final int COMMAND_ID = 32;
public enum AdminOperation {
SITE_STATUS,
STATUS,
TAKE_OFFLINE,
BRING_ONLINE,
AMEND_TAKE_OFFLINE;
private static final AdminOperation[] CACHED_VALUES = values();
private static AdminOperation valueOf(int index) {
return CACHED_VALUES[index];
}
}
public enum Status {
OFFLINE, ONLINE
}
private String siteName;
private Integer afterFailures;
private Long minTimeToWait;
private AdminOperation adminOperation;
private BackupSender backupSender;
@SuppressWarnings("unused")
public XSiteAdminCommand() {
super(null);// For command id uniqueness test
}
public XSiteAdminCommand(ByteString cacheName) {
super(cacheName);// For command id uniqueness test
}
public XSiteAdminCommand(ByteString cacheName, String siteName, AdminOperation op, Integer afterFailures, Long minTimeToWait) {
this(cacheName);
this.siteName = siteName;
this.adminOperation = op;
this.afterFailures = afterFailures;
this.minTimeToWait = minTimeToWait;
}
public void init(BackupSender backupSender) {
this.backupSender = backupSender;
}
@Override
public CompletableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy