Search in sources :

Example 1 with RestApiJobStatistics

use of com.vip.saturn.job.console.domain.RestApiJobStatistics in project Saturn by vipshop.

the class RestApiServiceImpl method constructJobInfo.

private RestApiJobInfo constructJobInfo(CuratorRepository.CuratorFrameworkOp curatorFrameworkOp, String job) {
    RestApiJobInfo restApiJobInfo = new RestApiJobInfo();
    restApiJobInfo.setJobName(job);
    // 设置作业配置信息
    setJobConfig(curatorFrameworkOp, restApiJobInfo, job);
    // 设置运行状态
    setRunningStatus(curatorFrameworkOp, restApiJobInfo, job);
    // 设置统计信息
    RestApiJobStatistics restApiJobStatistics = new RestApiJobStatistics();
    setStatics(curatorFrameworkOp, restApiJobStatistics, job);
    restApiJobInfo.setStatistics(restApiJobStatistics);
    return restApiJobInfo;
}
Also used : RestApiJobStatistics(com.vip.saturn.job.console.domain.RestApiJobStatistics) RestApiJobInfo(com.vip.saturn.job.console.domain.RestApiJobInfo)

Example 2 with RestApiJobStatistics

use of com.vip.saturn.job.console.domain.RestApiJobStatistics in project Saturn by vipshop.

the class JobOperationRestApiControllerTest method constructJobInfo.

private RestApiJobInfo constructJobInfo(String domain, String jobName) {
    RestApiJobInfo jobInfo = new RestApiJobInfo();
    jobInfo.setJobName(jobName);
    jobInfo.setEnabled(true);
    jobInfo.setDescription("this is a decription of " + jobName);
    RestApiJobConfig jobConfig = new RestApiJobConfig();
    jobConfig.setCron("0 */1 * * * ?");
    jobInfo.setJobConfig(jobConfig);
    RestApiJobStatistics statistics = new RestApiJobStatistics();
    statistics.setNextFireTime(1234567L);
    jobInfo.setStatistics(statistics);
    return jobInfo;
}
Also used : RestApiJobStatistics(com.vip.saturn.job.console.domain.RestApiJobStatistics) RestApiJobConfig(com.vip.saturn.job.console.domain.RestApiJobConfig) RestApiJobInfo(com.vip.saturn.job.console.domain.RestApiJobInfo)

Aggregations

RestApiJobInfo (com.vip.saturn.job.console.domain.RestApiJobInfo)2 RestApiJobStatistics (com.vip.saturn.job.console.domain.RestApiJobStatistics)2 RestApiJobConfig (com.vip.saturn.job.console.domain.RestApiJobConfig)1