Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
56a77f9
Initial migration from TestNG to JUnit 5
Knud-Aage Dec 11, 2025
d41038e
Initial
Knud-Aage Dec 15, 2025
f50949f
Merge remote-tracking branch 'origin/master' into BITMAG-1244-replace…
Knud-Aage Dec 16, 2025
7ec116c
Changes due to PR
Knud-Aage Dec 16, 2025
305d6fa
Working but with errors in a few tests.
Knud-Aage Dec 17, 2025
c58d749
Merge remote-tracking branch 'origin/BITMAG-1244-replace-testng-with-…
Knud-Aage Dec 17, 2025
155ad25
Put a @Disabled at testManyTimes() and commented it out, so people ca…
Knud-Aage Dec 17, 2025
8d421a4
The branch has now the same test methods that are wrong, but mvn clea…
Knud-Aage Dec 18, 2025
6d94dcf
Able to test in junit
Knud-Aage Dec 18, 2025
330c1ef
Merge branch 'BITMAG-1244-junit-bitrepository-core' into BITMAG-1244-…
Knud-Aage Dec 18, 2025
56f5133
Many tests migrated to junit but a log missing
Knud-Aage Dec 19, 2025
5888407
All tests succeeds after having been migrated from TestNG to JUnit 5
Knud-Aage Dec 26, 2025
f96a705
Removed the TestNG dependency
Knud-Aage Jan 1, 2026
7553d82
The suite classes looks for tags instead of classes
Knud-Aage Jan 5, 2026
c565330
Modified setupPillarIntegrationTest method so it reflects junit 5 ins…
Knud-Aage Jan 5, 2026
bbeace6
Now closer to without testng
Knud-Aage Jan 6, 2026
f38d907
All the tests has been migrated to use allure instead of jaccept beca…
Knud-Aage Jan 12, 2026
86ee150
The disableness annotations have been commented out to enable stress …
Knud-Aage Jan 13, 2026
dc838ff
Minor adjustments
Knud-Aage Jan 13, 2026
6ddc6fa
Merge branch 'BITMAG-1244-testng-junit-all' into BITMAG-1244-remove-j…
Knud-Aage Jan 14, 2026
b8e8b1e
Removed allure errors and updated test
Knud-Aage Jan 16, 2026
c3ffb66
Changes to pom.xml to ensure allure tests folders are correctly confi…
Knud-Aage Jan 20, 2026
c99b44c
Changes due to PR review
Knud-Aage Jan 21, 2026
af01ae1
Changes due to PR review
Knud-Aage Jan 21, 2026
c5a6865
Changes due to PR review
Knud-Aage Jan 21, 2026
66b0dfb
Changes due to PR review
Knud-Aage Jan 21, 2026
3ed247d
Changes due to PR review
Knud-Aage Jan 21, 2026
ffb86f3
Changes due to PR review
Knud-Aage Jan 21, 2026
321294c
Changes due to PR review
Knud-Aage Jan 25, 2026
139bd5f
Changes due to PR review
Knud-Aage Jan 25, 2026
f9b322f
Changes due to PR review
Knud-Aage Jan 26, 2026
a695e1e
In the middle of refactoring
Knud-Aage Jan 27, 2026
6c0f819
In the middle of refactoring
Knud-Aage Jan 29, 2026
bea4ac8
In the middle of refactoring
Knud-Aage Jan 29, 2026
77c8b58
In the middle of refactoring
Knud-Aage Jan 29, 2026
f215c86
In the middle of refactoring
Knud-Aage Feb 4, 2026
9a7f463
Mostly works
Asger-KB Feb 4, 2026
0c83df0
Suite config
Asger-KB Feb 4, 2026
3f96515
No response tests
Asger-KB Feb 4, 2026
6134673
Ready for PR
Knud-Aage Feb 5, 2026
0caaece
Merge branch 'BITMAG-1244-testng-junit-all-asga' into BITMAG-1244-rem…
Knud-Aage Feb 5, 2026
6274dd6
Merged in the source branch
Knud-Aage Feb 6, 2026
f2dddfc
Ready for PR
Knud-Aage Feb 7, 2026
05f60e0
All unit tests passes
Knud-Aage Feb 7, 2026
3c4b9ef
Merge branch 'BITMAG-1244-testng-junit-all-asga' into BITMAG-1244-rem…
Knud-Aage Feb 8, 2026
75c0133
All unit tests passes
Knud-Aage Feb 9, 2026
e052d65
In pom.xml: Removed the commented out dependency of TestNG
Knud-Aage Feb 9, 2026
2847c77
Refactored due to PR
Knud-Aage Feb 10, 2026
b8051ce
Removed forbidden reflection
Asger-KB Feb 10, 2026
8e51496
Removed many static import
Knud-Aage Feb 11, 2026
7f37791
Refactored due to PR review
Knud-Aage Feb 12, 2026
f148f8d
Refactored due to PR review
Knud-Aage Feb 14, 2026
5e25f94
Merge branch 'BITMAG-1244-testng-junit-all-asga' into BITMAG-1244-rem…
Knud-Aage Feb 15, 2026
967e702
Merged and refactored with migration from TestNG to JUnit version
Knud-Aage Feb 16, 2026
c0ed598
Reduced most of the places that the line exceeds 120 characters.
Knud-Aage Feb 16, 2026
8184ea4
Reduced most of the places that the line exceeds 120 characters.
Knud-Aage Feb 16, 2026
b5ce23e
Refactoring due to PR
Knud-Aage Feb 17, 2026
07dbeac
Refactoring due to PR
Knud-Aage Feb 17, 2026
b2f357b
Refactoring due to PR
Knud-Aage Feb 17, 2026
f105470
Merge branch 'BITMAG-1244-testng-junit-all-asga' into BITMAG-1244-rem…
Knud-Aage Feb 18, 2026
afdf49f
Merged with testng junit all asga
Knud-Aage Feb 19, 2026
74c7282
Merge remote-tracking branch 'origin/master' into BITMAG-1244-remove-…
Knud-Aage Feb 19, 2026
3f7627b
Fixing merge errors
Knud-Aage Feb 20, 2026
6eb1890
Fixing merge errors
Knud-Aage Feb 20, 2026
1d5e68a
Fixing merge errors
Knud-Aage Feb 20, 2026
decf0e7
All the Allure reports are put in one folder in the bitrepository/tar…
Knud-Aage Mar 4, 2026
cb41730
The stress tests that gave a lot of files in the reference pillars re…
Knud-Aage Mar 4, 2026
02b9971
Merged in AllureTestUtils improvements and added code for handling Al…
Knud-Aage Mar 5, 2026
b45b028
Handles AllureLifecycle logging aas noise which isn't really errors a…
Knud-Aage Mar 5, 2026
053a783
Placed AllureTestUtils and AllureEventLogger in common/utils
Knud-Aage Mar 6, 2026
8d9f6d6
Refactore of AllureTestUtils and removed jaccept.properties file sinc…
Knud-Aage Mar 6, 2026
ed72956
Removed jaccept properties
Knud-Aage Mar 11, 2026
a155961
Importing Allure instead of io.qameta.allure and changed getAuditTrai…
Knud-Aage Mar 11, 2026
efe3154
Minor corrections and deleted MessageSenderStub.java
Knud-Aage Mar 11, 2026
5a9fd78
Minor corrections and deleted AllureEventLogger.java
Knud-Aage Mar 11, 2026
9c2d929
Asger’s fix to the build
ole-v-v Mar 12, 2026
c9e81a0
Merge remote-tracking branch 'origin/BITMAG-1244-remove-jaccept' into…
Knud-Aage Mar 12, 2026
3ff431d
Refactored due to PR and removed unused files
Knud-Aage Mar 12, 2026
cf6f5bc
Indented
Knud-Aage Mar 12, 2026
9bdadec
Changed Allure.addAttachment from text/plain to text/html.
Knud-Aage Mar 12, 2026
6f319cc
Deleted deleteAllFiles method
Knud-Aage Mar 12, 2026
12d7dac
Changes due to PR review
Knud-Aage Mar 12, 2026
7f7cd78
Removed jaccept.properties and changed jaccept to Allure in comments
Knud-Aage Mar 12, 2026
0ad7c29
Refactored code due to PR
Knud-Aage Mar 13, 2026
352f884
Fixxed security vulnerabilities by updating dependencies to newer ver…
Knud-Aage Mar 16, 2026
5216137
Changes due to PR
Knud-Aage Mar 16, 2026
8450d2e
Merge remote-tracking branch 'origin/master' into BITMAG-1244-remove-…
Knud-Aage Mar 17, 2026
d0da197
Merged with master
Knud-Aage Mar 17, 2026
de928db
Changes due to PR
Knud-Aage Mar 17, 2026
4434b69
Finished the date/time modernizing of all classes
Knud-Aage Mar 22, 2026
8993ba3
More methods which deprecates XMLGregorianCalendar and Date and use m…
Knud-Aage Mar 24, 2026
0f49fcd
More classes updated to have a more modern date/time handling.
Knud-Aage Mar 25, 2026
5cf3168
More classes updated to have a more modern date/time handling.
Knud-Aage Mar 25, 2026
27ca619
More classes updated to have a more modern date/time handling.
Knud-Aage Mar 25, 2026
1282e61
More classes updated or refactored to have a more modern date/time ha…
Knud-Aage Mar 27, 2026
8c96b23
Initial migration from TestNG to JUnit 5
Knud-Aage Dec 11, 2025
d5d6321
Changes due to PR
Knud-Aage Dec 16, 2025
069495c
Able to test in junit
Knud-Aage Dec 18, 2025
1adc5ce
Initial
Knud-Aage Dec 15, 2025
947e6eb
Working but with errors in a few tests.
Knud-Aage Dec 17, 2025
28b56d8
Put a @Disabled at testManyTimes() and commented it out, so people ca…
Knud-Aage Dec 17, 2025
2ef8f75
The branch has now the same test methods that are wrong, but mvn clea…
Knud-Aage Dec 18, 2025
deccdd7
Many tests migrated to junit but a log missing
Knud-Aage Dec 19, 2025
c1feb0f
All tests succeeds after having been migrated from TestNG to JUnit 5
Knud-Aage Dec 26, 2025
5302c1f
Removed the TestNG dependency
Knud-Aage Jan 1, 2026
a173f23
The suite classes looks for tags instead of classes
Knud-Aage Jan 5, 2026
ae08641
Modified setupPillarIntegrationTest method so it reflects junit 5 ins…
Knud-Aage Jan 5, 2026
582ca5d
Now closer to without testng
Knud-Aage Jan 6, 2026
c3d29f7
All the tests has been migrated to use allure instead of jaccept beca…
Knud-Aage Jan 12, 2026
feaface
The disableness annotations have been commented out to enable stress …
Knud-Aage Jan 13, 2026
ef43e16
Minor adjustments
Knud-Aage Jan 13, 2026
d377c20
Removed allure errors and updated test
Knud-Aage Jan 16, 2026
fdbc70c
Changes to pom.xml to ensure allure tests folders are correctly confi…
Knud-Aage Jan 20, 2026
bcff860
Changes due to PR review
Knud-Aage Jan 21, 2026
a83bdbd
Changes due to PR review
Knud-Aage Jan 21, 2026
8caae9b
Changes due to PR review
Knud-Aage Jan 21, 2026
26dab47
Changes due to PR review
Knud-Aage Jan 21, 2026
3947b4a
Changes due to PR review
Knud-Aage Jan 21, 2026
ac0064c
Changes due to PR review
Knud-Aage Jan 21, 2026
bf301a7
Changes due to PR review
Knud-Aage Jan 25, 2026
654d0ae
Changes due to PR review
Knud-Aage Jan 25, 2026
874c3f4
Changes due to PR review
Knud-Aage Jan 26, 2026
9bfc68d
In the middle of refactoring
Knud-Aage Jan 27, 2026
63f439f
In the middle of refactoring
Knud-Aage Jan 29, 2026
ab9d8ac
In the middle of refactoring
Knud-Aage Jan 29, 2026
735e184
In the middle of refactoring
Knud-Aage Jan 29, 2026
eb5f6f2
In the middle of refactoring
Knud-Aage Feb 4, 2026
f421519
Mostly works
Asger-KB Feb 4, 2026
873a4e9
Suite config
Asger-KB Feb 4, 2026
f5b358f
Ready for PR
Knud-Aage Feb 5, 2026
df58aac
Merged in the source branch
Knud-Aage Feb 6, 2026
dd5f886
Ready for PR
Knud-Aage Feb 7, 2026
075c5f3
All unit tests passes
Knud-Aage Feb 7, 2026
bfa30b9
All unit tests passes
Knud-Aage Feb 9, 2026
a11dc7a
In pom.xml: Removed the commented out dependency of TestNG
Knud-Aage Feb 9, 2026
7ea8341
Refactored due to PR
Knud-Aage Feb 10, 2026
d88d734
Removed forbidden reflection
Asger-KB Feb 10, 2026
70435d7
Removed many static import
Knud-Aage Feb 11, 2026
8554410
Refactored due to PR review
Knud-Aage Feb 12, 2026
b1f0a0a
Refactored due to PR review
Knud-Aage Feb 14, 2026
4a2a560
Merged and refactored with migration from TestNG to JUnit version
Knud-Aage Feb 16, 2026
76c696f
Reduced most of the places that the line exceeds 120 characters.
Knud-Aage Feb 16, 2026
53c4fdb
Reduced most of the places that the line exceeds 120 characters.
Knud-Aage Feb 16, 2026
bdedb67
Refactoring due to PR
Knud-Aage Feb 17, 2026
8af967e
Refactoring due to PR
Knud-Aage Feb 17, 2026
938c038
Refactoring due to PR
Knud-Aage Feb 17, 2026
bebd5a6
Merged with testng junit all asga
Knud-Aage Feb 19, 2026
0b42f81
Fixing merge errors
Knud-Aage Feb 20, 2026
9d07b83
Fixing merge errors
Knud-Aage Feb 20, 2026
39eb4c9
All the Allure reports are put in one folder in the bitrepository/tar…
Knud-Aage Mar 4, 2026
0ed8a49
The stress tests that gave a lot of files in the reference pillars re…
Knud-Aage Mar 4, 2026
0edac86
Merged in AllureTestUtils improvements and added code for handling Al…
Knud-Aage Mar 5, 2026
98ab57c
Handles AllureLifecycle logging aas noise which isn't really errors a…
Knud-Aage Mar 5, 2026
080b632
Placed AllureTestUtils and AllureEventLogger in common/utils
Knud-Aage Mar 6, 2026
5271330
Refactore of AllureTestUtils and removed jaccept.properties file sinc…
Knud-Aage Mar 6, 2026
01f540b
Removed jaccept properties
Knud-Aage Mar 11, 2026
0b0b3bf
Importing Allure instead of io.qameta.allure and changed getAuditTrai…
Knud-Aage Mar 11, 2026
18502bd
Minor corrections and deleted MessageSenderStub.java
Knud-Aage Mar 11, 2026
3a13d6d
Minor corrections and deleted AllureEventLogger.java
Knud-Aage Mar 11, 2026
859eef8
Asger’s fix to the build
ole-v-v Mar 12, 2026
258bb77
Refactored due to PR and removed unused files
Knud-Aage Mar 12, 2026
8e439cb
Indented
Knud-Aage Mar 12, 2026
a6a1f37
Changed Allure.addAttachment from text/plain to text/html.
Knud-Aage Mar 12, 2026
9a2dc94
Deleted deleteAllFiles method
Knud-Aage Mar 12, 2026
6d3de06
Changes due to PR review
Knud-Aage Mar 12, 2026
49caaa4
Removed jaccept.properties and changed jaccept to Allure in comments
Knud-Aage Mar 12, 2026
11d3e8e
Refactored code due to PR
Knud-Aage Mar 13, 2026
4e66e4b
Fixxed security vulnerabilities by updating dependencies to newer ver…
Knud-Aage Mar 16, 2026
4fae197
Changes due to PR
Knud-Aage Mar 16, 2026
695db38
Merged with master
Knud-Aage Mar 17, 2026
bbcd37e
Changes due to PR
Knud-Aage Mar 17, 2026
1ea136e
Merge pull request #78 from bitrepository/BITMAG-1244-remove-jaccept
Knud-Aage Mar 27, 2026
fa0dd91
Initial migration from TestNG to JUnit 5
Knud-Aage Dec 11, 2025
9418445
Initial
Knud-Aage Dec 15, 2025
099fb0d
Working but with errors in a few tests.
Knud-Aage Dec 17, 2025
6bdf3f5
The branch has now the same test methods that are wrong, but mvn clea…
Knud-Aage Dec 18, 2025
a1bf956
Many tests migrated to junit but a log missing
Knud-Aage Dec 19, 2025
2c1e980
All tests succeeds after having been migrated from TestNG to JUnit 5
Knud-Aage Dec 26, 2025
0971853
The suite classes looks for tags instead of classes
Knud-Aage Jan 5, 2026
d237058
Now closer to without testng
Knud-Aage Jan 6, 2026
b16f62d
All the tests has been migrated to use allure instead of jaccept beca…
Knud-Aage Jan 12, 2026
b050d31
Minor adjustments
Knud-Aage Jan 13, 2026
6a4fc4f
Removed allure errors and updated test
Knud-Aage Jan 16, 2026
01400a1
Changes due to PR review
Knud-Aage Jan 21, 2026
aa82359
Changes due to PR review
Knud-Aage Jan 21, 2026
8583215
Changes due to PR review
Knud-Aage Jan 21, 2026
82da7fa
Changes due to PR review
Knud-Aage Jan 21, 2026
1428e41
Changes due to PR review
Knud-Aage Jan 25, 2026
b8b14f3
In the middle of refactoring
Knud-Aage Jan 29, 2026
354c670
In the middle of refactoring
Knud-Aage Feb 4, 2026
0246001
Mostly works
Asger-KB Feb 4, 2026
90d9173
Suite config
Asger-KB Feb 4, 2026
2399b65
Ready for PR
Knud-Aage Feb 5, 2026
765f3c0
Merged in the source branch
Knud-Aage Feb 6, 2026
62744c9
Ready for PR
Knud-Aage Feb 7, 2026
33b823e
All unit tests passes
Knud-Aage Feb 7, 2026
72a1868
All unit tests passes
Knud-Aage Feb 9, 2026
e2c029f
Refactored due to PR
Knud-Aage Feb 10, 2026
0dc8146
Removed many static import
Knud-Aage Feb 11, 2026
c126003
Refactored due to PR review
Knud-Aage Feb 14, 2026
b0a922d
Merged and refactored with migration from TestNG to JUnit version
Knud-Aage Feb 16, 2026
790247f
Reduced most of the places that the line exceeds 120 characters.
Knud-Aage Feb 16, 2026
1d184fb
Refactoring due to PR
Knud-Aage Feb 17, 2026
8954c2e
Refactoring due to PR
Knud-Aage Feb 17, 2026
f1f1a35
Refactoring due to PR
Knud-Aage Feb 17, 2026
a296e9d
Merged with testng junit all asga
Knud-Aage Feb 19, 2026
fd29397
Fixing merge errors
Knud-Aage Feb 20, 2026
6eb1ff2
Fixing merge errors
Knud-Aage Feb 20, 2026
b86e0cc
All the Allure reports are put in one folder in the bitrepository/tar…
Knud-Aage Mar 4, 2026
89db8cf
The stress tests that gave a lot of files in the reference pillars re…
Knud-Aage Mar 4, 2026
a86746b
Merged in AllureTestUtils improvements and added code for handling Al…
Knud-Aage Mar 5, 2026
5ef8d50
Placed AllureTestUtils and AllureEventLogger in common/utils
Knud-Aage Mar 6, 2026
5a31b31
Importing Allure instead of io.qameta.allure and changed getAuditTrai…
Knud-Aage Mar 11, 2026
55357b2
Minor corrections and deleted MessageSenderStub.java
Knud-Aage Mar 11, 2026
cd26ba3
Changes due to PR review
Knud-Aage Mar 12, 2026
622f225
Refactored code due to PR
Knud-Aage Mar 13, 2026
635a15f
Merged with master
Knud-Aage Mar 17, 2026
7fab4a4
Changes due to PR
Knud-Aage Mar 17, 2026
5633dfd
Finished the date/time modernizing of all classes
Knud-Aage Mar 22, 2026
0dbae53
More methods which deprecates XMLGregorianCalendar and Date and use m…
Knud-Aage Mar 24, 2026
5c5e039
More classes updated to have a more modern date/time handling.
Knud-Aage Mar 25, 2026
18fc4d7
More classes updated to have a more modern date/time handling.
Knud-Aage Mar 25, 2026
e2c40ed
More classes updated to have a more modern date/time handling.
Knud-Aage Mar 25, 2026
04d5a1f
More classes updated or refactored to have a more modern date/time ha…
Knud-Aage Mar 27, 2026
d227832
Merged with master and made necessary updates
Knud-Aage Mar 31, 2026
71cda01
Merge remote-tracking branch 'origin/BITMAG-1247-date-time-modernizin…
Knud-Aage Mar 31, 2026
7278d4f
Deleted a }
Knud-Aage Mar 31, 2026
e4d3148
Changes due to PR
Knud-Aage Apr 9, 2026
3a53c95
Inserted space after (Instant) if there were no one.
Knud-Aage Apr 9, 2026
6ea62eb
Changes due to PR
Knud-Aage Apr 9, 2026
1dfbfa2
Changes due to PR
Knud-Aage Apr 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bitrepository-alarm-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@

<build>
<plugins>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.12.0</version>
<configuration>
<resultsDirectory>${project.build.directory}/allure-results</resultsDirectory>
<reportDirectory>${project.build.directory}/allure-report</reportDirectory>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.bitrepository.bitrepositoryelements.AlarmCode;
import org.bitrepository.service.LifeCycledService;

import java.time.Instant;
import java.util.Collection;
import java.util.Date;

Expand Down Expand Up @@ -56,7 +57,14 @@ public interface AlarmService extends LifeCycledService {
* @param ascending Whether the alarms should be delivered ascending.
* @return The requested collection of alarms from the store.
*/
Collection<Alarm> extractAlarms(String componentID, AlarmCode alarmCode, Date minDate, Date maxDate,
String fileID, String collectionID, Integer maxResults, boolean ascending);
@Deprecated(forRemoval = true)
default Collection<Alarm> extractAlarms(String componentID, AlarmCode alarmCode, Date minDate, Date maxDate,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elegant solution for an interface method that used the old Date type.

String fileID, String collectionID, Integer maxResults, boolean ascending) {
Instant min = minDate != null ? minDate.toInstant() : null;
Instant max = maxDate != null ? maxDate.toInstant() : null;
return extractAlarms(componentID, alarmCode, min, max, fileID, collectionID, maxResults, ascending);
}

Collection<Alarm> extractAlarms(String componentID, AlarmCode alarmCode, Instant instant, Instant instant1,
String fileID, String collectionID, Integer maxResults, boolean ascending);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
import org.slf4j.LoggerFactory;

import javax.jms.JMSException;
import java.time.Instant;
import java.util.Collection;
import java.util.Date;

public class BasicAlarmService implements AlarmService {
private final Logger log = LoggerFactory.getLogger(this.getClass());
Expand Down Expand Up @@ -90,7 +90,7 @@ public void shutdown() {
public void start() {}

@Override
public Collection<Alarm> extractAlarms(String componentID, AlarmCode alarmCode, Date minDate, Date maxDate,
public Collection<Alarm> extractAlarms(String componentID, AlarmCode alarmCode, Instant minDate, Instant maxDate,
String fileID, String collectionID, Integer maxResults, boolean ascending) {
return store.extractAlarms(componentID, alarmCode, minDate, maxDate, fileID, collectionID, maxResults, ascending);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import java.time.Instant;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
import java.util.stream.Collectors;

@Path("/AlarmService")
public class RestAlarmService {
private final AlarmService alarmService;
private final CalendarUtils calendarUtils = CalendarUtils.getInstance(TimeZone.getDefault());
private final CalendarUtils calendarUtils = CalendarUtils.getInstance(ZoneId.systemDefault());

public RestAlarmService() {
alarmService = AlarmServiceFactory.getAlarmService();
Expand All @@ -63,7 +63,7 @@ public RestAlarmService() {
@Path("/getShortAlarmList/")
@Produces("application/json")
public List<Alarm> getShortAlarmList() {
return new ArrayList<>(alarmService.extractAlarms(null, null, null, null,
return new ArrayList<>(alarmService.extractAlarms(null, null, (Instant) null, (Instant) null,
null, null, 10, false));
}

Expand All @@ -76,7 +76,7 @@ public List<Alarm> getShortAlarmList() {
@Path("/getFullAlarmList/")
@Produces("application/json")
public List<Alarm> getFullAlarmList() {
return new ArrayList<>(alarmService.extractAlarms(null, null, null, null,
return new ArrayList<>(alarmService.extractAlarms(null, null, (Instant) null, (Instant) null,
null, null, null, true));
}

Expand All @@ -103,8 +103,8 @@ public List<WebAlarm> queryAlarms(
@DefaultValue("true")
@FormParam("oldestAlarmFirst")
boolean oldestAlarmFirst) {
Date from = calendarUtils.makeStartDateObject(fromDate);
Date to = calendarUtils.makeEndDateObject(toDate);
Instant from = calendarUtils.makeStartInstant(fromDate);
Instant to = calendarUtils.makeEndInstant(toDate);

Collection<Alarm> alarms = alarmService.extractAlarms(contentOrNull(reportingComponent), makeAlarmCode(alarmCode), from, to,
contentOrNull(fileID), makeCollectionID(collectionID), maxAlarms, oldestAlarmFirst);
Expand All @@ -117,8 +117,8 @@ public List<WebAlarm> queryAlarms(
@Consumes("application/json")
@Produces("application/json")
public List<Alarm> queryAlarms(AlarmServiceInput input) {
Date from = calendarUtils.makeStartDateObject(input.getFromDate());
Date to = calendarUtils.makeEndDateObject(input.getToDate());
Instant from = calendarUtils.makeStartInstant(input.getFromDate());
Instant to = calendarUtils.makeEndInstant(input.getToDate());

Collection<Alarm> alarms = alarmService.extractAlarms(contentOrNull(input.getReportingComponent()),
makeAlarmCode(input.getAlarmCode()), from, to, contentOrNull(input.getFileID()), makeCollectionID(input.getCollectionID()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class WebAlarm {
public WebAlarm(Alarm alarm) {
collectionID = alarm.getCollectionID() == null ? "" : alarm.getCollectionID();
fileID = (alarm.getFileID() == null) ? "" : alarm.getFileID();
origDateTime = TimeUtils.shortDate(CalendarUtils.convertFromXMLGregorianCalendar(alarm.getOrigDateTime()));
origDateTime = TimeUtils.shortDate(CalendarUtils.convertFromXMLGregorianCalendarToInstant(alarm.getOrigDateTime()));
alarmRaiser = alarm.getAlarmRaiser();
alarmCode = alarm.getAlarmCode();
alarmText = alarm.getAlarmText();
Expand Down

This file was deleted.

Loading