Skip to content

Commit

Permalink
Fix JavaDoc specification and improve code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
gfinocchiaro committed Sep 21, 2017
1 parent baf7a50 commit 40f6279
Showing 1 changed file with 24 additions and 29 deletions.
53 changes: 24 additions & 29 deletions src/main/java/cool/mqtt/hooks/SimpleCoolHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import java.util.Map;

/**
* Simple skeletal implementation of the {@code MQTTCoolHook} interface, meant
* as a base class to be extended in order to minimize the effort required to
* provide a full implementation of a custom Hook.
* <p>
* All methods provide a trivial implementation, therefore subclasses must
* override those methods for which a specific behaviour is really needed.
* Simple skeletal implementation of the {@code MQTTCoolHook} interface, meant as a base class to be
* extended in order to minimize the effort required to provide a full implementation of a custom
* Hook.
*
* <p>All methods provide a trivial implementation, therefore subclasses must override those methods
* for which a specific behavior is really needed.
*/
public class SimpleCoolHook implements MQTTCoolHook {

Expand All @@ -22,20 +22,20 @@ public void init(File configDir) throws HookException {
}

/**
* This implementation always return {@code null}
* This implementation always returns {@code null}.
*/
@Override
public MqttBrokerConfig resolveAlias(String alias) throws HookException {
return null;
}

/**
* This implementation always return {@code true}
* This implementation always returns {@code true}.
*/
@Override
public boolean canOpenSession(String sessionId, String user,
String password, @SuppressWarnings("rawtypes") Map clientContext,
String clientPrincipal) throws HookException {
public boolean canOpenSession(String sessionId, String user, String password,
@SuppressWarnings("rawtypes") Map clientContext, String clientPrincipal)
throws HookException {

return true;
}
Expand All @@ -44,16 +44,14 @@ public boolean canOpenSession(String sessionId, String user,
* This implementation is void.
*/
@Override
public void onSessionClose(String sessionId) {
}
public void onSessionClose(String sessionId) {}

/**
* This implementation always return {@code true}
* This implementation always returns {@code true}.
*/
@Override
public boolean canConnect(String sessionId, String clientId,
String brokerAddress,
MqttConnectOptions connectOptions) throws HookException {
public boolean canConnect(String sessionId, String clientId, String brokerAddress,
MqttConnectOptions connectOptions) throws HookException {

return true;
}
Expand All @@ -62,28 +60,26 @@ public boolean canConnect(String sessionId, String clientId,
* This implementation is void.
*/
@Override
public void onDisconnection(String sessionId, String clientId,
String brokerAddress) {
public void onDisconnection(String sessionId, String clientId, String brokerAddress) {

}

/**
* This implementation always return {@code true}
* This implementation always returns {@code true}.
*/
@Override
public boolean canPublish(String sessionId, String clientId,
String brokerAddress, MqttMessage message) throws HookException {
public boolean canPublish(String sessionId, String clientId, String brokerAddress,
MqttMessage message) throws HookException {

return true;
}

/**
* This implementation always return {@code true}
* This implementation always returns {@code true}.
*/
@Override
public boolean canSubscribe(String sessionId, String clientId,
String brokerAddress,
MqttSubscription subscription) throws HookException {
public boolean canSubscribe(String sessionId, String clientId, String brokerAddress,
MqttSubscription subscription) throws HookException {

return true;
}
Expand All @@ -92,8 +88,7 @@ public boolean canSubscribe(String sessionId, String clientId,
* This implementation is void.
*/
@Override
public void onUnsubscribe(String sessionId, String clientId,
String brokerAddress, String topicFilter) {
}
public void onUnsubscribe(String sessionId, String clientId, String brokerAddress,
String topicFilter) {}

}

0 comments on commit 40f6279

Please sign in to comment.