Search in sources :

Example 1 with DelayEstimate

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);
}
Also used : DelayEstimate(org.codice.alliance.nsili.common.GIAS.DelayEstimate) NsiliEndpoint(org.codice.alliance.nsili.endpoint.NsiliEndpoint)

Example 2 with DelayEstimate

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());
}
Also used : AbsTime(org.codice.alliance.nsili.common.UCO.AbsTime) DelayEstimate(org.codice.alliance.nsili.common.GIAS.DelayEstimate) Test(org.junit.Test)

Example 3 with DelayEstimate

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());
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) DelayEstimate(org.codice.alliance.nsili.common.GIAS.DelayEstimate) Test(org.junit.Test)

Aggregations

DelayEstimate (org.codice.alliance.nsili.common.GIAS.DelayEstimate)3 Test (org.junit.Test)2 OrderContents (org.codice.alliance.nsili.common.GIAS.OrderContents)1 AbsTime (org.codice.alliance.nsili.common.UCO.AbsTime)1 NsiliEndpoint (org.codice.alliance.nsili.endpoint.NsiliEndpoint)1