Minor, just code layout
This commit is contained in:
@@ -474,16 +474,6 @@ public class ProtocolProcessor {
|
|||||||
m_interceptor.notifyTopicPublished(msg, clientID, username);
|
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) {
|
private void receivedPublishQos1(Channel channel, PublishMessage msg) {
|
||||||
//verify if topic can be write
|
//verify if topic can be write
|
||||||
final String topic = msg.getTopicName();
|
final String topic = msg.getTopicName();
|
||||||
@@ -552,6 +542,16 @@ public class ProtocolProcessor {
|
|||||||
m_interceptor.notifyTopicPublished(msg, clientID, username);
|
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
|
* Intended usage is only for embedded versions of the broker, where the hosting application want to use the
|
||||||
* broker to send a publish message.
|
* broker to send a publish message.
|
||||||
|
|||||||
Reference in New Issue
Block a user