}
@Override
public void waitForCalmPeriod(@Nullable final Time timeout, @Nullable final Time window) {
try {
Time actualTimeout = timeout;
if (actualTimeout == null) {
actualTimeout = Time.minutes(1);
}
Time actualWindow = window;
if (actualWindow == null) {
actualWindow = Time.seconds(10);
}
LOG.info(
"Waiting for Nexus to not handle events for {} (timeouts in {})",
actualWindow.toString(), actualTimeout.toString()
);
final MultivaluedMap<String, String> params = new MultivaluedMapImpl();
params.add("timeout", String.valueOf(actualTimeout.toMillis()));
params.add("window", String.valueOf(actualWindow.toMillis()));
final ClientResponse response = getNexusClient()
.serviceResource("events/waitFor", params)
.get(ClientResponse.class);