Commit e1a726db authored by Gwenael Cattez's avatar Gwenael Cattez
Browse files

Move demonstration modules from sandbox to trunk

parent e57ba110
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2008-2012 Inria, University of Lille -->
<!-- -->
<!-- This library is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU Lesser General Public -->
<!-- License as published by the Free Software Foundation; either -->
<!-- version 2 of the License, or (at your option) any later version. -->
<!-- -->
<!-- This library is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -->
<!-- Lesser General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU Lesser General Public -->
<!-- License along with this library; if not, write to the Free Software -->
<!-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Contact: frascati@ow2.org -->
<!-- -->
<!-- Author: Gwenael CATTEZ -->
<!-- -->
<!-- Contributors : -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>common-homeautomation</artifactId>
<groupId>org.ow2.frascati.demo</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>common-homeautomation-interface</artifactId>
<name>Common interfaces for home automation</name>
</project>
\ No newline at end of file
/**
* OW2 FraSCAti Assembly Factory
* Copyright (C) 2008-2012 Inria, University of Lille
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Gwénaël Cattez
*
* Contributor(s):
*
*/
package org.ow2.frascati.demo.common.homeautomation.actuator;
/**
* General interface representing all kind of actuator (switch, ligth,...)
*/
public interface Actuator
{
}
/**
* OW2 FraSCAti Assembly Factory
* Copyright (C) 2008-2012 Inria, University of Lille
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Gwénaël Cattez
*
* Contributor(s):
*
*/
package org.ow2.frascati.demo.common.homeautomation.actuator;
/**
* Interface representing a 2 states (on,off) actuator
*/
public interface OnOffActuator extends Actuator
{
/**
* The parameter to send to the zibase to turn off an actuator
*/
public final static int ZIBASE_FUNCTION_OFF=0;
/**
* The parameter to send to the zibase to turn on an actuator
*/
public final static int ZIBASE_FUNCTION_ON=1;
/**
* Turn the actuator on
*/
public void acturatorOn();
/**
* Turn the actuator off
*/
public void acturatorOff();
}
/**
* OW2 FraSCAti Assembly Factory
* Copyright (C) 2008-2012 Inria, University of Lille
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Gwénaël Cattez
*
* Contributor(s):
*
*/
package org.ow2.frascati.demo.common.homeautomation.actuator;
/**
* Interface representing a 3 states (on,off,dim) actuator
*/
public interface OnOffDimActuator extends OnOffActuator
{
/**
* The parameter to send to the zibase to dim the actuator
*/
public final static int ZIBASE_FUNCTION_DIM=2;
/**
* Dim the actuator, the dim value sent to the zibase is worth ZIBASE_ACTIONMODULE_DIM + dimValue * ZIBASE_ACTIONMODULE_DIM_CONSTANT
*
* @param dimValue the value of the dim parameter in percent
*/
public void actuatorDim(int dimValue);
}
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Zibase" targetNamespace="http://zibase.demo.frascati.ow2.org/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://zibase.demo.frascati.ow2.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://zibase.demo.frascati.ow2.org/" xmlns:tns="http://zibase.demo.frascati.ow2.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="invokeModule" type="tns:invokeModule"/>
<xsd:complexType name="invokeModule">
<xsd:sequence>
<xsd:element minOccurs="0" name="arg0" nillable="true" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg1" nillable="true" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg2" nillable="true" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg3" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="invokeModuleResponse" type="tns:invokeModuleResponse"/>
<xsd:complexType name="invokeModuleResponse">
<xsd:sequence>
<xsd:element minOccurs="0" name="return" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="invokeModuleResponse">
<wsdl:part element="tns:invokeModuleResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="invokeModule">
<wsdl:part element="tns:invokeModule" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="ZibasePortType">
<wsdl:operation name="invokeModule">
<wsdl:input message="tns:invokeModule" name="invokeModule">
</wsdl:input>
<wsdl:output message="tns:invokeModuleResponse" name="invokeModuleResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ZibaseSoapBinding" type="tns:ZibasePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="invokeModule">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="invokeModule">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="invokeModuleResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Zibase">
<wsdl:port binding="tns:ZibaseSoapBinding" name="ZibasePort">
<soap:address location="http://localhost:9100/zibase/invoke"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2008-2012 Inria, University of Lille -->
<!-- -->
<!-- This library is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU Lesser General Public -->
<!-- License as published by the Free Software Foundation; either -->
<!-- version 2 of the License, or (at your option) any later version. -->
<!-- -->
<!-- This library is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -->
<!-- Lesser General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU Lesser General Public -->
<!-- License along with this library; if not, write to the Free Software -->
<!-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Contact: frascati@ow2.org -->
<!-- -->
<!-- Author: Gwenael CATTEZ -->
<!-- -->
<!-- Contributors : -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>common-homeautomation</artifactId>
<groupId>org.ow2.frascati.demo</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>common-homeautomation-light</artifactId>
<name>Common Ligth component</name>
<properties>
<composite.file>light</composite.file>
<composite.file.local>light</composite.file.local>
<composite.file.deploy>light</composite.file.deploy>
</properties>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.demo</groupId>
<artifactId>common-onoffdevice</artifactId>
</dependency>
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-binding-ws</artifactId>
</dependency>
<dependency>
<groupId>org.ow2.frascati.demo</groupId>
<artifactId>common-homeautomation-interface</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
/**
* OW2 FraSCAti Assembly Factory
* Copyright (C) 2008-2012 Inria, University of Lille
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Gwénaël Cattez
*
* Contributor(s):
*
*/
package org.ow2.frascati.demo.common.homeautomation.light;
import org.osoa.sca.annotations.Property;
import org.osoa.sca.annotations.Reference;
import org.ow2.frascati.demo.common.homeautomation.actuator.OnOffDimActuator;
import org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice;
import org.ow2.frascati.demo.zibase.ZibasePortType;
/**
* Implementation of an on,off,dim light communicated with a zibase
*/
public class Light extends SwOnOffDevice implements OnOffDimActuator
{
private static final long serialVersionUID = -2220769980129769032L;
/**
* @Property
* Zibase module Id
*/
private String moduleID;
/**
* @Property
* Zibase protocol Id
*/
private String protocolID;
/**
* The Zibase reference
*/
@Reference(required = false)
protected ZibasePortType zibase;
/**
* Constructor for {@link SwOnOffDevice} class, set the title of the Swing Panel
*/
public Light()
{
super("Remote Ligth");
}
/**
* @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#onAction()
*/
@Override
public Boolean onAction()
{
acturatorOn();
return null;
}
/**
* @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#offAction()
*/
@Override
public Boolean offAction()
{
acturatorOff();
return null;
}
/**
* @see org.ow2.frascati.demo.common.homeautomation.actuator.OnOffActuator#acturatorOn()
*/
public void acturatorOn()
{
zibase.invokeModule(moduleID, String.valueOf(OnOffDimActuator.ZIBASE_FUNCTION_ON),protocolID,null);
}
/**
* @see org.ow2.frascati.demo.common.homeautomation.actuator.OnOffActuator#acturatorOff()
*/
public void acturatorOff()
{
zibase.invokeModule(moduleID, String.valueOf(OnOffDimActuator.ZIBASE_FUNCTION_OFF),protocolID,null);
}
/**
* @see org.ow2.frascati.demo.common.homeautomation.actuator.OnOffDimActuator#actuatorDim(int)
*/
public void actuatorDim(int dimValue)
{
zibase.invokeModule(moduleID, String.valueOf(OnOffDimActuator.ZIBASE_FUNCTION_DIM),protocolID,String.valueOf(dimValue));
// int convertedDim=dimValue*OnOffDimActuator.ZIBASE_ACTIONMODULE_DIM_CONSTANT;
// convertedDim+=OnOffDimActuator.ZIBASE_ACTIONMODULE_DIM;
// zibase.invokeModule(moduleID, convertedDim);
}
public String getModuleID()
{
return moduleID;
}
@Property
public void setModuleID(String moduleID)
{
this.moduleID = moduleID;
}
public String getProtocolID()
{
return protocolID;
}
@Property
public void setProtocolID(String protocolID)
{
this.protocolID = protocolID;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2008-2012 Inria, University of Lille -->
<!-- -->
<!-- This library is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU Lesser General Public -->
<!-- License as published by the Free Software Foundation; either -->
<!-- version 2 of the License, or (at your option) any later version. -->
<!-- -->
<!-- This library is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -->
<!-- Lesser General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU Lesser General Public -->
<!-- License along with this library; if not, write to the Free Software -->
<!-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Contact: frascati@ow2.org -->
<!-- -->
<!-- Author: Gwenael CATTEZ -->
<!-- -->
<!-- Contributors : -->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
name="light">
<component name="light">
<property name="moduleID">A10</property>
<property name="protocolID">0</property>
<property name="onText">turn on</property>
<property name="offText">turn off</property>
<property name="onIconPath">images/light_on.png</property>
<property name="offIconPath">images/light_off.png</property>
<service name="onoffdim-actuator">
<interface.java interface="org.ow2.frascati.demo.common.homeautomation.actuator.OnOffDimActuator" />
</service>
<implementation.java class="org.ow2.frascati.demo.common.homeautomation.light.Light" />
<reference name="zibase">
<interface.wsdl interface="zibase.wsdl#wsdl.interface(ZibasePortType)"/>
<binding.ws uri="http://localhost:9100/zibase/invoke"
wsdlElement="http://zibase.demo.frascati.ow2.org/#wsdl.port(Zibase/ZibasePort)" />
</reference>
</component>
<service name="onoffdim-actuator" promote="light/onoffdim-actuator">
<binding.ws uri="http://localhost:9103/light/onoffdim"/>
</service>
</composite>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2008-2012 Inria, University of Lille -->
<!-- -->
<!-- This library is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU Lesser General Public -->
<!-- License as published by the Free Software Foundation; either -->
<!-- version 2 of the License, or (at your option) any later version. -->
<!-- -->
<!-- This library is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -->
<!-- Lesser General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU Lesser General Public -->
<!-- License along with this library; if not, write to the Free Software -->
<!-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Contact: frascati@ow2.org -->
<!-- -->
<!-- Author: Gwenael CATTEZ -->
<!-- -->
<!-- Contributors : -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>common-homeautomation</artifactId>
<groupId>org.ow2.frascati.demo</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>common-homeautomation-switch</artifactId>
<name>Common Switch component</name>
<properties>
<composite.file>switch</composite.file>
<composite.file.local>switch</composite.file.local>
<composite.file.deploy>switch</composite.file.deploy>
</properties>
<dependencies>
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-binding-ws</artifactId>
</dependency>
<dependency>
<groupId>org.ow2.frascati.demo</groupId>
<artifactId>common-homeautomation-interface</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
/**
* OW2 FraSCAti Assembly Factory
* Copyright (C) 2008-2012 Inria, University of Lille
*
* This library is free software; you can redistribute it and/or