2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.digitalstrom.internal.lib.sensorjobexecutor.sensorjob;
15 import org.openhab.binding.digitalstrom.internal.lib.serverconnection.DsAPI;
16 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID;
19 * The {@link SensorJob} represents an executable job to read out digitalSTROM-Sensors or device configurations like
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}.
26 * @author Michael Ochel - Initial contribution
27 * @author Matthias Siegele - Initial contribution
29 public interface SensorJob {
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.
35 * @return dSID from the device
40 * Returns the dSID of the digitalSTROM-Meter on which this job is to be created.
42 * @return dSID from the device meter
47 * Executes the SensorJob.
49 * @param dSAPI must not be null
50 * @param sessionToken to login
52 void execute(DsAPI dSAPI, String sessionToken);
55 * Returns the time when the {@link SensorJob} was initialized.
57 * @return the initialization time
59 long getInitalisationTime();
62 * Sets the time when the {@link SensorJob} was initialized e.g. to manages the priority of this {@link SensorJob}.
66 void setInitalisationTime(long time);
69 * Returns the id of this {@link SensorJob}.