Skip to content

Commit 481aef2

Browse files
authored
Merge pull request #138 from kit-data-manager/development
PR for release 1.1.1
2 parents 2298787 + 3f6e7bc commit 481aef2

File tree

7 files changed

+22
-19
lines changed

7 files changed

+22
-19
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [ master, main ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [ master, main ]
2020
schedule:
2121
- cron: '45 8 * * 2'
2222

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ Instead of using a local build you may also use the most recent version from the
3939
<dependency>
4040
<groupId>edu.kit.datamanager</groupId>
4141
<artifactId>repo-core</artifactId>
42-
<version>1.1.0</version>
42+
<version>1.1.1</version>
4343
</dependency>
4444
~~~~
4545

4646
### Gradle (short)
4747

4848
~~~~
49-
implementation "edu.kit.datamanager:repo-core:1.1.0"
49+
implementation "edu.kit.datamanager:repo-core:1.1.1"
5050
~~~~
5151

5252
## License

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ dependencies {
9191
implementation "org.apache.commons:commons-collections4:4.4"
9292
// includes commons-lang3
9393
implementation "org.apache.commons:commons-text:1.10.0"
94-
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
94+
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
9595
implementation "org.apache.tika:tika-core:2.6.0"
9696
// javers
9797
implementation "org.javers:javers-spring-boot-starter-sql:${javersVersion}"
98-
implementation "com.google.code.gson:gson:2.10"
98+
implementation "com.google.code.gson:gson:2.10.1"
9999

100100
// Database
101101
implementation "com.h2database:h2:2.1.214"

src/main/java/edu/kit/datamanager/service/impl/FileContentProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.Map;
2525
import javax.servlet.http.HttpServletResponse;
2626
import org.slf4j.Logger;
27+
import org.slf4j.LoggerFactory;
2728
import org.springframework.beans.factory.annotation.Autowired;
2829
import org.springframework.http.HttpHeaders;
2930
import org.springframework.http.HttpStatus;
@@ -37,8 +38,8 @@
3738
@Component
3839
public class FileContentProvider implements IContentProvider{
3940

40-
@Autowired
41-
private Logger logger;
41+
private Logger logger = LoggerFactory.getLogger(FileContentProvider.class);
42+
4243
@Autowired(required = false)
4344
private IRepoVersioningService[] versioningServices;
4445

src/main/java/edu/kit/datamanager/service/impl/LogfileMessagingService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import edu.kit.datamanager.entities.messaging.IAMQPSubmittable;
2020
import edu.kit.datamanager.service.IMessagingService;
2121
import org.slf4j.Logger;
22-
import org.springframework.beans.factory.annotation.Autowired;
22+
import org.slf4j.LoggerFactory;
2323
import org.springframework.boot.actuate.health.Health;
2424

2525
/**
@@ -28,8 +28,7 @@
2828
*/
2929
public class LogfileMessagingService implements IMessagingService {
3030

31-
@Autowired
32-
private Logger logger;
31+
private Logger logger = LoggerFactory.getLogger(LogfileMessagingService.class);
3332

3433
@Override
3534
public void send(IAMQPSubmittable msg) {

src/main/java/edu/kit/datamanager/service/impl/RabbitMQMessagingService.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import edu.kit.datamanager.repo.dao.IAMQPMessageDao;
2222
import edu.kit.datamanager.repo.dao.DummyAMQPMessageDao;
2323
import edu.kit.datamanager.repo.domain.AMQPMessage;
24-
import edu.kit.datamanager.repo.service.impl.DataResourceService;
2524
import org.springframework.beans.factory.annotation.Autowired;
2625
import edu.kit.datamanager.service.IMessagingService;
2726
import java.util.Optional;
@@ -42,15 +41,15 @@
4241
public class RabbitMQMessagingService implements IMessagingService {
4342

4443
@Autowired
45-
private RabbitMQConfiguration configuration;
44+
private Optional<RabbitMQConfiguration> configuration;
4645
@Autowired
4746
private Optional<IAMQPMessageDao> messageDao;
4847
private static final Logger logger = LoggerFactory.getLogger(RabbitMQMessagingService.class);
4948

5049
@Override
5150
public void send(IAMQPSubmittable msg) {
5251
logger.trace("Processing new AMQPSubmittable via RabbitMQMessagingService.");
53-
if (configuration.isMessagingEnabled()) {
52+
if (configuration.isPresent() && configuration.get().isMessagingEnabled()) {
5453
logger.trace("Messaging enabled, serializing and submitting message.");
5554
boolean messagePreservationRequired = true;
5655
String msgString = null;
@@ -59,9 +58,9 @@ public void send(IAMQPSubmittable msg) {
5958
try {
6059
msgString = msg.toJson();
6160
msgRoute = msg.getRoutingKey();
62-
exchangeName = configuration.rabbitMQExchange().getName();
61+
exchangeName = configuration.get().rabbitMQExchange().getName();
6362
logger.trace("Sending message {} via exchange {} and route {}.", msgString, exchangeName, msgRoute);
64-
configuration.rabbitMQTemplate().convertAndSend(configuration.rabbitMQExchange().getName(), msgRoute, msgString);
63+
configuration.get().rabbitMQTemplate().convertAndSend(configuration.get().rabbitMQExchange().getName(), msgRoute, msgString);
6564
logger.trace("Message sent.");
6665
messagePreservationRequired = false;
6766
checkAndSendPreservedMessages();
@@ -113,7 +112,11 @@ private void checkAndSendPreservedMessages() {
113112
@Override
114113
public Health health() {
115114
logger.trace("Obtaining health information.");
116-
return Health.up().withDetail("RabbitMQMessaging", configuration.rabbitMQExchange()).build();
115+
if (!configuration.isPresent() || !configuration.get().isMessagingEnabled()) {
116+
return Health.unknown().build();
117+
}
118+
119+
return Health.up().withDetail("RabbitMQMessaging", configuration.get().rabbitMQExchange()).build();
117120
}
118121

119122
}

src/test/java/edu/kit/datamanager/repo/configuration/WebSecurityConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import edu.kit.datamanager.security.filter.NoAuthenticationFilter;
2121
import edu.kit.datamanager.security.filter.NoopAuthenticationEventPublisher;
2222
import org.slf4j.Logger;
23+
import org.slf4j.LoggerFactory;
2324
import org.springframework.beans.factory.annotation.Autowired;
2425
import org.springframework.boot.web.servlet.FilterRegistrationBean;
2526
import org.springframework.context.annotation.Bean;
@@ -48,8 +49,7 @@
4849
@EnableGlobalMethodSecurity(prePostEnabled = true)
4950
public class WebSecurityConfig extends WebSecurityConfigurerAdapter{
5051

51-
@Autowired
52-
private Logger logger;
52+
private Logger logger = LoggerFactory.getLogger(WebSecurityConfig.class);
5353

5454
@Autowired
5555
private ApplicationProperties applicationProperties;

0 commit comments

Comments
 (0)