src/app/tasks/model/task-schedule.ts
Properties |
Methods |
|
constructor(name: string, taskName: string, cronExpression: string)
|
Defined in src/app/tasks/model/task-schedule.ts:21
|
Constructor |
Static fromJSON | ||||||||
fromJSON(input: )
|
||||||||
Defined in src/app/tasks/model/task-schedule.ts:41
|
||||||||
Create a TaskSchedule from JSON
Parameters :
Returns :
TaskSchedule
|
Static pageFromJSON | ||||||||
pageFromJSON(input: )
|
||||||||
Defined in src/app/tasks/model/task-schedule.ts:49
|
||||||||
Parameters :
Returns :
Page<TaskSchedule>
|
cronExpression |
cronExpression:
|
Type : string
|
Defined in src/app/tasks/model/task-schedule.ts:21
|
Cron Expression (trigger) |
name |
name:
|
Type : string
|
Defined in src/app/tasks/model/task-schedule.ts:11
|
Schedule name |
taskName |
taskName:
|
Type : string
|
Defined in src/app/tasks/model/task-schedule.ts:16
|
Task Definition name |
import { Page } from '../../shared/model/page';
export class TaskSchedule {
/**
* Schedule name
*/
name: string;
/**
* Task Definition name
*/
taskName: string;
/**
* Cron Expression (trigger)
*/
cronExpression: string;
/**
* Constructor
*
* @param {string} name
* @param {string} taskName
* @param {string} cronExpression
*/
constructor(name: string, taskName: string, cronExpression: string) {
this.name = name;
this.taskName = taskName;
this.cronExpression = cronExpression;
}
/**
* Create a TaskSchedule from JSON
* @param input
* @returns {TaskSchedule}
*/
static fromJSON(input): TaskSchedule {
let cron = '';
if (!!input.scheduleProperties) {
cron = input.scheduleProperties['spring.cloud.scheduler.cron.expression'];
}
return new TaskSchedule(input.scheduleName, input.taskDefinitionName, cron);
}
static pageFromJSON(input): Page<TaskSchedule> {
const page = Page.fromJSON<TaskSchedule>(input);
if (input && input._embedded && input._embedded.scheduleInfoResourceList) {
page.items = input._embedded.scheduleInfoResourceList.map(TaskSchedule.fromJSON);
}
return page;
}
}