Search in sources :

Example 1 with ArrayOfTSURLLifetimeReturnStatus

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));
}
Also used : ArrayOfTSURLLifetimeReturnStatus(org.dcache.srm.v2_2.ArrayOfTSURLLifetimeReturnStatus) TSURLLifetimeReturnStatus(org.dcache.srm.v2_2.TSURLLifetimeReturnStatus) ArrayOfTSURLLifetimeReturnStatus(org.dcache.srm.v2_2.ArrayOfTSURLLifetimeReturnStatus) SrmExtendFileLifeTimeResponse(org.dcache.srm.v2_2.SrmExtendFileLifeTimeResponse)

Example 2 with ArrayOfTSURLLifetimeReturnStatus

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));
    }
}
Also used : ArrayOfTSURLLifetimeReturnStatus(org.dcache.srm.v2_2.ArrayOfTSURLLifetimeReturnStatus) JDC(org.dcache.srm.util.JDC) TSURLLifetimeReturnStatus(org.dcache.srm.v2_2.TSURLLifetimeReturnStatus) ArrayOfTSURLLifetimeReturnStatus(org.dcache.srm.v2_2.ArrayOfTSURLLifetimeReturnStatus) SrmExtendFileLifeTimeResponse(org.dcache.srm.v2_2.SrmExtendFileLifeTimeResponse)

Aggregations

ArrayOfTSURLLifetimeReturnStatus (org.dcache.srm.v2_2.ArrayOfTSURLLifetimeReturnStatus)2 SrmExtendFileLifeTimeResponse (org.dcache.srm.v2_2.SrmExtendFileLifeTimeResponse)2 TSURLLifetimeReturnStatus (org.dcache.srm.v2_2.TSURLLifetimeReturnStatus)2 JDC (org.dcache.srm.util.JDC)1