Fix sonar issues

Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-08-05 08:56:38 +02:00
parent a1e939e233
commit 54ce3ad8e0
68 changed files with 341 additions and 290 deletions

View File

@@ -36,7 +36,7 @@ import org.springframework.stereotype.Component;
/**
*
*
* A controller which handles the amqp authentfication.
*/
@Component
public class AmqpControllerAuthentfication {

View File

@@ -138,6 +138,13 @@ public class AmqpMessageHandlerService extends BaseAmqpService {
return onMessage(message, type, tenant, getRabbitTemplate().getConnectionFactory().getVirtualHost());
}
/**
* Executed on a authentication request.
*
* @param message
* the amqp message
* @return the rpc message back to supplier.
*/
@RabbitListener(queues = "${hawkbit.dmf.rabbitmq.authenticationReceiverQueue}", containerFactory = "listenerContainerFactory")
public Message onAuthenticationRequest(final Message message) {
checkContentTypeJson(message);
@@ -153,6 +160,19 @@ public class AmqpMessageHandlerService extends BaseAmqpService {
}
}
/**
* * Executed if a amqp message arrives.
*
* @param message
* the message
* @param type
* the type
* @param tenant
* the tenant
* @param virtualHost
* the virtual host
* @return the rpc message back to supplier.
*/
public Message onMessage(final Message message, final String type, final String tenant, final String virtualHost) {
checkContentTypeJson(message);
final SecurityContext oldContext = SecurityContextHolder.getContext();

View File

@@ -88,8 +88,7 @@ public class BaseAmqpService {
return rabbitTemplate.getMessageConverter();
}
protected final String getStringHeaderKey(final Message message, final String key,
final String errorMessageIfNull) {
protected String getStringHeaderKey(final Message message, final String key, final String errorMessageIfNull) {
final Map<String, Object> header = message.getMessageProperties().getHeaders();
final Object value = header.get(key);
if (value == null) {
@@ -117,4 +116,5 @@ public class BaseAmqpService {
protected void cleanMessageHeaderProperties(final Message message) {
message.getMessageProperties().getHeaders().remove(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME);
}
}