use of org.infinispan.configuration.cache.XSiteStateTransferMode in project infinispan by infinispan.
the class XSiteAutoTransferStatusCommand method invokeAsync.
@Override
public CompletionStage<AutoStateTransferResponse> invokeAsync(ComponentRegistry registry) throws Throwable {
boolean offline = registry.getTakeOfflineManager().running().getSiteState(site) == SiteState.OFFLINE;
XSiteStateTransferMode mode = registry.getXSiteStateTransferManager().running().stateTransferMode(site);
return CompletableFuture.completedFuture(new AutoStateTransferResponse(offline, mode));
}
use of org.infinispan.configuration.cache.XSiteStateTransferMode in project infinispan by infinispan.
the class XSiteAdminOperations method asyncSetStateTransferMode.
public CompletionStage<Boolean> asyncSetStateTransferMode(String site, String mode) {
authorizer.checkPermission(AuthorizationPermission.ADMIN);
XSiteStateTransferMode stateTransferMode = XSiteStateTransferMode.valueOf(mode);
// update locally first
if (!stateTransferManager.setAutomaticStateTransfer(site, stateTransferMode)) {
// failed
return CompletableFutures.completedFalse();
}
ReplicableCommand cmd = commandsFactory.buildXSiteSetStateTransferModeCommand(site, stateTransferMode);
return rpcManager.invokeCommandOnAll(cmd, org.infinispan.remoting.transport.impl.VoidResponseCollector.ignoreLeavers(), rpcManager.getSyncRpcOptions()).thenApply(o -> Boolean.TRUE);
}
Aggregations