Search in sources :

Example 1 with ArrayOfTBringOnlineRequestFileStatus

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

the class BringOnlineRequest method getSrmBringOnlineResponse.

private final SrmBringOnlineResponse getSrmBringOnlineResponse() throws SRMInvalidRequestException {
    SrmBringOnlineResponse response = new SrmBringOnlineResponse();
    response.setReturnStatus(getTReturnStatus());
    response.setRequestToken(getTRequestToken());
    ArrayOfTBringOnlineRequestFileStatus arrayOfTBringOnlineRequestFileStatus = new ArrayOfTBringOnlineRequestFileStatus();
    arrayOfTBringOnlineRequestFileStatus.setStatusArray(getArrayOfTBringOnlineRequestFileStatus());
    response.setArrayOfFileStatuses(arrayOfTBringOnlineRequestFileStatus);
    response.setRemainingTotalRequestTime(getRemainingLifetimeIn(TimeUnit.SECONDS));
    return response;
}
Also used : ArrayOfTBringOnlineRequestFileStatus(org.dcache.srm.v2_2.ArrayOfTBringOnlineRequestFileStatus) SrmBringOnlineResponse(org.dcache.srm.v2_2.SrmBringOnlineResponse)

Example 2 with ArrayOfTBringOnlineRequestFileStatus

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

the class BringOnlineRequest method getSrmStatusOfBringOnlineRequestResponse.

public final SrmStatusOfBringOnlineRequestResponse getSrmStatusOfBringOnlineRequestResponse(org.apache.axis.types.URI[] surls) throws SRMInvalidRequestException {
    SrmStatusOfBringOnlineRequestResponse response = new SrmStatusOfBringOnlineRequestResponse();
    response.setReturnStatus(getTReturnStatus());
    TBringOnlineRequestFileStatus[] statusArray = getArrayOfTBringOnlineRequestFileStatus(surls);
    response.setArrayOfFileStatuses(new ArrayOfTBringOnlineRequestFileStatus(statusArray));
    if (LOGGER.isDebugEnabled()) {
        StringBuilder sb = new StringBuilder("getSrmStatusOfBringOnlineRequestResponse:");
        sb.append(" StatusCode = ").append(response.getReturnStatus().getStatusCode());
        if (statusArray.length > 0) {
            sb.append(" FileStatusCodes =");
        }
        Arrays.stream(statusArray).map(s -> s.getStatus().getStatusCode()).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).forEach((k, v) -> sb.append(" ").append(k).append(" (").append(v).append(" times)"));
        LOGGER.debug(sb.toString());
    }
    response.setRemainingTotalRequestTime(getRemainingLifetimeIn(TimeUnit.SECONDS));
    return response;
}
Also used : ArrayOfTBringOnlineRequestFileStatus(org.dcache.srm.v2_2.ArrayOfTBringOnlineRequestFileStatus) ArrayOfTBringOnlineRequestFileStatus(org.dcache.srm.v2_2.ArrayOfTBringOnlineRequestFileStatus) TBringOnlineRequestFileStatus(org.dcache.srm.v2_2.TBringOnlineRequestFileStatus) SrmStatusOfBringOnlineRequestResponse(org.dcache.srm.v2_2.SrmStatusOfBringOnlineRequestResponse)

Aggregations

ArrayOfTBringOnlineRequestFileStatus (org.dcache.srm.v2_2.ArrayOfTBringOnlineRequestFileStatus)2 SrmBringOnlineResponse (org.dcache.srm.v2_2.SrmBringOnlineResponse)1 SrmStatusOfBringOnlineRequestResponse (org.dcache.srm.v2_2.SrmStatusOfBringOnlineRequestResponse)1 TBringOnlineRequestFileStatus (org.dcache.srm.v2_2.TBringOnlineRequestFileStatus)1