]> git.basschouten.com Git - openhab-addons.git/blob
fa7b35fd6db03a9ebd6f895e0737e46b08fcc3a0
[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
22  * {@link org.openhab.binding.digitalstrom.internal.lib.sensorjobexecutor.AbstractSensorJobExecutor} e.g.
23  * {@link org.openhab.binding.digitalstrom.internal.lib.sensorjobexecutor.SceneReadingJobExecutor} or
24  * {@link org.openhab.binding.digitalstrom.internal.lib.sensorjobexecutor.SensorJobExecutor}.
25  *
26  * @author Michael Ochel - Initial contribution
27  * @author Matthias Siegele - Initial contribution
28  */
29 public interface SensorJob {
30
31     /**
32      * Returns the dSID of the {@link org.openhab.binding.digitalstrom.internal.lib.structure.devices.Device}
33      * for which this job is to be created.
34      *
35      * @return dSID from the device
36      */
37     DSID getDSID();
38
39     /**
40      * Returns the dSID of the digitalSTROM-Meter on which this job is to be created.
41      *
42      * @return dSID from the device meter
43      */
44     DSID getMeterDSID();
45
46     /**
47      * Executes the SensorJob.
48      *
49      * @param dSAPI must not be null
50      * @param sessionToken to login
51      */
52     void execute(DsAPI dSAPI, String sessionToken);
53
54     /**
55      * Returns the time when the {@link SensorJob} was initialized.
56      *
57      * @return the initialization time
58      */
59     long getInitalisationTime();
60
61     /**
62      * Sets the time when the {@link SensorJob} was initialized e.g. to manages the priority of this {@link SensorJob}.
63      *
64      * @param time to set
65      */
66     void setInitalisationTime(long time);
67
68     /**
69      * Returns the id of this {@link SensorJob}.
70      *
71      * @return id
72      */
73     String getID();
74 }