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:
4
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulator.java
Executable file → Normal file
4
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulator.java
Executable file → Normal file
@@ -20,6 +20,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@SpringBootApplication
|
||||
public class DeviceSimulator {
|
||||
|
||||
private DeviceSimulator() {
|
||||
// utility class
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the Spring Boot Application.
|
||||
*
|
||||
|
||||
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/SimulationController.java
Executable file → Normal file
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/SimulationController.java
Executable file → Normal file
18
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/AmqpConfiguration.java
Executable file → Normal file
18
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/AmqpConfiguration.java
Executable file → Normal 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;
|
||||
}
|
||||
|
||||
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/AmqpProperties.java
Executable file → Normal file
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/AmqpProperties.java
Executable file → Normal file
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/MessageHandlerCacheConstant.java
Executable file → Normal file
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/MessageHandlerCacheConstant.java
Executable file → Normal file
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/MessageService.java
Executable file → Normal file
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/MessageService.java
Executable file → Normal file
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/ReceiverService.java
Executable file → Normal file
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/ReceiverService.java
Executable file → Normal file
2
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/SenderService.java
Executable file → Normal file
2
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/SenderService.java
Executable file → Normal 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);
|
||||
}
|
||||
|
||||
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/SimulatedUpdate.java
Executable file → Normal file
0
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/SimulatedUpdate.java
Executable file → Normal file
12
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/SpReceiverService.java
Executable file → Normal file
12
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/SpReceiverService.java
Executable file → Normal 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!");
|
||||
}
|
||||
|
||||
|
||||
4
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/SpSenderService.java
Executable file → Normal file
4
examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/amqp/SpSenderService.java
Executable file → Normal 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
56
examples/hawkbit-device-simulator/src/main/resources/application.properties
Executable file → Normal file
56
examples/hawkbit-device-simulator/src/main/resources/application.properties
Executable file → Normal 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
|
||||
|
||||
Reference in New Issue
Block a user