Examples of EventPublisher


Examples of org.openhab.core.events.EventPublisher

   * @param itemName the name of the item to send the command to
   * @param commandString the command to send
   */
  static public Object sendCommand(String itemName, String commandString) {
    ItemRegistry registry = (ItemRegistry) ScriptActivator.itemRegistryTracker.getService();
    EventPublisher publisher = (EventPublisher) ScriptActivator.eventPublisherTracker.getService();
    if(publisher!=null && registry!=null) {
      try {
        Item item = registry.getItem(itemName);
        Command command = TypeParser.parseCommand(item.getAcceptedCommandTypes(), commandString);
        publisher.sendCommand(itemName, command);
      } catch (ItemNotFoundException e) {
        logger.warn("Item '" + itemName + "' does not exist.");
      }
    }
    return null;
View Full Code Here

Examples of org.openhab.core.events.EventPublisher

   *
   * @param item the item to send the command to
   * @param command the command to send
   */
  static public Object sendCommand(Item item, Command command) {
    EventPublisher publisher = (EventPublisher) ScriptActivator.eventPublisherTracker.getService();
    if (publisher!=null && item != null) {
      publisher.sendCommand(item.getName(), command);
    }
    return null;
  }
View Full Code Here

Examples of org.openhab.core.events.EventPublisher

   * @param itemName the name of the item to send the status update for
   * @param stateAsString the new state of the item
   */
  static public Object postUpdate(String itemName, String stateString) {
    ItemRegistry registry = (ItemRegistry) ScriptActivator.itemRegistryTracker.getService();
    EventPublisher publisher = (EventPublisher) ScriptActivator.eventPublisherTracker.getService();
    if(publisher!=null && registry!=null) {
      try {
        Item item = registry.getItem(itemName);
        State state = TypeParser.parseState(item.getAcceptedDataTypes(), stateString);
        publisher.postUpdate(itemName, state);
      } catch (ItemNotFoundException e) {
        logger.warn("Item '" + itemName + "' does not exist.");
      }
    }
    return null;
View Full Code Here

Examples of org.openhab.core.events.EventPublisher

   * t
   * @param item the item to send the status update for
   * @param state the new state of the item
   */
  static public Object postUpdate(Item item, State state) {
    EventPublisher publisher = (EventPublisher) ScriptActivator.eventPublisherTracker.getService();
    if (publisher!=null && item != null) {
      publisher.postUpdate(item.getName(), state);
    }
    return null;
  }
View Full Code Here

Examples of org.wso2.carbon.bam.data.publisher.servicestats.eventing.EventPublisher

            serviceStatisticsPublisherAdmin = new ServiceStatisticsPublisherAdmin();

            countData = new CountData();

            //use event publisher as the serviceStatsProcessor
            ServiceStatsProcessor serviceStatsProcessor = new EventPublisher();
            serviceStatisticsQueue = new ServiceStatisticsQueue(serviceStatsProcessor);

            PublisherUtils.setServiceStatisticQueue(serviceStatisticsQueue);

      // Read bam subscriber service endpoint from carbon.xml of wsas and subscribe
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.