Search in sources :

Example 1 with SrmAbortRequestResponse

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

the class SRMAbortRequestClientV2 method start.

@Override
public void start() throws Exception {
    checkCredentialValid();
    for (String requestToken : configuration.getArrayOfRequestTokens()) {
        try {
            SrmAbortRequestRequest request = new SrmAbortRequestRequest();
            request.setRequestToken(requestToken);
            SrmAbortRequestResponse response = srm.srmAbortRequest(request);
            if (response == null) {
                throw new IOException(" null SrmAbortRequestResponse for request token " + requestToken);
            }
            TReturnStatus rs = response.getReturnStatus();
            if (rs == null) {
                throw new IOException(" null TReturnStatus for request token " + requestToken);
            }
            if (RequestStatusTool.isFailedRequestStatus(rs)) {
                throw new IOException("SrmAbortRequest failed for " + requestToken + ",  : " + rs.getStatusCode() + " explanation=" + rs.getExplanation());
            }
        } catch (Exception e) {
            throw e;
        }
    }
}
Also used : SrmAbortRequestResponse(org.dcache.srm.v2_2.SrmAbortRequestResponse) SrmAbortRequestRequest(org.dcache.srm.v2_2.SrmAbortRequestRequest) TReturnStatus(org.dcache.srm.v2_2.TReturnStatus) IOException(java.io.IOException) IOException(java.io.IOException)

Example 2 with SrmAbortRequestResponse

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

the class SRMLsClientV2 method abortRequest.

public void abortRequest() throws Exception {
    SrmAbortRequestRequest abortRequest = new SrmAbortRequestRequest();
    abortRequest.setRequestToken(requestToken);
    SrmAbortRequestResponse abortResponse = srm.srmAbortRequest(abortRequest);
    if (abortResponse == null) {
        logger.elog(" SrmAbort is null");
    } else {
        TReturnStatus returnStatus = abortResponse.getReturnStatus();
        if (returnStatus == null) {
            esay("srmAbort return status is null");
            return;
        }
        say("srmAbortRequest status code=" + returnStatus.getStatusCode());
    }
}
Also used : SrmAbortRequestResponse(org.dcache.srm.v2_2.SrmAbortRequestResponse) SrmAbortRequestRequest(org.dcache.srm.v2_2.SrmAbortRequestRequest) TReturnStatus(org.dcache.srm.v2_2.TReturnStatus)

Example 3 with SrmAbortRequestResponse

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

the class SRMReserveSpaceClientV2 method abortRequest.

public void abortRequest() throws Exception {
    SrmAbortRequestRequest abortRequest = new SrmAbortRequestRequest();
    abortRequest.setRequestToken(requestToken);
    SrmAbortRequestResponse abortResponse = srm.srmAbortRequest(abortRequest);
    if (abortResponse == null) {
        logger.elog(" SrmAbort is null");
    } else {
        TReturnStatus returnStatus = abortResponse.getReturnStatus();
        if (returnStatus == null) {
            esay("srmAbort return status is null");
            return;
        }
        say("srmAbortRequest status code=" + returnStatus.getStatusCode());
    }
}
Also used : SrmAbortRequestResponse(org.dcache.srm.v2_2.SrmAbortRequestResponse) SrmAbortRequestRequest(org.dcache.srm.v2_2.SrmAbortRequestRequest) TReturnStatus(org.dcache.srm.v2_2.TReturnStatus)

Aggregations

SrmAbortRequestRequest (org.dcache.srm.v2_2.SrmAbortRequestRequest)3 SrmAbortRequestResponse (org.dcache.srm.v2_2.SrmAbortRequestResponse)3 TReturnStatus (org.dcache.srm.v2_2.TReturnStatus)3 IOException (java.io.IOException)1