use of org.dcache.srm.request.LsRequest in project dcache by dCache.
the class SchedulerContainerTests method shouldScheduleLsRequest.
@Test
public void shouldScheduleLsRequest() throws Exception {
LsRequest job = mockJob(LsRequest.class);
ArgumentCaptor<Scheduler> schedCapture = ArgumentCaptor.forClass(Scheduler.class);
container.schedule(job);
verify(job, times(1)).scheduleWith(schedCapture.capture());
assertThat(schedCapture.getValue(), is(lsScheduler));
}
use of org.dcache.srm.request.LsRequest in project dcache by dCache.
the class SrmLs method srmLs.
private SrmLsResponse srmLs() throws SRMInvalidRequestException, SRMInternalErrorException {
int numOfLevels = Math.min(getNumOfLevels(request), maxNumOfLevels);
int offset = getOffset(request);
int count = getCount(request);
boolean longFormat = getFullDetailedList(request);
URI[] surls = getSurls(request);
LsRequest r = new LsRequest(srm.getSrmId(), user, surls, TimeUnit.HOURS.toMillis(1), configuration.getLsMaxPollPeriod(), clientHost, count, offset, numOfLevels, longFormat, max_results_num);
try (JDC ignored = r.applyJdc()) {
srm.acceptNewJob(r);
return r.getSrmLsResponse(configuration.getLsSwitchToAsynchronousModeDelay());
} catch (InterruptedException e) {
throw new SRMInternalErrorException("Operation interrupted", e);
} catch (IllegalStateTransition e) {
throw new SRMInternalErrorException("Scheduling failure", e);
}
}
Aggregations