@Test(expected = IllegalArgumentException.class) public void testSuspendInSecondsWithZeroSeconds() { TransmissionPolicyManager tested = new TransmissionPolicyManager(true); tested.suspendInSeconds(TransmissionPolicy.BLOCKED_AND_CANNOT_BE_PERSISTED, 0); }
public void suspendInSeconds(TransmissionPolicy policy, long suspendInSeconds) { if (!throttlingIsEnabled) { return; } Preconditions.checkArgument(suspendInSeconds > 0, "Suspension must be greater than zero"); createScheduler(); doSuspend(policy, suspendInSeconds); }
TransmissionPolicyManager implements Stoppable, TransmissionHandlerObserver { public void suspendInSeconds(TransmissionPolicy policy, long suspendInSeconds) { if (!throttlingIsEnabled) { return; } Preconditions.checkArgument(suspendInSeconds > 0, "Suspension must be greater than zero"); createScheduler(); doSuspend(policy, suspendInSeconds); } }
TransmissionPolicyManager implements Stoppable, TransmissionHandlerObserver { public void suspendInSeconds(TransmissionPolicy policy, long suspendInSeconds) { if (!throttlingIsEnabled) { return; } Preconditions.checkArgument(suspendInSeconds > 0, "Suspension must be greater than zero"); createScheduler(); doSuspend(policy, suspendInSeconds); } TransmissionPolicyManager(boolean throttlingIsEnabled); }
TransmissionPolicyManager implements Stoppable, TransmissionHandlerObserver { public void suspendInSeconds(TransmissionPolicy policy, long suspendInSeconds) { if (!throttlingIsEnabled) { return; } Preconditions.checkArgument(suspendInSeconds > 0, "Suspension must be greater than zero"); createScheduler(); doSuspend(policy, suspendInSeconds); } TransmissionPolicyManager(boolean throttlingIsEnabled); void backoff(); void clearBackoff(); void suspendInSeconds(TransmissionPolicy policy, long suspendInSeconds); @Override synchronized void stop(long timeout, TimeUnit timeUnit); TransmissionPolicyStateFetcher getTransmissionPolicyState(); @Override void onTransmissionSent(TransmissionHandlerArgs transmissionArgs); @Override void addTransmissionHandler(TransmissionHandler handler); void setMaxInstantRetries(int maxInstantRetries); int getMaxInstantRetries(); }
TransmissionPolicyManager implements Stoppable, TransmissionHandlerObserver { public void suspendInSeconds(TransmissionPolicy policy, long suspendInSeconds) { if (!throttlingIsEnabled) { return; } Preconditions.checkArgument(suspendInSeconds > 0, "Suspension must be greater than zero"); createScheduler(); doSuspend(policy, suspendInSeconds); } TransmissionPolicyManager(boolean throttlingIsEnabled); void backoff(); void clearBackoff(); void suspendInSeconds(TransmissionPolicy policy, long suspendInSeconds); @Override synchronized void stop(long timeout, TimeUnit timeUnit); TransmissionPolicyStateFetcher getTransmissionPolicyState(); @Override void onTransmissionSent(TransmissionHandlerArgs transmissionArgs); @Override void addTransmissionHandler(TransmissionHandler handler); void setMaxInstantRetries(int maxInstantRetries); int getMaxInstantRetries();  }