org.eclipse.dirigible.engine.job.synchronizer.JobSynchronizerJobDefinitionProvider Maven / Gradle / Ivy
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.dirigible.engine.job.synchronizer;
import org.eclipse.dirigible.commons.config.Configuration;
import org.eclipse.dirigible.core.scheduler.api.IJobDefinitionProvider;
import org.eclipse.dirigible.core.scheduler.api.ISchedulerCoreService;
import org.eclipse.dirigible.core.scheduler.service.definition.JobDefinition;
/**
* The Class JobSynchronizerJobDefinitionProvider.
*/
public class JobSynchronizerJobDefinitionProvider implements IJobDefinitionProvider {
/** The Constant DIRIGIBLE_JOB_EXPRESSION_JOBS. */
private static final String DIRIGIBLE_JOB_EXPRESSION_JOBS = "DIRIGIBLE_JOB_EXPRESSION_JOBS";
/** The Constant DIRIGIBLE_INTERNAL_JOB_SYNCHRONIZER_JOB. */
private static final String DIRIGIBLE_INTERNAL_JOB_SYNCHRONIZER_JOB = "dirigible-internal-job-synchronizer-job";
/** The Constant JOB_SYNCHRONIZER_JOB. */
static final String JOB_SYNCHRONIZER_JOB = "Job Synchronizer Job";
/**
* Gets the job definition.
*
* @return the job definition
*/
/*
* (non-Javadoc)
* @see org.eclipse.dirigible.core.scheduler.api.IJobDefinitionProvider#getJobDefinition()
*/
@Override
public JobDefinition getJobDefinition() {
JobDefinition jobDefinition = new JobDefinition();
jobDefinition.setName(DIRIGIBLE_INTERNAL_JOB_SYNCHRONIZER_JOB);
jobDefinition.setGroup(ISchedulerCoreService.JOB_GROUP_INTERNAL);
jobDefinition.setClazz(JobSynchronizerJob.class.getCanonicalName());
jobDefinition.setDescription(JOB_SYNCHRONIZER_JOB);
String expression = Configuration.get(DIRIGIBLE_JOB_EXPRESSION_JOBS, "0/15 * * * * ?");
jobDefinition.setExpression(expression);
jobDefinition.setSingleton(true);
return jobDefinition;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy