Skip to content

Package: TriggerFactoryImpl

TriggerFactoryImpl

nameinstructionbranchcomplexitylinemethod
TriggerFactoryImpl()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
clone(Trigger)
M: 13 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
newCreator(KapuaId)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
newEntity(KapuaId)
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%
newListResult()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
newQuery(KapuaId)
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%
newTriggerProperty(String, String, String)
M: 7 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) 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.scheduler.trigger.quartz;
14:
15: import org.eclipse.kapua.KapuaEntityCloneException;
16: import org.eclipse.kapua.locator.KapuaProvider;
17: import org.eclipse.kapua.model.id.KapuaId;
18: import org.eclipse.kapua.service.scheduler.trigger.Trigger;
19: import org.eclipse.kapua.service.scheduler.trigger.TriggerCreator;
20: import org.eclipse.kapua.service.scheduler.trigger.TriggerFactory;
21: import org.eclipse.kapua.service.scheduler.trigger.TriggerListResult;
22: import org.eclipse.kapua.service.scheduler.trigger.TriggerQuery;
23: import org.eclipse.kapua.service.scheduler.trigger.definition.TriggerProperty;
24: import org.eclipse.kapua.service.scheduler.trigger.definition.quartz.TriggerPropertyImpl;
25:
26: /**
27: * {@link TriggerFactory} implementation.
28: *
29: * @since 1.0.0
30: */
31: @KapuaProvider
32: public class TriggerFactoryImpl implements TriggerFactory {
33:
34: @Override
35: public TriggerCreator newCreator(KapuaId scopeId) {
36: return new TriggerCreatorImpl(scopeId, null);
37: }
38:
39: @Override
40: public Trigger newEntity(KapuaId scopeId) {
41: return new TriggerImpl(scopeId);
42: }
43:
44: @Override
45: public TriggerQuery newQuery(KapuaId scopeId) {
46: return new TriggerQueryImpl(scopeId);
47: }
48:
49: @Override
50: public TriggerListResult newListResult() {
51: return new TriggerListResultImpl();
52: }
53:
54: @Override
55: public TriggerProperty newTriggerProperty(String name, String type, String value) {
56: return new TriggerPropertyImpl(name, type, value);
57: }
58:
59: @Override
60: public Trigger clone(Trigger trigger) {
61: try {
62: return new TriggerImpl(trigger);
63: } catch (Exception e) {
64: throw new KapuaEntityCloneException(e, Trigger.TYPE, trigger);
65: }
66: }
67: }