2017-04-12 17:40:32 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012-2017 The original author or authors
|
|
|
|
|
* ------------------------------------------------------
|
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
|
* and Apache License v2.0 which accompanies this distribution.
|
|
|
|
|
*
|
|
|
|
|
* The Eclipse Public License is available at
|
|
|
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
|
*
|
|
|
|
|
* The Apache License v2.0 is available at
|
|
|
|
|
* http://www.opensource.org/licenses/apache2.0.php
|
|
|
|
|
*
|
|
|
|
|
* You may elect to redistribute this code under either of these licenses.
|
|
|
|
|
*/
|
2017-02-01 15:16:13 +01:00
|
|
|
|
2016-03-03 17:47:30 -08:00
|
|
|
package io.moquette.interception.messages;
|
|
|
|
|
|
|
|
|
|
import io.moquette.spi.impl.subscriptions.Subscription;
|
2017-01-28 10:06:30 +01:00
|
|
|
import io.netty.handler.codec.mqtt.MqttQoS;
|
2016-03-03 17:47:30 -08:00
|
|
|
|
2017-01-10 17:06:13 +01:00
|
|
|
public class InterceptSubscribeMessage implements InterceptMessage {
|
2017-02-01 15:16:13 +01:00
|
|
|
|
2016-03-03 17:47:30 -08:00
|
|
|
private final Subscription subscription;
|
|
|
|
|
private final String username;
|
|
|
|
|
|
|
|
|
|
public InterceptSubscribeMessage(Subscription subscription, String username) {
|
|
|
|
|
this.subscription = subscription;
|
|
|
|
|
this.username = username;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getClientID() {
|
|
|
|
|
return subscription.getClientId();
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-28 10:06:30 +01:00
|
|
|
public MqttQoS getRequestedQos() {
|
2016-03-03 17:47:30 -08:00
|
|
|
return subscription.getRequestedQos();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getTopicFilter() {
|
2017-02-14 17:23:04 +01:00
|
|
|
return subscription.getTopicFilter().toString();
|
2016-03-03 17:47:30 -08:00
|
|
|
}
|
|
|
|
|
|
2017-02-01 15:16:13 +01:00
|
|
|
public String getUsername() {
|
|
|
|
|
return username;
|
|
|
|
|
}
|
2016-03-03 17:47:30 -08:00
|
|
|
}
|