use of org.dcache.srm.v2_2.ArrayOfTSURLLifetimeReturnStatus in project dcache by dCache.
the class SrmExtendFileLifeTime method extendSurlLifeTime.
private SrmExtendFileLifeTimeResponse extendSurlLifeTime(org.apache.axis.types.URI[] surls, int newFileLifetime) throws SRMInternalErrorException {
long newLifetimeInMillis = toMillis(newFileLifetime, Long.MAX_VALUE);
int len = surls.length;
TSURLLifetimeReturnStatus[] surlStatus = new TSURLLifetimeReturnStatus[len];
for (int i = 0; i < len; ++i) {
surlStatus[i] = extendSurlLifeTime(surls[i], newLifetimeInMillis);
}
return new SrmExtendFileLifeTimeResponse(getSummaryReturnStatus(surlStatus), new ArrayOfTSURLLifetimeReturnStatus(surlStatus));
}
use of org.dcache.srm.v2_2.ArrayOfTSURLLifetimeReturnStatus in project dcache by dCache.
the class SrmExtendFileLifeTime method extendTurlOrPinLifeTime.
private SrmExtendFileLifeTimeResponse extendTurlOrPinLifeTime(String requestToken, org.apache.axis.types.URI[] surls, int newLifetime) throws SRMInvalidRequestException, SRMInternalErrorException {
ContainerRequest<?> containerRequest = Request.getRequest(requestToken, ContainerRequest.class);
try (JDC ignored = containerRequest.applyJdc()) {
long maxLifetime = getMaxLifetime(containerRequest);
long newLifetimeInMillis = toMillis(newLifetime, maxLifetime);
int len = surls.length;
TSURLLifetimeReturnStatus[] surlStatus = new TSURLLifetimeReturnStatus[len];
for (int i = 0; i < len; ++i) {
surlStatus[i] = extendTurlOrPinLifeTime(containerRequest, surls[i], newLifetimeInMillis);
}
return new SrmExtendFileLifeTimeResponse(getSummaryReturnStatus(surlStatus), new ArrayOfTSURLLifetimeReturnStatus(surlStatus));
}
}
Aggregations