blob: 8ae7b1f6465e0cce5a74b8bee2b712d2edb9a28b [file] [log] [blame]
/*
Device : DeviceThermostat
A thermostat is used to control the ambient temperature of rooms within for example a house. This information model provides capabilities to interact with specific functions of thermostats.
Created: 2017-08-09 15:38:05
*/
package org.eclipse.om2m.commons.resource.flexcontainerspec;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.eclipse.om2m.commons.resource.AbstractFlexContainer;
import org.eclipse.om2m.commons.resource.AbstractFlexContainerAnnc;
@XmlRootElement(name = DeviceThermostatFlexContainer.SHORT_NAME, namespace = "http://www.onem2m.org/xml/protocols/homedomain")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = DeviceThermostatFlexContainer.SHORT_NAME, namespace = "http://www.onem2m.org/xml/protocols/homedomain")
public class DeviceThermostatFlexContainer extends AbstractFlexContainer {
public static final String LONG_NAME = "deviceThermostat";
public static final String SHORT_NAME = "devTt";
public DeviceThermostatFlexContainer () {
setContainerDefinition("org.onem2m.home.device." + DeviceThermostatFlexContainer.LONG_NAME);
setLongName(LONG_NAME);
setShortName(SHORT_NAME);
}
public void finalizeSerialization() {
getRunMode();
getTimer();
getTemperature();
}
@XmlElement(name="runMe", required=true, type=RunModeFlexContainer.class)
private RunModeFlexContainer runMode;
public void setRunMode(RunModeFlexContainer runMode) {
this.runMode = runMode;
getFlexContainerOrContainerOrSubscription().add(runMode);
}
public RunModeFlexContainer getRunMode() {
this.runMode = (RunModeFlexContainer) getResourceByName(RunModeFlexContainer.SHORT_NAME);
return runMode;
}
@XmlElement(name="timer", required=true, type=TimerFlexContainer.class)
private TimerFlexContainer timer;
public void setTimer(TimerFlexContainer timer) {
this.timer = timer;
getFlexContainerOrContainerOrSubscription().add(timer);
}
public TimerFlexContainer getTimer() {
this.timer = (TimerFlexContainer) getResourceByName(TimerFlexContainer.SHORT_NAME);
return timer;
}
@XmlElement(name="tempe", required=true, type=TemperatureFlexContainer.class)
private TemperatureFlexContainer temperature;
public void setTemperature(TemperatureFlexContainer temperature) {
this.temperature = temperature;
getFlexContainerOrContainerOrSubscription().add(temperature);
}
public TemperatureFlexContainer getTemperature() {
this.temperature = (TemperatureFlexContainer) getResourceByName(TemperatureFlexContainer.SHORT_NAME);
return temperature;
}
}