Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) SiteWhere, LLC. All rights reserved. http://www.sitewhere.com
   *
   * The software in this package is published under the terms of the CPAL v1.0
   * license, a copy of which has been included with this distribution in the
   * LICENSE.txt file.
   */
  package com.sitewhere.device.event.processor;
  
 import java.util.List;
 
 
Default implementation of com.sitewhere.spi.device.event.processor.IInboundEventProcessorChain interface.

Author(s):
Derek
 
 public class DefaultInboundEventProcessorChain extends LifecycleComponent implements
Static logger instance
 
 	private static Logger LOGGER = Logger.getLogger(DefaultInboundEventProcessorChain.class);

List of processors
 
 
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#start()
 	 */
 	public void start() throws SiteWhereException {
 		for (IInboundEventProcessor processor : getProcessors()) {
 			startNestedComponent(processorfalse);
 		}
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#getLogger()
 	 */
 	public Logger getLogger() {
 		return ;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#stop()
 	 */
 	public void stop() throws SiteWhereException {
 		for (IInboundEventProcessor processor : getProcessors()) {
 			processor.lifecycleStop();
 		}
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * com.sitewhere.spi.device.event.processor.IInboundEventProcessor#onRegistrationRequest
 	 * (java.lang.String, java.lang.String,
 	 * com.sitewhere.spi.device.event.request.IDeviceRegistrationRequest)
 	 */
 	public void onRegistrationRequest(String hardwareIdString originatorIDeviceRegistrationRequest request)
 			throws SiteWhereException {
 		for (IInboundEventProcessor processor : getProcessors()) {
 			try {
 				processor.onRegistrationRequest(hardwareIdoriginatorrequest);
 			} catch (SiteWhereException e) {
 				.error("Processor failed to process registration request."e);
 			}
 		}
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.device.event.processor.IInboundEventProcessor#
	 * onDeviceCommandResponseRequest(java.lang.String, java.lang.String,
	 * com.sitewhere.spi.device.event.request.IDeviceCommandResponseCreateRequest)
	 */
	public void onDeviceCommandResponseRequest(String hardwareIdString originator,
		for (IInboundEventProcessor processor : getProcessors()) {
			try {
				processor.onDeviceCommandResponseRequest(hardwareIdoriginatorrequest);
catch (SiteWhereException e) {
				.error("Processor failed to process command response request."e);
			}
		}
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.device.event.processor.IInboundEventProcessor#
	 * onDeviceMeasurementsCreateRequest(java.lang.String, java.lang.String,
	 * com.sitewhere.spi.device.event.request.IDeviceMeasurementsCreateRequest)
	 */
	public void onDeviceMeasurementsCreateRequest(String hardwareIdString originator,
		for (IInboundEventProcessor processor : getProcessors()) {
			try {
				processor.onDeviceMeasurementsCreateRequest(hardwareIdoriginatorrequest);
catch (SiteWhereException e) {
				.error("Processor failed to process measurements create request."e);
			}
		}
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.device.event.processor.IInboundEventProcessor#
	 * onDeviceLocationCreateRequest(java.lang.String, java.lang.String,
	 * com.sitewhere.spi.device.event.request.IDeviceLocationCreateRequest)
	 */
	public void onDeviceLocationCreateRequest(String hardwareIdString originator,
		for (IInboundEventProcessor processor : getProcessors()) {
			try {
				processor.onDeviceLocationCreateRequest(hardwareIdoriginatorrequest);
catch (SiteWhereException e) {
				.error("Processor failed to process location create request."e);
			}
		}
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.device.event.processor.IInboundEventProcessor#
	 * onDeviceAlertCreateRequest(java.lang.String, java.lang.String,
	 * com.sitewhere.spi.device.event.request.IDeviceAlertCreateRequest)
	 */
	public void onDeviceAlertCreateRequest(String hardwareIdString originator,
		for (IInboundEventProcessor processor : getProcessors()) {
			try {
				processor.onDeviceAlertCreateRequest(hardwareIdoriginatorrequest);
catch (SiteWhereException e) {
				.error("Processor failed to process alert create request."e);
			}
		}
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.device.event.processor.IInboundEventProcessor#
	 * onDeviceStreamCreateRequest(java.lang.String, java.lang.String,
	 * com.sitewhere.spi.device.event.request.IDeviceStreamCreateRequest)
	 */
	public void onDeviceStreamCreateRequest(String hardwareIdString originator,
		for (IInboundEventProcessor processor : getProcessors()) {
			try {
				processor.onDeviceStreamCreateRequest(hardwareIdoriginatorrequest);
catch (SiteWhereException e) {
				.error("Processor failed to process stream data create request."e);
			}
		}
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.device.event.processor.IInboundEventProcessor#
	 * onDeviceStreamDataCreateRequest(java.lang.String, java.lang.String,
	 * com.sitewhere.spi.device.event.request.IDeviceStreamDataCreateRequest)
	 */
	public void onDeviceStreamDataCreateRequest(String hardwareIdString originator,
		for (IInboundEventProcessor processor : getProcessors()) {
			try {
				processor.onDeviceStreamDataCreateRequest(hardwareIdoriginatorrequest);
catch (SiteWhereException e) {
				.error("Processor failed to process stream data create request."e);
			}
		}
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.device.event.processor.IInboundEventProcessor#
	 * onSendDeviceStreamDataRequest(java.lang.String, java.lang.String,
	 * com.sitewhere.spi.device.event.request.ISendDeviceStreamDataRequest)
	 */
	public void onSendDeviceStreamDataRequest(String hardwareIdString originator,
		for (IInboundEventProcessor processor : getProcessors()) {
			try {
				processor.onSendDeviceStreamDataRequest(hardwareIdoriginatorrequest);
catch (SiteWhereException e) {
				.error("Processor failed to process stream data create request."e);
			}
		}
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.sitewhere.spi.device.event.processor.IInboundEventProcessorChain#getProcessors
	 * ()
	 */
		return ;
	}
	public void setProcessors(List<IInboundEventProcessorprocessors) {
		this. = processors;
	}
New to GrepCode? Check out our FAQ X