Search in sources :

Example 1 with ApplicationTaskResponse

use of com.webank.wedatasphere.qualitis.response.ApplicationTaskResponse in project Qualitis by WeBankFinTech.

the class OuterExecutionServiceImpl method getApplicationStatus.

@Override
public GeneralResponse<?> getApplicationStatus(String applicationId) throws UnExpectedRequestException {
    // Find application by applicationId
    Application application = applicationDao.findById(applicationId);
    if (application == null) {
        throw new UnExpectedRequestException("Application_id {&DOES_NOT_EXIST}");
    }
    LOGGER.info("Succeed to find application. application: {}", application);
    List<Task> tasks = taskDao.findByApplication(application);
    ApplicationTaskResponse response = new ApplicationTaskResponse(application, tasks);
    LOGGER.info("Succeed to get application status. response: {}", response);
    return new GeneralResponse<>("200", "{&SUCCEED_TO_GET_APPLICATION_STATUS}", response);
}
Also used : GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) Task(com.webank.wedatasphere.qualitis.entity.Task) ApplicationTaskResponse(com.webank.wedatasphere.qualitis.response.ApplicationTaskResponse) Application(com.webank.wedatasphere.qualitis.entity.Application)

Example 2 with ApplicationTaskResponse

use of com.webank.wedatasphere.qualitis.response.ApplicationTaskResponse in project Qualitis by WeBankFinTech.

the class OuterExecutionServiceImpl method getApplicationDynamicStatus.

@Override
public GeneralResponse<?> getApplicationDynamicStatus(String applicationId) throws UnExpectedRequestException {
    // Find application by applicationId
    Application application = applicationDao.findById(applicationId);
    if (application == null) {
        throw new UnExpectedRequestException("Application_id {&DOES_NOT_EXIST}");
    }
    LOGGER.info("Succeed to find application. application: {}", application);
    return new GeneralResponse<>("200", "{&SUCCEED_TO_GET_APPLICATION_STATUS}", new ApplicationTaskResponse(application));
}
Also used : GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) ApplicationTaskResponse(com.webank.wedatasphere.qualitis.response.ApplicationTaskResponse) Application(com.webank.wedatasphere.qualitis.entity.Application)

Aggregations

Application (com.webank.wedatasphere.qualitis.entity.Application)2 UnExpectedRequestException (com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException)2 ApplicationTaskResponse (com.webank.wedatasphere.qualitis.response.ApplicationTaskResponse)2 GeneralResponse (com.webank.wedatasphere.qualitis.response.GeneralResponse)2 Task (com.webank.wedatasphere.qualitis.entity.Task)1