Remove swagger and minor feature extensions and bug fixes

- Various Bug fixes and improvements
- Management API extended
- Swagger removed
- Guava Upgraded to 19
This commit is contained in:
Kai Zimmermann
2016-01-21 13:42:38 +01:00
parent fb9dfd204c
commit 64deaeea3c
813 changed files with 9787 additions and 4929 deletions

View File

@@ -20,6 +20,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DeviceSimulator {
private DeviceSimulator() {
// utility class
}
/**
* Start the Spring Boot Application.
*

View File

@@ -48,7 +48,7 @@ public class AmqpConfiguration {
/**
* Create jackson message converter bean.
*
*
* @return the jackson message converter
*/
@Bean
@@ -60,7 +60,7 @@ public class AmqpConfiguration {
/**
* Create the receiver queue from sp. Receive messages from sp.
*
*
* @return the queue
*/
@Bean
@@ -71,7 +71,7 @@ public class AmqpConfiguration {
/**
* Create the recevier exchange. Sp send messages to this exchange.
*
*
* @return the exchange
*/
@Bean
@@ -83,7 +83,7 @@ public class AmqpConfiguration {
* Create the Binding
* {@link AmqpConfiguration#receiverConnectorQueueFromSp()} to
* {@link AmqpConfiguration#exchangeQueueToConnector()}.
*
*
* @return the binding and create the queue and exchange
*/
@Bean
@@ -93,7 +93,7 @@ public class AmqpConfiguration {
/**
* Create dead letter queue.
*
*
* @return the queue
*/
@Bean
@@ -103,7 +103,7 @@ public class AmqpConfiguration {
/**
* Create the dead letter fanout exchange.
*
*
* @return the fanout exchange
*/
@Bean
@@ -113,7 +113,7 @@ public class AmqpConfiguration {
/**
* Create the Binding deadLetterQueue to exchangeDeadLetter.
*
*
* @return the binding
*/
@Bean
@@ -123,7 +123,7 @@ public class AmqpConfiguration {
/**
* Returns the Listener factory.
*
*
* @return the {@link SimpleMessageListenerContainer} that gets used receive
* AMQP messages
*/
@@ -136,7 +136,7 @@ public class AmqpConfiguration {
}
private Map<String, Object> getDeadLetterExchangeArgs() {
final Map<String, Object> args = new HashMap<String, Object>();
final Map<String, Object> args = new HashMap<>();
args.put("x-dead-letter-exchange", amqpProperties.getDeadLetterExchange());
return args;
}

View File

@@ -11,6 +11,7 @@ package org.eclipse.hawkbit.simulator.amqp;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.AbstractJavaTypeMapper;
import org.springframework.beans.factory.annotation.Autowired;
/**
@@ -48,6 +49,7 @@ public abstract class SenderService extends MessageService {
if (message == null) {
return;
}
message.getMessageProperties().getHeaders().remove(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME);
rabbitTemplate.setExchange(adress);
rabbitTemplate.send(message);
}

View File

@@ -131,11 +131,23 @@ public class SpReceiverService extends ReceiverService {
DownloadAndUpdateRequest.class);
final Long actionId = downloadAndUpdateRequest.getActionId();
try {
Thread.sleep(1_000);
} catch (final InterruptedException e) {
LOGGER.error("Sleep interrupted", e);
}
spSenderService.sendActionStatusMessage(tenant, ActionStatus.RUNNING,
"device Simulator retrieved update request. proceeding with simulation.", actionId);
final SimulatedUpdate update = new SimulatedUpdate(tenant, thingId, actionId);
try {
Thread.sleep(1_000);
} catch (final InterruptedException e) {
LOGGER.error("Sleep interrupted", e);
}
spSenderService.finishUpdateProcess(update, "Simulation complete!");
}

View File

@@ -216,9 +216,7 @@ public class SpSenderService extends SenderService {
private Message createActionStatusMessage(final SimulatedUpdate update, final String messageDescription,
final ActionStatus status) {
final Message sendMessage = createActionStatusMessage(update.getTenant(), status, messageDescription,
update.getActionId());
return sendMessage;
return createActionStatusMessage(update.getTenant(), status, messageDescription, update.getActionId());
}
}

View File

@@ -12,7 +12,7 @@
# PUBLIC configuration, i.e. can be changed by users at runtime (defaults provided here)
#########################################################################################
## Configuration for RabbitMQ communication
hawkbit.device.simulator.amqp.receiverConnectorQueueFromSp=sp_connector_receiver
hawkbit.device.simulator.amqp.receiverConnectorQueueFromSp=simulator_receiver
hawkbit.device.simulator.amqp.deadLetterQueue=simulator_deadletter
hawkbit.device.simulator.amqp.deadLetterExchange=simulator.deadletter
hawkbit.device.simulator.amqp.senderForSpExchange=simulator.replyTo
@@ -27,58 +27,6 @@ spring.rabbitmq.port=5672
spring.rabbitmq.dynamic=true
#disable expose jmx beans
spring.jmx.enabled=false
# the context path of the monitor spring actuator which offers following endpoints
# /autoconfig, /beans, /configprops, /dump, /env, /health, /info, /metrics, /mappings, /trace
management.context-path=/system
management.security.enabled=true
management.security.sessions=stateless
# ENDPOINTS
endpoints.autoconfig.id=autoconfig
endpoints.autoconfig.sensitive=true
endpoints.autoconfig.enabled=false
endpoints.beans.id=beans
endpoints.beans.sensitive=true
endpoints.beans.enabled=false
endpoints.configprops.id=configprops
endpoints.configprops.sensitive=true
endpoints.configprops.enabled=true
#endpoints.configprops.keys-to-sanitize=password,secret,key # suffix or regex
endpoints.dump.id=dump
endpoints.dump.sensitive=true
endpoints.dump.enabled=false
endpoints.env.id=env
endpoints.env.sensitive=true
endpoints.env.enabled=true
#endpoints.env.keys-to-sanitize=password,secret,key # suffix or regex
endpoints.health.id=health
endpoints.health.sensitive=true
endpoints.health.enabled=true
endpoints.info.id=info
endpoints.info.sensitive=true
endpoints.info.enabled=true
endpoints.metrics.id=metrics
endpoints.metrics.sensitive=true
endpoints.metrics.enabled=true
endpoints.shutdown.id=shutdown
endpoints.shutdown.sensitive=true
endpoints.shutdown.enabled=false
endpoints.trace.id=trace
endpoints.trace.sensitive=true
endpoints.trace.enabled=true
# HEALTH INDICATORS (previously health.*)
management.health.db.enabled=true
management.health.diskspace.enabled=true
management.health.mongo.enabled=true
management.health.rabbit.enabled=true
management.health.redis.enabled=false
management.health.solr.enabled=false
management.health.diskspace.path=.
management.health.diskspace.threshold=10485760
management.health.status.order=DOWN, OUT_OF_SERVICE, UNKNOWN, UP
# SECURITY (SecurityProperties)
security.user.name=${BASIC_USERNAME:admin}
security.user.password=${BASIC_PASSWORD:admin}
@@ -87,7 +35,7 @@ security.require-ssl=false
security.enable-csrf=false
security.basic.enabled=true
security.basic.realm=DeviceSimulator
security.basic.path= /system/**
security.basic.path= /**
security.basic.authorize-mode=ROLE
security.filter-order=0
security.headers.xss=false