Minor, just code layout

This commit is contained in:
andsel
2016-12-13 23:43:01 +01:00
parent 296af8b4f6
commit c62f549176
@@ -474,16 +474,6 @@ public class ProtocolProcessor {
m_interceptor.notifyTopicPublished(msg, clientID, username);
}
private boolean checkWriteOnTopic(String topic, Channel channel) {
String clientID = NettyUtils.clientID(channel);
String username = NettyUtils.userName(channel);
if (!m_authorizator.canWrite(topic, username, clientID)) {
LOG.debug("topic {} doesn't have write credentials", topic);
return true;
}
return false;
}
private void receivedPublishQos1(Channel channel, PublishMessage msg) {
//verify if topic can be write
final String topic = msg.getTopicName();
@@ -552,6 +542,16 @@ public class ProtocolProcessor {
m_interceptor.notifyTopicPublished(msg, clientID, username);
}
private boolean checkWriteOnTopic(String topic, Channel channel) {
String clientID = NettyUtils.clientID(channel);
String username = NettyUtils.userName(channel);
if (!m_authorizator.canWrite(topic, username, clientID)) {
LOG.debug("topic {} doesn't have write credentials", topic);
return true;
}
return false;
}
/**
* Intended usage is only for embedded versions of the broker, where the hosting application want to use the
* broker to send a publish message.