use of org.infinispan.configuration.cache.TakeOfflineConfigurationBuilder in project infinispan by infinispan.
the class OfflineStatusTest method createNew.
private static TestContext createNew(long minWait, int afterFailures) {
ControlledTimeService t = new ControlledTimeService();
ListenerImpl l = new ListenerImpl();
TakeOfflineConfiguration c = new TakeOfflineConfigurationBuilder(null, null).afterFailures(afterFailures).minTimeToWait(minWait).create();
return new TestContext(new OfflineStatus(c, t, l), t, l);
}
use of org.infinispan.configuration.cache.TakeOfflineConfigurationBuilder in project infinispan by infinispan.
the class XSiteAdminOperationsTest method amendTakeOffline.
public void amendTakeOffline() {
assertEquals(admin(LON, 0).siteStatus(NYC), XSiteAdminOperations.ONLINE);
assertEquals(admin(LON, 1).siteStatus(NYC), XSiteAdminOperations.ONLINE);
TakeOfflineManager tom = takeOfflineManager(LON, 0);
assertEquals(tom.getConfiguration(NYC), new TakeOfflineConfigurationBuilder(null, null).afterFailures(0).minTimeToWait(0).create());
assertEquals(XSiteAdminOperations.SUCCESS, admin(LON, 1).amendTakeOffline(NYC, 7, 12));
assertEquals(tom.getConfiguration(NYC), new TakeOfflineConfigurationBuilder(null, null).afterFailures(7).minTimeToWait(12).create());
assertEquals(XSiteAdminOperations.SUCCESS, admin(LON, 1).setTakeOfflineAfterFailures(NYC, 8));
assertEquals(tom.getConfiguration(NYC), new TakeOfflineConfigurationBuilder(null, null).afterFailures(8).minTimeToWait(12).create());
assertEquals(XSiteAdminOperations.SUCCESS, admin(LON, 1).setTakeOfflineMinTimeToWait(NYC, 13));
assertEquals(tom.getConfiguration(NYC), new TakeOfflineConfigurationBuilder(null, null).afterFailures(8).minTimeToWait(13).create());
assertEquals(admin(LON, 0).getTakeOfflineAfterFailures(NYC), "8");
assertEquals(admin(LON, 0).getTakeOfflineMinTimeToWait(NYC), "13");
assertEquals(admin(LON, 1).getTakeOfflineAfterFailures(NYC), "8");
assertEquals(admin(LON, 1).getTakeOfflineMinTimeToWait(NYC), "13");
}
use of org.infinispan.configuration.cache.TakeOfflineConfigurationBuilder in project infinispan by infinispan.
the class OfflineStatus method amend.
public void amend(Integer afterFailures, Long minTimeToWait) {
TakeOfflineConfigurationBuilder builder = new TakeOfflineConfigurationBuilder(null, null);
builder.read(getTakeOffline());
if (afterFailures != null) {
builder.afterFailures(afterFailures);
}
if (minTimeToWait != null) {
builder.minTimeToWait(minTimeToWait);
}
amend(builder.create());
}
Aggregations