Skip to content

Commit

Permalink
Merge pull request #197 from com-pas/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
Dennis Labordus authored Nov 21, 2022
2 parents 83e3344 + 16401ee commit bd204ad
Show file tree
Hide file tree
Showing 23 changed files with 278 additions and 101 deletions.
14 changes: 7 additions & 7 deletions commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ SPDX-License-Identifier: Apache-2.0
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
Expand All @@ -52,11 +57,6 @@ SPDX-License-Identifier: Apache-2.0
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.core.commons;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lfenergy.compas.core.commons.exception.CompasException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
Expand All @@ -27,7 +27,7 @@
import static org.lfenergy.compas.core.commons.exception.CompasErrorCode.CONVERT_TO_STRING_ERROR;

public class ElementConverter {
private static final Logger LOGGER = LoggerFactory.getLogger(ElementConverter.class);
private static final Logger LOGGER = LogManager.getLogger(ElementConverter.class);

public String convertToString(Element element) {
return convertToString(element, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.JsonNodeType;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lfenergy.compas.core.commons.exception.CompasException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.SAXException;

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

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

private final Unmarshaller jaxbUnmarshaller;
private final Marshaller jaxbMarshaller;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.core.commons.constraint.impl;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lfenergy.compas.core.commons.constraint.XmlAnyElementValid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;

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

private String elementName;
private String elementNamespace;
Expand Down
23 changes: 23 additions & 0 deletions commons/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: 2022 Alliander N.V.
SPDX-License-Identifier: Apache-2.0
-->
<Configuration strict="true" name="TestConfiguration">
<Appenders>
<Appender type="Console" name="STDOUT">
<Layout type="PatternLayout" pattern="%d %p %C{3.} [%t] %m%n"/>
</Appender>
</Appenders>

<Loggers>
<Logger name="org.lfenergy.compas" level="debug" additivity="false">
<AppenderRef ref="STDOUT"/>
</Logger>

<Root level="debug">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ SPDX-License-Identifier: Apache-2.0
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<compas.scl.xsd.version>0.0.4</compas.scl.xsd.version>
<quarkus.platform.version>2.14.0.Final</quarkus.platform.version>
<slf4j.version>2.0.3</slf4j.version>
<quarkus.platform.version>2.14.1.Final</quarkus.platform.version>
<jaxb.bind.version>2.3.7</jaxb.bind.version>
<log4j2.version>2.19.0</log4j2.version>
<openpojo.version>0.9.1</openpojo.version>
</properties>

Expand Down Expand Up @@ -91,14 +91,14 @@ SPDX-License-Identifier: Apache-2.0
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>

<dependency>
Expand Down
15 changes: 7 additions & 8 deletions rest-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ SPDX-License-Identifier: Apache-2.0
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
Expand All @@ -54,11 +59,5 @@ SPDX-License-Identifier: Apache-2.0
<artifactId>resteasy-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.core.rest.exception;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lfenergy.compas.core.commons.exception.CompasException;
import org.lfenergy.compas.core.commons.model.ErrorResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

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

@Override
public Response toResponse(CompasException exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.core.rest.exception;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lfenergy.compas.core.commons.model.ErrorResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.validation.ConstraintViolationException;
import javax.ws.rs.core.Response;
Expand All @@ -16,7 +16,7 @@

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

@Override
public Response toResponse(ConstraintViolationException exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.core.rest.exception;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lfenergy.compas.core.commons.model.ErrorResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
Expand All @@ -15,7 +15,7 @@

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

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

Expand Down
23 changes: 23 additions & 0 deletions rest-commons/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: 2022 Alliander N.V.
SPDX-License-Identifier: Apache-2.0
-->
<Configuration strict="true" name="TestConfiguration">
<Appenders>
<Appender type="Console" name="STDOUT">
<Layout type="PatternLayout" pattern="%d %p %C{3.} [%t] %m%n"/>
</Appender>
</Appenders>

<Loggers>
<Logger name="org.lfenergy.compas" level="debug" additivity="false">
<AppenderRef ref="STDOUT"/>
</Logger>

<Root level="debug">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
10 changes: 10 additions & 0 deletions scl-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ SPDX-License-Identifier: Apache-2.0
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down
65 changes: 36 additions & 29 deletions scl-extension/src/main/resources/xsd/SCL_CoMPAS.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -100,29 +100,36 @@ SPDX-License-Identifier: Apache-2.0
</xs:sequence>
</xs:complexType>

<xs:simpleType name="tCompasIEDType">
<xs:simpleType name="tCompasIEDType">
<xs:annotation>
<xs:documentation xml:lang="en">
IED type to be used to identity the set of LDevice.inst handled by the IED
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="SCU"/>
<xs:enumeration value="BCU"/>
<xs:enumeration value="MU"/>
<xs:enumeration value="SAMU"/>
<xs:enumeration value="PROT"/>
<xs:enumeration value="TAC"/>
<xs:enumeration value="PX"/>
<xs:enumeration value="PDIS"/>
<xs:enumeration value="PDB"/>
<xs:enumeration value="AUT"/>
<xs:enumeration value="PDIF"/>
<xs:enumeration value="GRP"/>
<xs:enumeration value="GTW"/>
<xs:enumeration value="TG"/>
<xs:enumeration value="TOPO"/>
<xs:enumeration value="ADEFINIR"/>
<xs:enumeration value="SCU"/>
<xs:enumeration value="SCU-MCB"/>
<xs:enumeration value="SCU-TG"/>
<xs:enumeration value="SCU-ORG"/>
<xs:enumeration value="BCU"/>
<xs:enumeration value="BCU-LIGNE"/>
<xs:enumeration value="BCU-CBO"/>
<xs:enumeration value="BPU"/>
<xs:enumeration value="MU"/>
<xs:enumeration value="SAMU"/>
<xs:enumeration value="PROT"/>
<xs:enumeration value="TAC"/>
<xs:enumeration value="PX"/>
<xs:enumeration value="PDIS"/>
<xs:enumeration value="PDB"/>
<xs:enumeration value="AUT"/>
<xs:enumeration value="PDIF"/>
<xs:enumeration value="GRP"/>
<xs:enumeration value="GW"/>
<xs:enumeration value="TG"/>
<xs:enumeration value="TOPO"/>
<xs:enumeration value="ADEFINIR"/>
<xs:enumeration value="IEDTEST"/>
</xs:restriction>
</xs:simpleType>

Expand Down Expand Up @@ -220,7 +227,8 @@ SPDX-License-Identifier: Apache-2.0
<xs:attribute name="UUID" type="xs:string" use="optional"/>
<xs:attribute name="Indice" type="xs:string" use="optional"/>
<xs:attribute name="Version" type="xs:string" use="optional"/>
<xs:attribute name="MainLabel" type="xs:string" use="optional"/>
<xs:attribute name="MainShortLabel" type="xs:string" use="optional"/>
<xs:attribute name="MainLongLabel" type="xs:string" use="optional"/>
<xs:attribute name="SecondLabel" type="xs:string" use="optional"/>
<xs:attribute name="BayCodif" type="xs:string" use="optional"/>
<xs:attribute name="NumBay" type="xs:integer" use="optional"/>
Expand Down Expand Up @@ -290,17 +298,17 @@ SPDX-License-Identifier: Apache-2.0
</xs:complexType>

<xs:complexType name="tCompasTopo">
<xs:annotation>
<xs:documentation xml:lang="en">
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
</xs:documentation>
</xs:annotation>
<xs:attribute name="Node" type="xs:string" use="required"/>
<xs:attribute name="NodeOrder" type="xs:integer" use="required"/>
<xs:attribute name="Direction" type="tCompasTopoNodeDirection" use="required"/>
<xs:annotation>
<xs:documentation xml:lang="en">
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
</xs:documentation>
</xs:annotation>
<xs:attribute name="Node" type="xs:string" use="required"/>
<xs:attribute name="NodeOrder" type="xs:integer" use="required"/>
<xs:attribute name="BusBarSectionOrder" type="xs:integer" use="optional"/>
<xs:attribute name="Direction" type="tCompasTopoNodeDirection" use="required"/>
</xs:complexType>


<xs:element name="SclName" type="tCompasSclName"/>
<xs:element name="SclFileType" type="tCompasSclFileType"/>
<xs:element name="Labels" type="tCompasLabels"/>
Expand All @@ -313,5 +321,4 @@ SPDX-License-Identifier: Apache-2.0
<xs:element name="SystemVersion" type="tCompasSystemVersion"/>
<xs:element name="Function" type="tCompasFunction"/>
<xs:element name="Topo" type="tCompasTopo"/>

</xs:schema>
</xs:schema>
Loading

0 comments on commit bd204ad

Please sign in to comment.