-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Realizzati servizi active_payments e get_rt.
- Loading branch information
Showing
41 changed files
with
3,911 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.7.3</version> | ||
<relativePath /> <!-- lookup parent from repository --> | ||
</parent> | ||
|
||
<groupId>it.govpay</groupId> | ||
<artifactId>api-netpay</artifactId> | ||
<packaging>war</packaging> | ||
<name>GovPay - wars - REST API Net@Pay</name> | ||
<version>3.7.0</version> | ||
|
||
<properties> | ||
<java.version>1.8</java.version> | ||
<!-- <maven.compiler.source>${java.version}</maven.compiler.source> --> | ||
<!-- <maven.compiler.target>${java.version}</maven.compiler.target> --> | ||
<!-- <maven.compiler.release>${java.version}</maven.compiler.release> --> | ||
|
||
<!-- Versioni plugin maven --> | ||
<!-- <maven.compiler.plugin.version>3.8.0</maven.compiler.plugin.version> --> | ||
<!-- <maven.war.plugin.version>3.2.3</maven.war.plugin.version> --> | ||
|
||
<rel-to-parent>../..</rel-to-parent> | ||
<filter-file>${rel-to-parent}/src/main/resources/filters/${env}.filter.properties</filter-file> | ||
|
||
<!-- Mpastruct --> | ||
<mapstruct.version>1.5.1.Final</mapstruct.version> | ||
|
||
<!-- Lombok version --> | ||
<org.projectlombok.version>1.18.24</org.projectlombok.version> | ||
|
||
<!-- cxf version --> | ||
<cxf.version>3.2.6</cxf.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.mapstruct</groupId> | ||
<artifactId>mapstruct</artifactId> | ||
<version>${mapstruct.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>it.govpay</groupId> | ||
<artifactId>api-commons</artifactId> | ||
<type>jar</type> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.cxf</groupId> | ||
<artifactId>cxf-rt-frontend-jaxrs</artifactId> | ||
<version>${cxf.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.validation</groupId> | ||
<artifactId>validation-api</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>javax.servlet-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<filters> | ||
<filter>${filter-file}</filter> | ||
</filters> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<!-- <source>${java.version}</source> --> | ||
<!-- <target>${java.version}</target> --> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<version>${org.projectlombok.version}</version> | ||
</path> | ||
<path> | ||
<groupId>org.mapstruct</groupId> | ||
<artifactId>mapstruct-processor</artifactId> | ||
<version>${mapstruct.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
<compilerArgs> | ||
<arg>-Amapstruct.suppressGeneratorTimestamp=true</arg> | ||
<arg>-Amapstruct.defaultComponentModel=spring</arg> | ||
</compilerArgs> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<configuration> | ||
<webResources> | ||
<webResource> | ||
<directory>src/main/webapp</directory> | ||
<filtering>true</filtering> | ||
</webResource> | ||
<webResource> | ||
<directory>src/main/resources/</directory> | ||
<filtering>true</filtering> | ||
<include>web.xml</include> | ||
<targetPath>WEB-INF</targetPath> | ||
</webResource> | ||
<webResource> | ||
<directory>src/main/resources/spring-jaxrs</directory> | ||
<filtering>true</filtering> | ||
<include>applicationContext-jaxrs-*.xml</include> | ||
<targetPath>WEB-INF</targetPath> | ||
</webResource> | ||
<webResource> | ||
<directory>src/main/resources/spring-sec</directory> | ||
<filtering>true</filtering> | ||
<include>*-applicationContext-security.xml</include> | ||
<targetPath>WEB-INF</targetPath> | ||
</webResource> | ||
</webResources> | ||
<!-- <webXml>src/main/resources/web.xml</webXml> --> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> | ||
<archive> | ||
<manifest> | ||
<addClasspath>true</addClasspath> | ||
<classpathPrefix>lib/</classpathPrefix> | ||
</manifest> | ||
<manifestEntries> | ||
<Class-Path>properties/</Class-Path> | ||
<Dependencies>jdk.unsupported</Dependencies> | ||
</manifestEntries> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
104 changes: 104 additions & 0 deletions
104
wars/api-netpay/src/main/java/it/govpay/netpay/listener/InitListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package it.govpay.netpay.listener; | ||
|
||
import java.io.InputStream; | ||
import java.net.URL; | ||
import java.util.UUID; | ||
|
||
import javax.servlet.ServletContextEvent; | ||
import javax.servlet.ServletContextListener; | ||
|
||
import org.openspcoop2.utils.LoggerWrapperFactory; | ||
import org.openspcoop2.utils.UtilsException; | ||
import org.openspcoop2.utils.service.context.IContext; | ||
import org.openspcoop2.utils.service.context.MD5Constants; | ||
import org.slf4j.Logger; | ||
import org.slf4j.MDC; | ||
|
||
import it.govpay.core.utils.GovpayConfig; | ||
import it.govpay.core.utils.GpContext; | ||
import it.govpay.core.utils.InitConstants; | ||
import it.govpay.core.utils.LabelAvvisiProperties; | ||
import it.govpay.core.utils.SeveritaProperties; | ||
import it.govpay.core.utils.StartupUtils; | ||
|
||
public class InitListener implements ServletContextListener{ | ||
|
||
private static Logger log = null; | ||
private static boolean initialized = false; | ||
private String warName = "GovPay-API-Netpay"; | ||
private String tipoServizioGovpay = GpContext.TIPO_SERVIZIO_GOVPAY_JSON; | ||
private String dominioAnagraficaManager = "it.govpay.cache.anagrafica.netpay"; | ||
|
||
public static boolean isInitialized() { | ||
return InitListener.initialized; | ||
} | ||
|
||
@Override | ||
public void contextInitialized(ServletContextEvent sce) { | ||
// Commit id | ||
String commit = (InitConstants.GOVPAY_BUILD_NUMBER.length() > 7) ? InitConstants.GOVPAY_BUILD_NUMBER.substring(0, 7) : InitConstants.GOVPAY_BUILD_NUMBER; | ||
|
||
InputStream govpayPropertiesIS = InitListener.class.getResourceAsStream(GovpayConfig.PROPERTIES_FILE); | ||
URL log4j2URL = InitListener.class.getResource(GovpayConfig.LOG4J2_XML_FILE); | ||
InputStream msgDiagnosticiIS = InitListener.class.getResourceAsStream(GovpayConfig.MSG_DIAGNOSTICI_PROPERTIES_FILE); | ||
InputStream mappingSeveritaErroriPropertiesIS = InitListener.class.getResourceAsStream(SeveritaProperties.MAPPING_SEVERITA_ERRORI_PROPERTIES_FILE); | ||
InputStream avvisiLabelPropertiesIS = InitListener.class.getResourceAsStream(LabelAvvisiProperties.PROPERTIES_FILE); | ||
IContext ctx = StartupUtils.startup(log, warName, InitConstants.GOVPAY_VERSION, commit, govpayPropertiesIS, log4j2URL, msgDiagnosticiIS, tipoServizioGovpay, mappingSeveritaErroriPropertiesIS, avvisiLabelPropertiesIS); | ||
|
||
try { | ||
log = LoggerWrapperFactory.getLogger("boot"); | ||
StartupUtils.startupServices(log, warName, InitConstants.GOVPAY_VERSION, commit, ctx, dominioAnagraficaManager, GovpayConfig.getInstance()); | ||
} catch (RuntimeException e) { | ||
log.error("Inizializzazione fallita", e); | ||
try { | ||
ctx.getApplicationLogger().log(); | ||
} catch (UtilsException e1) { | ||
log.error("Errore durante il log dell'operazione: "+e1.getMessage(), e1); | ||
} | ||
throw e; | ||
} catch (Exception e) { | ||
log.error("Inizializzazione fallita", e); | ||
try { | ||
ctx.getApplicationLogger().log(); | ||
} catch (UtilsException e1) { | ||
log.error("Errore durante il log dell'operazione: "+e1.getMessage(), e1); | ||
} | ||
throw new RuntimeException("Inizializzazione "+StartupUtils.getGovpayVersion(warName, InitConstants.GOVPAY_VERSION, commit)+" fallita.", e); | ||
} | ||
|
||
try { | ||
ctx.getApplicationLogger().log(); | ||
} catch (UtilsException e) { | ||
log.error("Errore durante il log dell'operazione: "+e.getMessage(), e); | ||
} | ||
|
||
log.info("Inizializzazione "+StartupUtils.getGovpayVersion(warName, InitConstants.GOVPAY_VERSION, commit)+" completata con successo."); | ||
initialized = true; | ||
} | ||
|
||
|
||
@Override | ||
public void contextDestroyed(ServletContextEvent sce) { | ||
// Commit id | ||
String commit = (InitConstants.GOVPAY_BUILD_NUMBER.length() > 7) ? InitConstants.GOVPAY_BUILD_NUMBER.substring(0, 7) : InitConstants.GOVPAY_BUILD_NUMBER; | ||
|
||
MDC.put(MD5Constants.OPERATION_ID, "Shutdown"); | ||
MDC.put(MD5Constants.TRANSACTION_ID, UUID.randomUUID().toString() ); | ||
|
||
log.info("Shutdown "+StartupUtils.getGovpayVersion(warName, InitConstants.GOVPAY_VERSION, commit)+" in corso..."); | ||
|
||
// log.info("De-registrazione delle cache ..."); | ||
// AnagraficaManager.unregister(); | ||
// log.info("De-registrazione delle cache completato"); | ||
// | ||
// log.info("Shutdown del Connection Manager ..."); | ||
// try { | ||
// ConnectionManager.shutdown(); | ||
// log.info("Shutdown del Connection Manager completato."); | ||
// } catch (Exception e) { | ||
// log.warn("Errore nello shutdown del Connection Manager: " + e); | ||
// } | ||
|
||
log.info("Shutdown "+StartupUtils.getGovpayVersion(warName, InitConstants.GOVPAY_VERSION, commit)+" completato."); | ||
} | ||
} |
Oops, something went wrong.