Search in sources :

Example 1 with SrmReleaseSpaceResponse

use of org.dcache.srm.v2_2.SrmReleaseSpaceResponse in project dcache by dCache.

the class SRMReleaseSpaceClientV2 method start.

@Override
public void start() throws Exception {
    checkCredentialValid();
    try {
        request.setSpaceToken(configuration.getSpaceToken());
        request.setForceFileRelease(configuration.getForceFileRelease());
        configuration.getStorageSystemInfo().ifPresent(request::setStorageSystemInfo);
        SrmReleaseSpaceResponse response = srm.srmReleaseSpace(request);
        if (response == null) {
            throw new IOException(" null SrmReleaseSpace");
        }
        TReturnStatus rs = response.getReturnStatus();
        if (rs == null) {
            throw new IOException(" null TReturnStatus ");
        }
        if (RequestStatusTool.isFailedRequestStatus(rs)) {
            throw new IOException("srmReleaseSpace submission failed, unexpected or failed return status : " + rs.getStatusCode() + " explanation=" + rs.getExplanation());
        }
    } catch (Exception e) {
        throw e;
    }
}
Also used : SrmReleaseSpaceResponse(org.dcache.srm.v2_2.SrmReleaseSpaceResponse) TReturnStatus(org.dcache.srm.v2_2.TReturnStatus) IOException(java.io.IOException) IOException(java.io.IOException)

Example 2 with SrmReleaseSpaceResponse

use of org.dcache.srm.v2_2.SrmReleaseSpaceResponse in project dcache by dCache.

the class AxisSrmFileSystem method releaseSpace.

@Override
public void releaseSpace(String spaceToken) throws RemoteException, SRMException {
    SrmReleaseSpaceResponse response = srm.srmReleaseSpace(new SrmReleaseSpaceRequest(null, spaceToken, null, null));
    checkSuccess(response.getReturnStatus());
}
Also used : SrmReleaseSpaceResponse(org.dcache.srm.v2_2.SrmReleaseSpaceResponse) SrmReleaseSpaceRequest(org.dcache.srm.v2_2.SrmReleaseSpaceRequest)

Example 3 with SrmReleaseSpaceResponse

use of org.dcache.srm.v2_2.SrmReleaseSpaceResponse in project dcache by dCache.

the class SrmReleaseSpace method releaseSpace.

private SrmReleaseSpaceResponse releaseSpace() {
    String token = request.getSpaceToken();
    Callback callback = new Callback();
    storage.srmReleaseSpace(user, token, null, callback);
    TReturnStatus status = callback.waitResult(TIMEOUT);
    return new SrmReleaseSpaceResponse(status);
}
Also used : SrmReleaseSpaceCallback(org.dcache.srm.SrmReleaseSpaceCallback) TReturnStatus(org.dcache.srm.v2_2.TReturnStatus) SrmReleaseSpaceResponse(org.dcache.srm.v2_2.SrmReleaseSpaceResponse)

Aggregations

SrmReleaseSpaceResponse (org.dcache.srm.v2_2.SrmReleaseSpaceResponse)3 TReturnStatus (org.dcache.srm.v2_2.TReturnStatus)2 IOException (java.io.IOException)1 SrmReleaseSpaceCallback (org.dcache.srm.SrmReleaseSpaceCallback)1 SrmReleaseSpaceRequest (org.dcache.srm.v2_2.SrmReleaseSpaceRequest)1