Skip to content

Package: JbatchJobRunningStatuses

JbatchJobRunningStatuses

nameinstructionbranchcomplexitylinemethod
JbatchJobRunningStatuses()
M: 21 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getStatuses()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2018, 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.job.engine.jbatch.driver;
14:
15: import com.google.common.collect.Lists;
16:
17: import javax.batch.runtime.BatchStatus;
18: import java.util.ArrayList;
19: import java.util.List;
20:
21: /**
22: * This {@link List} identifies the running statuses of a Jbatch job.
23: * <p>
24: * {@link List} contains {@link BatchStatus}es:
25: * <ul>
26: * <li>BatchStatus.STARTED</li>
27: * <li>BatchStatus.STARTING</li>
28: * <li>BatchStatus.STOPPING</li>
29: * </ul>
30: * <p>
31: * They can be retrieved as a singleton with {@link #getStatuses()}
32: *
33: * @since 1.0.0
34: */
35: public class JbatchJobRunningStatuses extends ArrayList<BatchStatus> implements List<BatchStatus> {
36:
37: private static final JbatchJobRunningStatuses STATUSES = new JbatchJobRunningStatuses();
38:
39: private JbatchJobRunningStatuses() {
40: addAll(Lists.newArrayList(BatchStatus.STARTED, BatchStatus.STARTING, BatchStatus.STOPPING));
41: }
42:
43: public static JbatchJobRunningStatuses getStatuses() {
44: return STATUSES;
45: }
46: }