Skip to contentPackage: Trigger
Trigger
name | instruction | branch | complexity | line | method |
---|
getType() |
|
|
|
|
|
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;
14:
15: import org.eclipse.kapua.model.KapuaNamedEntity;
16: import org.eclipse.kapua.model.id.KapuaId;
17: import org.eclipse.kapua.model.id.KapuaIdAdapter;
18: import org.eclipse.kapua.service.scheduler.trigger.definition.TriggerProperty;
19:
20: import javax.xml.bind.annotation.XmlAccessType;
21: import javax.xml.bind.annotation.XmlAccessorType;
22: import javax.xml.bind.annotation.XmlRootElement;
23: import javax.xml.bind.annotation.XmlType;
24: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
25: import java.util.Date;
26: import java.util.List;
27:
28: /**
29: * {@link Trigger} {@link KapuaNamedEntity} definition.
30: *
31: * @see org.eclipse.kapua.model.KapuaNamedEntity
32: * @since 1.0.0
33: */
34: @XmlRootElement(name = "schedule")
35: @XmlAccessorType(XmlAccessType.PROPERTY)
36: @XmlType(factoryClass = TriggerXmlRegistry.class, factoryMethod = "newEntity")
37: public interface Trigger extends KapuaNamedEntity {
38:
39: String TYPE = "trigger";
40:
41: @Override
42: default String getType() {
43: return TYPE;
44: }
45:
46: /**
47: * Gets the start {@link Date} from which this {@link Trigger} is valid.
48: *
49: * @return The start {@link Date} from which this {@link Trigger} is valid.
50: * @since 1.0.0
51: */
52: Date getStartsOn();
53:
54: /**
55: * Sets the start {@link Date} from which this {@link Trigger} is valid.
56: *
57: * @param starstOn The start {@link Date} from which this {@link Trigger} is valid.
58: * @since 1.0.0
59: */
60: void setStartsOn(Date starstOn);
61:
62: /**
63: * Gets the end {@link Date} until which this {@link Trigger} is valid.
64: * <p>
65: * {@code null} means that never expires.
66: *
67: * @return The start {@link Date} from which this {@link Trigger} is valid.
68: * @since 1.0.0
69: */
70: Date getEndsOn();
71:
72: /**
73: * Gets the end {@link Date} until which this {@link Trigger} is valid.
74: * <p>
75: * {@code null} means that never expires.
76: *
77: * @param endsOn The end {@link Date} until which this {@link Trigger} is valid.
78: * @since 1.0.0
79: */
80: void setEndsOn(Date endsOn);
81:
82: /**
83: * Gets the CRON scheduling.
84: * <p>
85: * This field is {@code deprecated}. Please make use of {@link org.eclipse.kapua.service.scheduler.trigger.definition.TriggerDefinition} and {@link TriggerProperty}es.
86: *
87: * @return The CRON scheduling.
88: * @since 1.0.0
89: * @deprecated since 1.1.0
90: */
91: @Deprecated
92: String getCronScheduling();
93:
94: /**
95: * Sets the CRON scheduling.
96: * <p>
97: * This field is {@code deprecated}. Please make use of {@link org.eclipse.kapua.service.scheduler.trigger.definition.TriggerDefinition} and {@link TriggerProperty}es.
98: *
99: * @param cronScheduling The CRON scheduling.
100: * @since 1.0.0
101: * @deprecated since 1.1.0
102: */
103: @Deprecated
104: void setCronScheduling(String cronScheduling);
105:
106: /**
107: * Gets the retry interval.
108: * <p>
109: * This field is {@code deprecated}. Please make use of {@link org.eclipse.kapua.service.scheduler.trigger.definition.TriggerDefinition} and {@link TriggerProperty}es.
110: *
111: * @return The retry interval.
112: * @since 1.0.0
113: * @deprecated since 1.1.0
114: */
115: @Deprecated
116: Long getRetryInterval();
117:
118: /**
119: * Sets the retry interval.
120: * <p>
121: * This field is {@code deprecated}. Please make use of {@link org.eclipse.kapua.service.scheduler.trigger.definition.TriggerDefinition} and {@link TriggerProperty}es.
122: *
123: * @param retryInterval The retry interval.
124: * @since 1.0.0
125: * @deprecated since 1.1.0
126: */
127: @Deprecated
128: void setRetryInterval(Long retryInterval);
129:
130: /**
131: * Gets the {@link org.eclipse.kapua.service.scheduler.trigger.definition.TriggerDefinition} {@link KapuaId} which this {@link Trigger} refers to.
132: *
133: * @return The {@link org.eclipse.kapua.service.scheduler.trigger.definition.TriggerDefinition} {@link KapuaId} which this {@link Trigger} refers to.
134: * @since 1.1.0
135: */
136: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
137: KapuaId getTriggerDefinitionId();
138:
139: /**
140: * Sets the {@link org.eclipse.kapua.service.scheduler.trigger.definition.TriggerDefinition} {@link KapuaId} which this {@link Trigger} refers to.
141: *
142: * @param triggerDefinitionId The {@link org.eclipse.kapua.service.scheduler.trigger.definition.TriggerDefinition} {@link KapuaId} which this {@link Trigger} refers to.
143: * @since 1.1.0
144: */
145: void setTriggerDefinitionId(KapuaId triggerDefinitionId);
146:
147: /**
148: * Gets the {@link List} of {@link TriggerProperty}es associated with this {@link Trigger}
149: *
150: * @return The {@link List} of {@link TriggerProperty}es associated with this {@link Trigger}
151: * @since 1.0.0
152: */
153: List<TriggerProperty> getTriggerProperties();
154:
155: /**
156: * Gets the {@link TriggerProperty} by the name.
157: *
158: * @param name The {@link TriggerProperty#getName()} to look for.
159: * @return The found {@link TriggerProperty} or {@code null}.
160: * @since 1.5.0
161: */
162: TriggerProperty getTriggerProperty(String name);
163:
164: /**
165: * Sets the {@link List} of {@link TriggerProperty}es associated with this {@link Trigger}
166: *
167: * @param triggerProperties The {@link List} of {@link TriggerProperty}es associated with this {@link Trigger}
168: * @since 1.0.0
169: */
170: void setTriggerProperties(List<TriggerProperty> triggerProperties);
171: }