]> git.basschouten.com Git - openhab-addons.git/blob
84260b1e5d7826b18c37a1485139fdae338042e4
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.digitalstrom.internal.lib.sensorjobexecutor.sensorjob;
14
15 import org.openhab.binding.digitalstrom.internal.lib.serverconnection.DsAPI;
16 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID;
17
18 /**
19  * The {@link SensorJob} represents an executable job to read out digitalSTROM-Sensors or device configurations like
20  * scene values.<br>
21  * It can be added to an implementation of the {@link AbstractSensorJobExecutor} e.g. {@link SceneReadingJobExecutor} or
22  * {@link SensorJobExecutor}.
23  *
24  * @author Michael Ochel - Initial contribution
25  * @author Matthias Siegele - Initial contribution
26  */
27 public interface SensorJob {
28
29     /**
30      * Returns the dSID of the {@link Device} for which this job is to be created.
31      *
32      * @return dSID from the device
33      */
34     DSID getDSID();
35
36     /**
37      * Returns the dSID of the digitalSTROM-Meter on which this job is to be created.
38      *
39      * @return dSID from the device meter
40      */
41     DSID getMeterDSID();
42
43     /**
44      * Executes the SensorJob.
45      *
46      * @param dSAPI must not be null
47      * @param sessionToken to login
48      */
49     void execute(DsAPI dSAPI, String sessionToken);
50
51     /**
52      * Returns the time when the {@link SensorJob} was initialized.
53      *
54      * @return the initialization time
55      */
56     long getInitalisationTime();
57
58     /**
59      * Sets the time when the {@link SensorJob} was initialized e.g. to manages the priority of this {@link SensorJob}.
60      *
61      * @param time to set
62      */
63     void setInitalisationTime(long time);
64
65     /**
66      * Returns the id of this {@link SensorJob}.
67      *
68      * @return id
69      */
70     String getID();
71 }