net.sourceforge.cruisecontrol.publishers
Class X10Publisher

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.publishers.X10Publisher
All Implemented Interfaces:
Publisher, java.io.Serializable

public class X10Publisher
extends java.lang.Object
implements Publisher

This Publisher implementation sends a on/off signal to a X10 capable device via the X10 Activehome computer interface, model CM11A. This allows you to control an electronic device when the build breaks. For example, use a flashing red light to indicate a broken build.

NOTE: THIS PUBLISHER HAS ONLY BEEN TESTED WITH WINDOWS

Quick Start:

  1. Buy the home automation kit found at http://www.x10.com/automation/x10_ck11a_1.htm
  2. Plug the computer interface to your serial port, e.g. COM1, and your powerline
  3. Set the lamp module's house and device code, e.g. A3, and plug it into your powerline
  4. Plug in an electronic device to the lamp module, e.g. a flashing red light like http://www.bwild.com/redsiren.html
  5. Install the Java Communications API on your CruiseControl machine by copying the win32com.dll from the CruiseControl lib directory to your JAVA_HOME/bin directory
  6. Add the x10 publisher to CruiseControl's config.xml, e.g. <x10 houseCode="A" deviceCode="3" port="COM1"/>

For more information about the controller, see http://www.smarthome.com/1140.html or http://www.x10.com/automation/x10_ck11a_1.htm The controller connects to the computer via a serial port, e.g. COM1, and allows the computer to send (and receive) X10 signals on the power line. For more information on X10 in general, see http://www.x10.com/support/basicx10.htm.

This module uses a pure Java implementation of the CM11A communication protocol as implemented by Jesse Peterson, http://www.jpeterson.com/. To read more about his library, see http://www.jpeterson.com/rnd/x101.0.1/Readme.html.

The jpeterson library requires that the Java Communications API be installed. For more information on the COMM API, see http://java.sun.com/products/javacomm/index.jsp. For convenience, the Java COMM API is included with the CruiseControl distribution. On windows, copy the win32com.dll from CruiseControl's lib directory to your JAVA_HOME/bin directory.

NOTE: If you receive the following error:

Error loading win32com: java.lang.UnsatisfiedLinkError: no win32com in java.library.path
it probably means that the Windows DLL named win32com.dll needs to be copied from CruiseControl's lib directory into your JDK (or JRE) bin directory, i.e. the same directory that java.exe is found.

The standard behavior for this publisher is to send the device the "on" signal when the build breaks and then the "off" signal when the build is successful. If you want the opposite, i.e. on when successful and off when broken, set the onWhenBroken attribute to false.

Publisher Attributes:

Since:
August 26 2004
Author:
Paul Julius
See Also:
Serialized Form

Constructor Summary
X10Publisher()
           
 
Method Summary
protected  com.jpeterson.x10.Transmitter getTransmitter()
           
 void handleBuild(boolean isBroken)
           
 void publish(org.jdom.Element cruisecontrolLog)
          Define the publishing.
 void setDeviceCode(java.lang.String code)
           
 void setHouseCode(java.lang.String code)
           
 void setInterfaceModel(java.lang.String model)
           
 void setOnWhenBroken(boolean shouldTurnOn)
           
 void setPort(java.lang.String portName)
          The x10 cm11a library defaults to com2 for the port, so this attribute is optional.
 void turnOff()
           
 void turnOn()
           
 void validate()
          Called after the configuration is read to make sure that all the mandatory parameters were specified..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

X10Publisher

public X10Publisher()
Method Detail

publish

public void publish(org.jdom.Element cruisecontrolLog)
             throws CruiseControlException
Description copied from interface: Publisher
Define the publishing.

Specified by:
publish in interface Publisher
Parameters:
cruisecontrolLog - JDOM Element representation of the main cruisecontrol build log
Throws:
CruiseControlException

handleBuild

public void handleBuild(boolean isBroken)
                 throws CruiseControlException
Throws:
CruiseControlException

turnOn

public void turnOn()
            throws CruiseControlException
Throws:
CruiseControlException

turnOff

public void turnOff()
             throws CruiseControlException
Throws:
CruiseControlException

getTransmitter

protected com.jpeterson.x10.Transmitter getTransmitter()
                                                throws CruiseControlException
Throws:
CruiseControlException

validate

public void validate()
              throws CruiseControlException
Description copied from interface: Publisher
Called after the configuration is read to make sure that all the mandatory parameters were specified..

Specified by:
validate in interface Publisher
Throws:
CruiseControlException - if there was a configuration error.

setHouseCode

public void setHouseCode(java.lang.String code)

setDeviceCode

public void setDeviceCode(java.lang.String code)

setPort

public void setPort(java.lang.String portName)
The x10 cm11a library defaults to com2 for the port, so this attribute is optional.


setOnWhenBroken

public void setOnWhenBroken(boolean shouldTurnOn)

setInterfaceModel

public void setInterfaceModel(java.lang.String model)