use of org.infinispan.xsite.response.AutoStateTransferResponse 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.xsite.response.AutoStateTransferResponse in project infinispan by infinispan.
the class XSiteStateTransferManagerImpl method isStateTransferRequired.
private CompletionStage<Boolean> isStateTransferRequired(RemoteSiteStatus status) {
final String site = status.getSiteName();
AutoStateTransferResponseCollector collector = new AutoStateTransferResponseCollector(takeOfflineManager.getSiteState(site) == SiteState.OFFLINE, status.stateTransferMode());
XSiteAutoTransferStatusCommand cmd = commandsFactory.buildXSiteAutoTransferStatusCommand(site);
return rpcManager.invokeCommandOnAll(cmd, collector, rpcManager.getSyncRpcOptions()).thenApply(AutoStateTransferResponse::canDoAutomaticStateTransfer);
}
Aggregations