use of org.codice.alliance.nsili.common.GIAS.DelayEstimate in project alliance by codice.
the class SubmitStandingQueryRequestImpl method get_remaining_delay.
@Override
public DelayEstimate get_remaining_delay() throws ProcessingFault, SystemFault {
long delayUntilNextExec = executionThread.getNextExecutionTime() - System.currentTimeMillis();
int delayTimeSecs = (int) delayUntilNextExec / 1000;
return new DelayEstimate(delayTimeSecs, delayTimeSecs > 0);
}
use of org.codice.alliance.nsili.common.GIAS.DelayEstimate in project alliance by codice.
the class SubmitStandingQueryRequestImplTest method testExecutionTimes.
@Test
public void testExecutionTimes() throws SystemFault, ProcessingFault {
AbsTime lastExec = standingQueryRequest.get_time_last_executed();
assertThat(lastExec, notNullValue());
AbsTime nextExec = standingQueryRequest.get_time_next_execution();
assertThat(nextExec, notNullValue());
DelayEstimate delayEstimate = standingQueryRequest.get_remaining_delay();
assertThat(delayEstimate, notNullValue());
}
use of org.codice.alliance.nsili.common.GIAS.DelayEstimate in project alliance by codice.
the class OrderRequestImplTest method getRemainingDelay.
@Test
public void getRemainingDelay() throws SystemFault, ProcessingFault {
OrderContents order = getUncompressedTestOrder();
OrderRequestImpl orderRequest = new OrderRequestImpl(order, PROTOCOL, PORT, accessManager, mockCatalogFramework, emailConfiguration);
DelayEstimate delayEstimate = orderRequest.get_remaining_delay();
assertThat(delayEstimate, notNullValue());
}
Aggregations