Search in sources :

Example 1 with SrmGetTransferProtocolsResponse

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

the class AxisSrmFileSystem method getTransferProtocols.

@Nonnull
@Override
public TSupportedTransferProtocol[] getTransferProtocols() throws SRMException, RemoteException {
    SrmGetTransferProtocolsResponse response = srm.srmGetTransferProtocols(new SrmGetTransferProtocolsRequest());
    checkSuccess(response.getReturnStatus());
    TSupportedTransferProtocol[] protocolArray = response.getProtocolInfo().getProtocolArray();
    return (protocolArray == null) ? new TSupportedTransferProtocol[0] : protocolArray;
}
Also used : SrmGetTransferProtocolsRequest(org.dcache.srm.v2_2.SrmGetTransferProtocolsRequest) SrmGetTransferProtocolsResponse(org.dcache.srm.v2_2.SrmGetTransferProtocolsResponse) TSupportedTransferProtocol(org.dcache.srm.v2_2.TSupportedTransferProtocol) Nonnull(javax.annotation.Nonnull)

Example 2 with SrmGetTransferProtocolsResponse

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

the class SrmGetTransferProtocols method getResponse.

public SrmGetTransferProtocolsResponse getResponse() {
    if (response == null) {
        try {
            TSupportedTransferProtocol[] protocols = getSupportedTransferProtocols();
            response = new SrmGetTransferProtocolsResponse(new TReturnStatus(TStatusCode.SRM_SUCCESS, null), new ArrayOfTSupportedTransferProtocol(protocols));
        } catch (SRMInternalErrorException e) {
            LOGGER.error(e.getMessage());
            response = getFailedResponse(e.getMessage(), TStatusCode.SRM_INTERNAL_ERROR);
        }
    }
    return response;
}
Also used : SRMInternalErrorException(org.dcache.srm.SRMInternalErrorException) TReturnStatus(org.dcache.srm.v2_2.TReturnStatus) ArrayOfTSupportedTransferProtocol(org.dcache.srm.v2_2.ArrayOfTSupportedTransferProtocol) SrmGetTransferProtocolsResponse(org.dcache.srm.v2_2.SrmGetTransferProtocolsResponse) ArrayOfTSupportedTransferProtocol(org.dcache.srm.v2_2.ArrayOfTSupportedTransferProtocol) TSupportedTransferProtocol(org.dcache.srm.v2_2.TSupportedTransferProtocol)

Example 3 with SrmGetTransferProtocolsResponse

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

the class SrmGetTransferProtocols method getFailedResponse.

public static final SrmGetTransferProtocolsResponse getFailedResponse(String error, TStatusCode statusCode) {
    SrmGetTransferProtocolsResponse response = new SrmGetTransferProtocolsResponse();
    response.setReturnStatus(new TReturnStatus(statusCode, error));
    return response;
}
Also used : TReturnStatus(org.dcache.srm.v2_2.TReturnStatus) SrmGetTransferProtocolsResponse(org.dcache.srm.v2_2.SrmGetTransferProtocolsResponse)

Aggregations

SrmGetTransferProtocolsResponse (org.dcache.srm.v2_2.SrmGetTransferProtocolsResponse)3 TReturnStatus (org.dcache.srm.v2_2.TReturnStatus)2 TSupportedTransferProtocol (org.dcache.srm.v2_2.TSupportedTransferProtocol)2 Nonnull (javax.annotation.Nonnull)1 SRMInternalErrorException (org.dcache.srm.SRMInternalErrorException)1 ArrayOfTSupportedTransferProtocol (org.dcache.srm.v2_2.ArrayOfTSupportedTransferProtocol)1 SrmGetTransferProtocolsRequest (org.dcache.srm.v2_2.SrmGetTransferProtocolsRequest)1