/*******************************************************************************
 * Copyright (c) 2011, 2016 Eurotech and/or its affiliates and others
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Eurotech - initial API and implementation
 *
 *******************************************************************************/
package org.eclipse.kapua.broker.core.listener;

import org.apache.camel.spi.UriEndpoint;
import org.eclipse.kapua.broker.core.message.CamelKapuaMessage;
import org.eclipse.kapua.locator.KapuaLocator;
import org.eclipse.kapua.message.device.data.KapuaDataMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.codahale.metrics.Counter;

/**
 * Data messages listener.
 *
 * @since 1.0
 */
@UriEndpoint(title = "data message processor", syntax = "bean:dataMessageListener", scheme = "bean")
public class DataMessageListener extends AbstractListener
{

    private static final Logger logger = LoggerFactory.getLogger(DataMessageListener.class);

    // private static DeviceLifeCycleService deviceLifeCycleService = KapuaLocator.getInstance().getService(DeviceLifeCycleService.class);

    // metrics
    private Counter metricDataMessage;

    public DataMessageListener()
    {
        super("deviceLifeCycle");
        metricDataMessage = registerCounter("messages", "data", "count");
    }

    /**
     * Process a data message.
     * 
     * @param dataMessage
     */
    public void processDataMessage(CamelKapuaMessage<KapuaDataMessage> dataMessage)
    {
        // TODO to be implemented
        logger.info("Received data message from device channel: client id '{}' - {}",
                    new Object[] { dataMessage.getMessage().getClientId(), dataMessage.getMessage().getChannel().toString() });

        metricDataMessage.inc();
    }

}

@@ -104,9 +104,9 @@
  201
-6
+7
  Eur
@@ -464,16 +464,32 @@
 ation%0A *
+     Red Hat Inc
 %0A ******
@@ -721,55 +721,8 @@
 ge;%0A
-import org.eclipse.kapua.locator.KapuaLocator;%0A
 impo
@@ -1086,17 +1086,17 @@
 Listener
-%0A
+ 
 %7B%0A%0A    p
@@ -1188,148 +1188,8 @@
 );%0A%0A
-    // private static DeviceLifeCycleService deviceLifeCycleService = KapuaLocator.getInstance().getService(DeviceLifeCycleService.class);%0A%0A
     
@@ -1271,20 +1271,16 @@
 stener()
-%0A   
  %7B%0A     
@@ -1553,20 +1553,16 @@
 Message)
-%0A   
  %7B%0A     
@@ -1679,43 +1679,8 @@
 %7B%7D%22,
-%0A                    new Object%5B%5D %7B
  dat
@@ -1757,21 +1757,8 @@
 el()
-.toString() %7D
 );%0A%0A

Fix warning and remove unnecessary array in logging statement