Skip to content

Commit bd204ad

Browse files
author
Dennis Labordus
authored
Merge pull request #197 from com-pas/develop
New release
2 parents 83e3344 + 16401ee commit bd204ad

File tree

23 files changed

+278
-101
lines changed

23 files changed

+278
-101
lines changed

commons/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ SPDX-License-Identifier: Apache-2.0
3838
</dependency>
3939

4040
<dependency>
41-
<groupId>org.slf4j</groupId>
42-
<artifactId>slf4j-api</artifactId>
41+
<groupId>org.apache.logging.log4j</groupId>
42+
<artifactId>log4j-api</artifactId>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.apache.logging.log4j</groupId>
46+
<artifactId>log4j-core</artifactId>
47+
<scope>provided</scope>
4348
</dependency>
4449

4550
<dependency>
@@ -52,11 +57,6 @@ SPDX-License-Identifier: Apache-2.0
5257
<artifactId>junit-jupiter-engine</artifactId>
5358
<scope>test</scope>
5459
</dependency>
55-
<dependency>
56-
<groupId>org.slf4j</groupId>
57-
<artifactId>slf4j-simple</artifactId>
58-
<scope>test</scope>
59-
</dependency>
6060
<dependency>
6161
<groupId>org.hibernate.validator</groupId>
6262
<artifactId>hibernate-validator</artifactId>

commons/src/main/java/org/lfenergy/compas/core/commons/ElementConverter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// SPDX-License-Identifier: Apache-2.0
44
package org.lfenergy.compas.core.commons;
55

6+
import org.apache.logging.log4j.LogManager;
7+
import org.apache.logging.log4j.Logger;
68
import org.lfenergy.compas.core.commons.exception.CompasException;
7-
import org.slf4j.Logger;
8-
import org.slf4j.LoggerFactory;
99
import org.w3c.dom.Element;
1010
import org.xml.sax.InputSource;
1111
import org.xml.sax.SAXException;
@@ -27,7 +27,7 @@
2727
import static org.lfenergy.compas.core.commons.exception.CompasErrorCode.CONVERT_TO_STRING_ERROR;
2828

2929
public class ElementConverter {
30-
private static final Logger LOGGER = LoggerFactory.getLogger(ElementConverter.class);
30+
private static final Logger LOGGER = LogManager.getLogger(ElementConverter.class);
3131

3232
public String convertToString(Element element) {
3333
return convertToString(element, true);

commons/src/main/java/org/lfenergy/compas/core/commons/MarshallerWrapper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import com.fasterxml.jackson.databind.ObjectMapper;
88
import com.fasterxml.jackson.databind.node.JsonNodeType;
99
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
10+
import org.apache.logging.log4j.LogManager;
11+
import org.apache.logging.log4j.Logger;
1012
import org.lfenergy.compas.core.commons.exception.CompasException;
11-
import org.slf4j.Logger;
12-
import org.slf4j.LoggerFactory;
1313
import org.xml.sax.SAXException;
1414

1515
import javax.xml.XMLConstants;
@@ -30,7 +30,7 @@
3030
import static org.lfenergy.compas.core.commons.exception.CompasErrorCode.*;
3131

3232
public abstract class MarshallerWrapper<T> {
33-
private static final Logger LOGGER = LoggerFactory.getLogger(MarshallerWrapper.class);
33+
private static final Logger LOGGER = LogManager.getLogger(MarshallerWrapper.class);
3434

3535
private final Unmarshaller jaxbUnmarshaller;
3636
private final Marshaller jaxbMarshaller;

commons/src/main/java/org/lfenergy/compas/core/commons/constraint/impl/XmlAnyElementConstraintValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// SPDX-License-Identifier: Apache-2.0
44
package org.lfenergy.compas.core.commons.constraint.impl;
55

6+
import org.apache.logging.log4j.LogManager;
7+
import org.apache.logging.log4j.Logger;
68
import org.lfenergy.compas.core.commons.constraint.XmlAnyElementValid;
7-
import org.slf4j.Logger;
8-
import org.slf4j.LoggerFactory;
99
import org.w3c.dom.Element;
1010

1111
import javax.validation.ConstraintValidator;
@@ -17,7 +17,7 @@
1717
* element are correct and also if the element(s) in the list have the correct Local Name and the correct Namespace.
1818
*/
1919
public class XmlAnyElementConstraintValidator implements ConstraintValidator<XmlAnyElementValid, List<Element>> {
20-
private static final Logger LOGGER = LoggerFactory.getLogger(XmlAnyElementConstraintValidator.class);
20+
private static final Logger LOGGER = LogManager.getLogger(XmlAnyElementConstraintValidator.class);
2121

2222
private String elementName;
2323
private String elementNamespace;

commons/src/test/resources/log4j2.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
SPDX-FileCopyrightText: 2022 Alliander N.V.
4+
5+
SPDX-License-Identifier: Apache-2.0
6+
-->
7+
<Configuration strict="true" name="TestConfiguration">
8+
<Appenders>
9+
<Appender type="Console" name="STDOUT">
10+
<Layout type="PatternLayout" pattern="%d %p %C{3.} [%t] %m%n"/>
11+
</Appender>
12+
</Appenders>
13+
14+
<Loggers>
15+
<Logger name="org.lfenergy.compas" level="debug" additivity="false">
16+
<AppenderRef ref="STDOUT"/>
17+
</Logger>
18+
19+
<Root level="debug">
20+
<AppenderRef ref="STDOUT"/>
21+
</Root>
22+
</Loggers>
23+
</Configuration>

pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ SPDX-License-Identifier: Apache-2.0
2020
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2121

2222
<compas.scl.xsd.version>0.0.4</compas.scl.xsd.version>
23-
<quarkus.platform.version>2.14.0.Final</quarkus.platform.version>
24-
<slf4j.version>2.0.3</slf4j.version>
23+
<quarkus.platform.version>2.14.1.Final</quarkus.platform.version>
2524
<jaxb.bind.version>2.3.7</jaxb.bind.version>
25+
<log4j2.version>2.19.0</log4j2.version>
2626
<openpojo.version>0.9.1</openpojo.version>
2727
</properties>
2828

@@ -91,14 +91,14 @@ SPDX-License-Identifier: Apache-2.0
9191
</dependency>
9292

9393
<dependency>
94-
<groupId>org.slf4j</groupId>
95-
<artifactId>slf4j-api</artifactId>
96-
<version>${slf4j.version}</version>
94+
<groupId>org.apache.logging.log4j</groupId>
95+
<artifactId>log4j-api</artifactId>
96+
<version>${log4j2.version}</version>
9797
</dependency>
9898
<dependency>
99-
<groupId>org.slf4j</groupId>
100-
<artifactId>slf4j-simple</artifactId>
101-
<version>${slf4j.version}</version>
99+
<groupId>org.apache.logging.log4j</groupId>
100+
<artifactId>log4j-core</artifactId>
101+
<version>${log4j2.version}</version>
102102
</dependency>
103103

104104
<dependency>

rest-commons/pom.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ SPDX-License-Identifier: Apache-2.0
2929
</dependency>
3030

3131
<dependency>
32-
<groupId>org.slf4j</groupId>
33-
<artifactId>slf4j-api</artifactId>
32+
<groupId>org.apache.logging.log4j</groupId>
33+
<artifactId>log4j-api</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.apache.logging.log4j</groupId>
37+
<artifactId>log4j-core</artifactId>
38+
<scope>provided</scope>
3439
</dependency>
3540

3641
<dependency>
@@ -54,11 +59,5 @@ SPDX-License-Identifier: Apache-2.0
5459
<artifactId>resteasy-core</artifactId>
5560
<scope>test</scope>
5661
</dependency>
57-
58-
<dependency>
59-
<groupId>org.slf4j</groupId>
60-
<artifactId>slf4j-simple</artifactId>
61-
<scope>test</scope>
62-
</dependency>
6362
</dependencies>
6463
</project>

rest-commons/src/main/java/org/lfenergy/compas/core/rest/exception/CompasExceptionHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
// SPDX-License-Identifier: Apache-2.0
44
package org.lfenergy.compas.core.rest.exception;
55

6+
import org.apache.logging.log4j.LogManager;
7+
import org.apache.logging.log4j.Logger;
68
import org.lfenergy.compas.core.commons.exception.CompasException;
79
import org.lfenergy.compas.core.commons.model.ErrorResponse;
8-
import org.slf4j.Logger;
9-
import org.slf4j.LoggerFactory;
1010

1111
import javax.ws.rs.core.Response;
1212
import javax.ws.rs.ext.ExceptionMapper;
1313
import javax.ws.rs.ext.Provider;
1414

1515
@Provider
1616
public class CompasExceptionHandler implements ExceptionMapper<CompasException> {
17-
private static final Logger LOGGER = LoggerFactory.getLogger(CompasExceptionHandler.class);
17+
private static final Logger LOGGER = LogManager.getLogger(CompasExceptionHandler.class);
1818

1919
@Override
2020
public Response toResponse(CompasException exception) {

rest-commons/src/main/java/org/lfenergy/compas/core/rest/exception/ConstraintViolationExceptionHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// SPDX-License-Identifier: Apache-2.0
44
package org.lfenergy.compas.core.rest.exception;
55

6+
import org.apache.logging.log4j.LogManager;
7+
import org.apache.logging.log4j.Logger;
68
import org.lfenergy.compas.core.commons.model.ErrorResponse;
7-
import org.slf4j.Logger;
8-
import org.slf4j.LoggerFactory;
99

1010
import javax.validation.ConstraintViolationException;
1111
import javax.ws.rs.core.Response;
@@ -16,7 +16,7 @@
1616

1717
@Provider
1818
public class ConstraintViolationExceptionHandler implements ExceptionMapper<ConstraintViolationException> {
19-
private static final Logger LOGGER = LoggerFactory.getLogger(ConstraintViolationExceptionHandler.class);
19+
private static final Logger LOGGER = LogManager.getLogger(ConstraintViolationExceptionHandler.class);
2020

2121
@Override
2222
public Response toResponse(ConstraintViolationException exception) {

rest-commons/src/main/java/org/lfenergy/compas/core/rest/exception/GenericExceptionHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// SPDX-License-Identifier: Apache-2.0
44
package org.lfenergy.compas.core.rest.exception;
55

6+
import org.apache.logging.log4j.LogManager;
7+
import org.apache.logging.log4j.Logger;
68
import org.lfenergy.compas.core.commons.model.ErrorResponse;
7-
import org.slf4j.Logger;
8-
import org.slf4j.LoggerFactory;
99

1010
import javax.ws.rs.core.Response;
1111
import javax.ws.rs.ext.ExceptionMapper;
@@ -15,7 +15,7 @@
1515

1616
@Provider
1717
public class GenericExceptionHandler implements ExceptionMapper<Throwable> {
18-
private static final Logger LOGGER = LoggerFactory.getLogger(GenericExceptionHandler.class);
18+
private static final Logger LOGGER = LogManager.getLogger(GenericExceptionHandler.class);
1919

2020
public static final String ERROR_MESSAGE = "Unknown exception occurred.";
2121

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
SPDX-FileCopyrightText: 2022 Alliander N.V.
4+
5+
SPDX-License-Identifier: Apache-2.0
6+
-->
7+
<Configuration strict="true" name="TestConfiguration">
8+
<Appenders>
9+
<Appender type="Console" name="STDOUT">
10+
<Layout type="PatternLayout" pattern="%d %p %C{3.} [%t] %m%n"/>
11+
</Appender>
12+
</Appenders>
13+
14+
<Loggers>
15+
<Logger name="org.lfenergy.compas" level="debug" additivity="false">
16+
<AppenderRef ref="STDOUT"/>
17+
</Logger>
18+
19+
<Root level="debug">
20+
<AppenderRef ref="STDOUT"/>
21+
</Root>
22+
</Loggers>
23+
</Configuration>

scl-extension/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ SPDX-License-Identifier: Apache-2.0
2828
<artifactId>jakarta.xml.bind-api</artifactId>
2929
</dependency>
3030

31+
<dependency>
32+
<groupId>org.apache.logging.log4j</groupId>
33+
<artifactId>log4j-api</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.apache.logging.log4j</groupId>
37+
<artifactId>log4j-core</artifactId>
38+
<scope>provided</scope>
39+
</dependency>
40+
3141
<dependency>
3242
<groupId>org.junit.jupiter</groupId>
3343
<artifactId>junit-jupiter-api</artifactId>

scl-extension/src/main/resources/xsd/SCL_CoMPAS.xsd

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -100,29 +100,36 @@ SPDX-License-Identifier: Apache-2.0
100100
</xs:sequence>
101101
</xs:complexType>
102102

103-
<xs:simpleType name="tCompasIEDType">
103+
<xs:simpleType name="tCompasIEDType">
104104
<xs:annotation>
105105
<xs:documentation xml:lang="en">
106106
IED type to be used to identity the set of LDevice.inst handled by the IED
107107
</xs:documentation>
108108
</xs:annotation>
109109
<xs:restriction base="xs:string">
110-
<xs:enumeration value="SCU"/>
111-
<xs:enumeration value="BCU"/>
112-
<xs:enumeration value="MU"/>
113-
<xs:enumeration value="SAMU"/>
114-
<xs:enumeration value="PROT"/>
115-
<xs:enumeration value="TAC"/>
116-
<xs:enumeration value="PX"/>
117-
<xs:enumeration value="PDIS"/>
118-
<xs:enumeration value="PDB"/>
119-
<xs:enumeration value="AUT"/>
120-
<xs:enumeration value="PDIF"/>
121-
<xs:enumeration value="GRP"/>
122-
<xs:enumeration value="GTW"/>
123-
<xs:enumeration value="TG"/>
124-
<xs:enumeration value="TOPO"/>
125-
<xs:enumeration value="ADEFINIR"/>
110+
<xs:enumeration value="SCU"/>
111+
<xs:enumeration value="SCU-MCB"/>
112+
<xs:enumeration value="SCU-TG"/>
113+
<xs:enumeration value="SCU-ORG"/>
114+
<xs:enumeration value="BCU"/>
115+
<xs:enumeration value="BCU-LIGNE"/>
116+
<xs:enumeration value="BCU-CBO"/>
117+
<xs:enumeration value="BPU"/>
118+
<xs:enumeration value="MU"/>
119+
<xs:enumeration value="SAMU"/>
120+
<xs:enumeration value="PROT"/>
121+
<xs:enumeration value="TAC"/>
122+
<xs:enumeration value="PX"/>
123+
<xs:enumeration value="PDIS"/>
124+
<xs:enumeration value="PDB"/>
125+
<xs:enumeration value="AUT"/>
126+
<xs:enumeration value="PDIF"/>
127+
<xs:enumeration value="GRP"/>
128+
<xs:enumeration value="GW"/>
129+
<xs:enumeration value="TG"/>
130+
<xs:enumeration value="TOPO"/>
131+
<xs:enumeration value="ADEFINIR"/>
132+
<xs:enumeration value="IEDTEST"/>
126133
</xs:restriction>
127134
</xs:simpleType>
128135

@@ -220,7 +227,8 @@ SPDX-License-Identifier: Apache-2.0
220227
<xs:attribute name="UUID" type="xs:string" use="optional"/>
221228
<xs:attribute name="Indice" type="xs:string" use="optional"/>
222229
<xs:attribute name="Version" type="xs:string" use="optional"/>
223-
<xs:attribute name="MainLabel" type="xs:string" use="optional"/>
230+
<xs:attribute name="MainShortLabel" type="xs:string" use="optional"/>
231+
<xs:attribute name="MainLongLabel" type="xs:string" use="optional"/>
224232
<xs:attribute name="SecondLabel" type="xs:string" use="optional"/>
225233
<xs:attribute name="BayCodif" type="xs:string" use="optional"/>
226234
<xs:attribute name="NumBay" type="xs:integer" use="optional"/>
@@ -290,17 +298,17 @@ SPDX-License-Identifier: Apache-2.0
290298
</xs:complexType>
291299

292300
<xs:complexType name="tCompasTopo">
293-
<xs:annotation>
294-
<xs:documentation xml:lang="en">
295-
Describe the connectivity node and layout order for a given Bay;can be multiple instanciated in case of bay which is connected to multiple nodes
296-
</xs:documentation>
297-
</xs:annotation>
298-
<xs:attribute name="Node" type="xs:string" use="required"/>
299-
<xs:attribute name="NodeOrder" type="xs:integer" use="required"/>
300-
<xs:attribute name="Direction" type="tCompasTopoNodeDirection" use="required"/>
301+
<xs:annotation>
302+
<xs:documentation xml:lang="en">
303+
Describe the connectivity node and layout order for a given Bay;can be multiple instanciated in case of bay which is connected to multiple nodes
304+
</xs:documentation>
305+
</xs:annotation>
306+
<xs:attribute name="Node" type="xs:string" use="required"/>
307+
<xs:attribute name="NodeOrder" type="xs:integer" use="required"/>
308+
<xs:attribute name="BusBarSectionOrder" type="xs:integer" use="optional"/>
309+
<xs:attribute name="Direction" type="tCompasTopoNodeDirection" use="required"/>
301310
</xs:complexType>
302311

303-
304312
<xs:element name="SclName" type="tCompasSclName"/>
305313
<xs:element name="SclFileType" type="tCompasSclFileType"/>
306314
<xs:element name="Labels" type="tCompasLabels"/>
@@ -313,5 +321,4 @@ SPDX-License-Identifier: Apache-2.0
313321
<xs:element name="SystemVersion" type="tCompasSystemVersion"/>
314322
<xs:element name="Function" type="tCompasFunction"/>
315323
<xs:element name="Topo" type="tCompasTopo"/>
316-
317-
</xs:schema>
324+
</xs:schema>

0 commit comments

Comments
 (0)