| /* |
| * Copyright (c) 2020 Kentyou. |
| * 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: |
| * Kentyou - initial API and implementation |
| */ |
| package org.eclipse.sensinact.gateway.sthbnd.mqtt.util.listener; |
| |
| import org.eclipse.paho.client.mqttv3.IMqttMessageListener; |
| import org.eclipse.paho.client.mqttv3.MqttMessage; |
| |
| public abstract class MqttTopicMessage implements IMqttMessageListener { |
| @Override |
| public void messageArrived(String topic, MqttMessage message) throws Exception { |
| this.messageReceived(topic, new String(message.getPayload())); |
| } |
| |
| protected abstract void messageReceived(String topic, String message); |
| } |