Skip to content

Package: JobService

JobService

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.job;
14:
15: import org.eclipse.kapua.KapuaException;
16: import org.eclipse.kapua.model.id.KapuaId;
17: import org.eclipse.kapua.model.query.KapuaQuery;
18: import org.eclipse.kapua.service.KapuaEntityService;
19: import org.eclipse.kapua.service.KapuaUpdatableEntityService;
20: import org.eclipse.kapua.service.config.KapuaConfigurableService;
21:
22: /**
23: * {@link JobService} exposes APIs to manage Job objects.<br>
24: * It includes APIs to create, update, find, list and delete Jobs.<br>
25: * Instances of the JobService can be acquired through the ServiceLocator object.
26: *
27: * @since 1.0
28: */
29: public interface JobService extends KapuaEntityService<Job, JobCreator>,
30: KapuaUpdatableEntityService<Job>,
31: KapuaConfigurableService {
32:
33: /**
34: * Returns the {@link JobListResult} with elements matching the provided query.
35: *
36: * @param query The {@link JobQuery} used to filter results.
37: * @return The {@link JobListResult} with elements matching the query parameter.
38: * @throws KapuaException
39: * @since 1.0.0
40: */
41: @Override
42: JobListResult query(KapuaQuery query) throws KapuaException;
43:
44: /**
45: * Forcibly deletes a {@link Job} and all of its related data without checking for {@link org.eclipse.kapua.service.job.execution.JobExecution}s.
46: *
47: * @param scopeId The {@link KapuaId} scopeId of the {@link Job}.
48: * @param jobId The {@link KapuaId} of the {@link Job}.
49: * @throws KapuaException
50: * @since 1.1.0
51: */
52: void deleteForced(KapuaId scopeId, KapuaId jobId) throws KapuaException;
53:
54: }