コード例 #1
0
  private RequestStatus convert(final SingleNodeProgress progress) {

    final SingleNodeRequestStatus status = new SingleNodeRequestStatus();
    status.setNodeUrn(new NodeUrn(progress.getNodeUrn()));
    status.setValue(progress.getProgressInPercent());
    status.setCompleted(false);
    status.setSuccess(false);

    final RequestStatus requestStatus = new RequestStatus();
    requestStatus.setRequestId(progress.getRequestId());
    requestStatus.getSingleNodeRequestStatus().add(status);

    return requestStatus;
  }
コード例 #2
0
  private RequestStatus convert(final SingleNodeResponse response) {

    final SingleNodeRequestStatus status = new SingleNodeRequestStatus();
    status.setNodeUrn(new NodeUrn(response.getNodeUrn()));
    status.setValue(response.getStatusCode());
    status.setCompleted(true);
    status.setSuccess(!response.hasErrorMessage());
    if (response.hasErrorMessage()) {
      status.setMsg(response.getErrorMessage());
    }

    final RequestStatus requestStatus = new RequestStatus();
    requestStatus.setRequestId(response.getRequestId());
    requestStatus.getSingleNodeRequestStatus().add(status);

    return requestStatus;
  }