Skip to content

Commit 5e9aaa7

Browse files
Merge remote-tracking branch 'origin/release'
2 parents 3c33dca + d58a9ff commit 5e9aaa7

30 files changed

+610
-234
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ bin/
1212
.metadata
1313
tmp/
1414
.idea
15-
.DS_Store
15+
.DS_Store
16+
.vscode/launch.json

pom.xml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
<spring-cloud-sleuth-otel.version>1.1.2</spring-cloud-sleuth-otel.version>
4242
<otel-exporter-otlp.version>1.23.1</otel-exporter-otlp.version>
43-
43+
<logback.version>1.2.13</logback.version>
4444
</properties>
4545
<repositories>
4646
<repository>
@@ -155,7 +155,6 @@
155155
<version>4.8.2</version>
156156
</dependency>
157157

158-
159158
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 -->
160159
<dependency>
161160
<groupId>org.apache.commons</groupId>
@@ -205,7 +204,7 @@
205204
<dependency>
206205
<groupId>org.owasp.esapi</groupId>
207206
<artifactId>esapi</artifactId>
208-
<version>2.5.0.0</version>
207+
<version>2.5.4.0</version>
209208
</dependency>
210209

211210
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15on -->
@@ -248,17 +247,39 @@
248247
<dependency>
249248
<groupId>org.springframework.kafka</groupId>
250249
<artifactId>spring-kafka</artifactId>
250+
<version>2.9.11</version>
251251
</dependency>
252252
<dependency>
253253
<groupId>org.springframework.kafka</groupId>
254254
<artifactId>spring-kafka-test</artifactId>
255+
<version>2.9.11</version>
255256
<scope>test</scope>
256257
</dependency>
257258

258259
<dependency>
259260
<groupId>org.springframework.boot</groupId>
260261
<artifactId>spring-boot-starter-validation</artifactId>
261262
</dependency>
263+
264+
<!-- https://mvnrepository.com/artifact/com.microsoft.azure/msal4j -->
265+
<dependency>
266+
<groupId>com.microsoft.azure</groupId>
267+
<artifactId>msal4j</artifactId>
268+
<version>1.17.3</version>
269+
</dependency>
270+
<dependency>
271+
<groupId>com.microsoft.azure</groupId>
272+
<artifactId>azure-client-authentication</artifactId>
273+
<version>1.6.15</version>
274+
<scope>compile</scope>
275+
</dependency>
276+
<!-- https://mvnrepository.com/artifact/org.codehaus.janino/janino -->
277+
<dependency>
278+
<groupId>org.codehaus.janino</groupId>
279+
<artifactId>janino</artifactId>
280+
<version>3.1.7</version>
281+
</dependency>
282+
262283

263284
</dependencies>
264285

@@ -270,7 +291,7 @@
270291
<version>${spring-cloud.version}</version>
271292
<type>pom</type>
272293
<scope>import</scope>
273-
</dependency>
294+
</dependency>
274295
</dependencies>
275296
</dependencyManagement>
276297

src/main/java/ihe/iti/xds_b/_2007/DocumentRegistryPortType.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,6 @@ public RegistryResponseType documentRegistryRegisterDocumentSetB(
4747
@WebParam(name = "SubmitObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0", partName = "body")
4848
SubmitObjectsRequest body);
4949

50-
/**
51-
*
52-
* @param body
53-
* @return
54-
* returns oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType
55-
*/
56-
@WebMethod(operationName = "DocumentRegistry_UpdateDocumentSet", action = "urn:ihe:iti:2010:UpdateDocumentSet")
57-
@WebResult(name = "RegistryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0", partName = "body")
58-
public RegistryResponseType documentRegistryUpdateDocumentSet(
59-
@WebParam(name = "SubmitObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0", partName = "body")
60-
SubmitObjectsRequest body);
61-
6250
/**
6351
*
6452
* @param body
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
package ihe.iti.xds_b._2007;
3+
4+
import javax.jws.WebMethod;
5+
import javax.jws.WebParam;
6+
import javax.jws.WebResult;
7+
import javax.jws.WebService;
8+
import javax.jws.soap.SOAPBinding;
9+
import javax.xml.bind.annotation.XmlSeeAlso;
10+
import oasis.names.tc.ebxml_regrep.xsd.lcm._3.SubmitObjectsRequest;
11+
import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType;
12+
13+
14+
/**
15+
* This class was generated by the JAX-WS RI.
16+
* JAX-WS RI 2.2.9-b130926.1035
17+
* Generated source version: 2.2
18+
*
19+
*/
20+
@WebService(name = "DocumentRegistry_PortType", targetNamespace = "urn:ihe:iti:xds-b:2007")
21+
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
22+
@XmlSeeAlso({
23+
oasis.names.tc.ebxml_regrep.xsd.lcm._3.ObjectFactory.class,
24+
oasis.names.tc.ebxml_regrep.xsd.query._3.ObjectFactory.class,
25+
oasis.names.tc.ebxml_regrep.xsd.rim._3.ObjectFactory.class,
26+
oasis.names.tc.ebxml_regrep.xsd.rs._3.ObjectFactory.class,
27+
org.hl7.v3.ObjectFactory.class
28+
})
29+
public interface UpdateDocumentRegistryPortType {
30+
31+
32+
/**
33+
*
34+
* @param body
35+
* @return
36+
* returns oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType
37+
*/
38+
@WebMethod(operationName = "DocumentRegistry_UpdateDocumentSet")
39+
@WebResult(name = "RegistryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0", partName = "body")
40+
public RegistryResponseType documentRegistryUpdateDocumentSet(
41+
@WebParam(name = "SubmitObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0", partName = "body")
42+
SubmitObjectsRequest body);
43+
44+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
package ihe.iti.xds_b._2007;
3+
4+
import java.net.MalformedURLException;
5+
import java.net.URL;
6+
7+
import javax.xml.namespace.QName;
8+
import javax.xml.ws.Service;
9+
import javax.xml.ws.WebEndpoint;
10+
import javax.xml.ws.WebServiceClient;
11+
import javax.xml.ws.WebServiceException;
12+
import javax.xml.ws.WebServiceFeature;
13+
14+
15+
/**
16+
* This class was generated by the JAX-WS RI.
17+
* JAX-WS RI 2.2.9-b130926.1035
18+
* Generated source version: 2.2
19+
*
20+
*/
21+
@WebServiceClient(name = "DocumentRegistry_Service", targetNamespace = "urn:ihe:iti:xds-b:2007", wsdlLocation = "classpath:wsdl/XDS.b_DocumentRegistry_v1.wsdl")
22+
public class UpdateDocumentRegistryService extends Service {
23+
24+
private final static URL DOCUMENTREGISTRYSERVICE_WSDL_LOCATION;
25+
private final static WebServiceException DOCUMENTREGISTRYSERVICE_EXCEPTION;
26+
private final static QName DOCUMENTREGISTRYSERVICE_QNAME = new QName("urn:ihe:iti:xds-b:2007", "DocumentRegistry_Service");
27+
28+
static {
29+
URL url = null;
30+
WebServiceException e = null;
31+
try {
32+
url = new URL("classpath:wsdl/XDS.b_DocumentRegistry_v1.wsdl");
33+
} catch (MalformedURLException ex) {
34+
e = new WebServiceException(ex);
35+
}
36+
DOCUMENTREGISTRYSERVICE_WSDL_LOCATION = url;
37+
DOCUMENTREGISTRYSERVICE_EXCEPTION = e;
38+
}
39+
40+
public UpdateDocumentRegistryService() {
41+
super(__getWsdlLocation(), DOCUMENTREGISTRYSERVICE_QNAME);
42+
}
43+
44+
public UpdateDocumentRegistryService(WebServiceFeature... features) {
45+
super(__getWsdlLocation(), DOCUMENTREGISTRYSERVICE_QNAME, features);
46+
}
47+
48+
public UpdateDocumentRegistryService(URL wsdlLocation) {
49+
super(wsdlLocation, DOCUMENTREGISTRYSERVICE_QNAME);
50+
}
51+
52+
public UpdateDocumentRegistryService(URL wsdlLocation, WebServiceFeature... features) {
53+
super(wsdlLocation, DOCUMENTREGISTRYSERVICE_QNAME, features);
54+
}
55+
56+
public UpdateDocumentRegistryService(URL wsdlLocation, QName serviceName) {
57+
super(wsdlLocation, serviceName);
58+
}
59+
60+
public UpdateDocumentRegistryService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
61+
super(wsdlLocation, serviceName, features);
62+
}
63+
64+
/**
65+
*
66+
* @return
67+
* returns DocumentRegistryPortType
68+
*/
69+
@WebEndpoint(name = "DocumentRegistry_UpdateDocumentSet_Port_Soap12")
70+
public UpdateDocumentRegistryPortType getDocumentRegistryUpdateDocumentSetPortSoap12() {
71+
return super.getPort(new QName("urn:ihe:iti:xds-b:2007", "DocumentRegistry_UpdateDocumentSet_Port_Soap12"), UpdateDocumentRegistryPortType.class);
72+
}
73+
74+
/**
75+
*
76+
* @param features
77+
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
78+
* @return
79+
* returns DocumentRegistryPortType
80+
*/
81+
@WebEndpoint(name = "DocumentRegistry_UpdateDocumentSet_Port_Soap12")
82+
public UpdateDocumentRegistryPortType getDocumentRegistryUpdateDocumentSetPortSoap12(WebServiceFeature... features) {
83+
return super.getPort(new QName("urn:ihe:iti:xds-b:2007", "DocumentRegistry_UpdateDocumentSet_Port_Soap12"), UpdateDocumentRegistryPortType.class, features);
84+
}
85+
86+
private static URL __getWsdlLocation() {
87+
if (DOCUMENTREGISTRYSERVICE_EXCEPTION!= null) {
88+
throw DOCUMENTREGISTRYSERVICE_EXCEPTION;
89+
}
90+
return DOCUMENTREGISTRYSERVICE_WSDL_LOCATION;
91+
}
92+
93+
}

src/main/java/it/finanze/sanita/fse2/ms/iniclient/client/impl/IniClient.java

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141

4242
import ihe.iti.xds_b._2007.DocumentRegistryPortType;
4343
import ihe.iti.xds_b._2007.DocumentRegistryService;
44+
import ihe.iti.xds_b._2007.UpdateDocumentRegistryPortType;
45+
import ihe.iti.xds_b._2007.UpdateDocumentRegistryService;
4446
import ihe.iti.xds_b._2010.XDSDeletetWS;
4547
import ihe.iti.xds_b._2010.XDSDeletetWSService;
4648
import it.finanze.sanita.fse2.ms.iniclient.client.IIniClient;
@@ -52,6 +54,7 @@
5254
import it.finanze.sanita.fse2.ms.iniclient.dto.SubmissionSetEntryDTO;
5355
import it.finanze.sanita.fse2.ms.iniclient.enums.ActionEnumType;
5456
import it.finanze.sanita.fse2.ms.iniclient.enums.SearchTypeEnum;
57+
import it.finanze.sanita.fse2.ms.iniclient.exceptions.IdDocumentNotFoundException;
5558
import it.finanze.sanita.fse2.ms.iniclient.exceptions.base.BusinessException;
5659
import it.finanze.sanita.fse2.ms.iniclient.service.IConfigSRV;
5760
import it.finanze.sanita.fse2.ms.iniclient.service.ISecuritySRV;
@@ -67,16 +70,8 @@
6770
import oasis.names.tc.ebxml_regrep.xsd.lcm._3.SubmitObjectsRequest;
6871
import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest;
6972
import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse;
73+
import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryError;
7074
import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType;
71-
import static it.finanze.sanita.fse2.ms.iniclient.config.Constants.IniAudit.EVENT_DATE;
72-
import static it.finanze.sanita.fse2.ms.iniclient.config.Constants.IniAudit.EVENT_TYPE;
73-
import static it.finanze.sanita.fse2.ms.iniclient.config.Constants.IniAudit.WII;
74-
import static it.finanze.sanita.fse2.ms.iniclient.enums.EventType.INI_CREATE_SOAP;
75-
import static it.finanze.sanita.fse2.ms.iniclient.enums.EventType.INI_DELETE_SOAP;
76-
import static it.finanze.sanita.fse2.ms.iniclient.enums.EventType.INI_REPLACE_SOAP;
77-
import static it.finanze.sanita.fse2.ms.iniclient.enums.EventType.INI_UPDATE_SOAP;
78-
import static it.finanze.sanita.fse2.ms.iniclient.enums.EventType.INI_RIFERIMENTO_SOAP;
79-
import static it.finanze.sanita.fse2.ms.iniclient.enums.EventType.INI_GET_METADATI_SOAP;
8075

8176
/**
8277
* Production implemention of Ini Client.
@@ -108,7 +103,8 @@ public class IniClient implements IIniClient {
108103

109104
private DocumentRegistryPortType recuperoRiferimentoPort;
110105

111-
106+
private UpdateDocumentRegistryPortType updateDocumentRegistryPort;
107+
112108
@PostConstruct
113109
void initialize() {
114110
try {
@@ -124,6 +120,13 @@ void initialize() {
124120
BindingProvider bindingProvider = (BindingProvider) documentRegistryPort;
125121
bindingProvider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, iniCFG.getUrlWsdlDocumentRegistryService());
126122
}
123+
124+
UpdateDocumentRegistryService updateDocumentRegistryService = new UpdateDocumentRegistryService();
125+
updateDocumentRegistryPort = updateDocumentRegistryService.getDocumentRegistryUpdateDocumentSetPortSoap12();
126+
if (!StringUtility.isNullOrEmpty(iniCFG.getUrlWsdlUpdateDocumentRegistryService())) {
127+
BindingProvider bindingProvider = (BindingProvider) updateDocumentRegistryPort;
128+
bindingProvider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, iniCFG.getUrlWsdlUpdateDocumentRegistryService());
129+
}
127130

128131
XDSDeletetWSService deletetWSService = new XDSDeletetWSService();
129132
deletePort = deletetWSService.getXDSDeletetWSSPort();
@@ -143,6 +146,7 @@ void initialize() {
143146
((BindingProvider) documentRegistryPort).getRequestContext().put(JAXWSProperties.SSL_SOCKET_FACTORY, sslContext.getSocketFactory());
144147
((BindingProvider) deletePort).getRequestContext().put(JAXWSProperties.SSL_SOCKET_FACTORY, sslContext.getSocketFactory());
145148
((BindingProvider) recuperoRiferimentoPort).getRequestContext().put(JAXWSProperties.SSL_SOCKET_FACTORY, sslContext.getSocketFactory());
149+
((BindingProvider) updateDocumentRegistryPort).getRequestContext().put(JAXWSProperties.SSL_SOCKET_FACTORY, sslContext.getSocketFactory());
146150
}
147151

148152
SOAPLoggingHandler loggingHandler = new SOAPLoggingHandler(auditIniSrv, configSRV);
@@ -153,6 +157,10 @@ void initialize() {
153157
List<Handler> handlerChainDelete = ((BindingProvider) deletePort).getBinding().getHandlerChain();
154158
handlerChainDelete.add(loggingHandler);
155159
((BindingProvider) deletePort).getBinding().setHandlerChain(handlerChainDelete);
160+
161+
List<Handler> handlerChainUpdate = ((BindingProvider) updateDocumentRegistryPort).getBinding().getHandlerChain();
162+
handlerChainUpdate.add(loggingHandler);
163+
((BindingProvider) updateDocumentRegistryPort).getBinding().setHandlerChain(handlerChainUpdate);
156164

157165
List<Handler> handlerChainRecuperoRiferimento = ((BindingProvider) recuperoRiferimentoPort).getBinding().getHandlerChain();
158166
handlerChainRecuperoRiferimento.add(loggingHandler);
@@ -203,27 +211,33 @@ public RegistryResponseType sendDeleteData(DeleteRequestDTO deleteRequestDto, JW
203211

204212
@Override
205213
public RegistryResponseType sendUpdateV2Data(SubmitObjectsRequest submitObjectsRequest, JWTTokenDTO jwtTokenDTO,String workflowInstanceId,Date startingDate) {
206-
return sendUpdateData(submitObjectsRequest,jwtTokenDTO,workflowInstanceId,startingDate,ActionEnumType.UPDATE_V2);
214+
log.debug("Call to INI update ");
215+
List<Header> headers = samlHeaderBuilderUtility.buildHeader(jwtTokenDTO, ActionEnumType.UPDATE_V2);
216+
WSBindingProvider bp = (WSBindingProvider)updateDocumentRegistryPort;
217+
bp.setOutboundHeaders(headers);
218+
219+
bp.getRequestContext().put(WII, workflowInstanceId);
220+
bp.getRequestContext().put(EVENT_TYPE, INI_UPDATE_SOAP);
221+
bp.getRequestContext().put(EVENT_DATE, startingDate);
222+
return updateDocumentRegistryPort.documentRegistryUpdateDocumentSet(submitObjectsRequest);
223+
// return sendUpdateData(submitObjectsRequest,jwtTokenDTO,workflowInstanceId,startingDate,ActionEnumType.UPDATE_V2);
207224
}
208225

209226

210227
@Override
211228
public RegistryResponseType sendUpdateData(SubmitObjectsRequest submitObjectsRequest, JWTTokenDTO jwtTokenDTO,String workflowInstanceId,Date startingDate) {
212-
return sendUpdateData(submitObjectsRequest,jwtTokenDTO,workflowInstanceId,startingDate,ActionEnumType.UPDATE);
213-
}
214-
215-
private RegistryResponseType sendUpdateData(SubmitObjectsRequest submitObjectsRequest, JWTTokenDTO jwtTokenDTO,String workflowInstanceId,Date startingDate,ActionEnumType actionEnum) {
216-
log.debug("Call to INI update");
217-
List<Header> headers = samlHeaderBuilderUtility.buildHeader(jwtTokenDTO, actionEnum);
229+
log.debug("Call to INI update ");
230+
List<Header> headers = samlHeaderBuilderUtility.buildHeader(jwtTokenDTO, ActionEnumType.UPDATE);
218231
WSBindingProvider bp = (WSBindingProvider)documentRegistryPort;
219232
bp.setOutboundHeaders(headers);
220233

221234
bp.getRequestContext().put(WII, workflowInstanceId);
222235
bp.getRequestContext().put(EVENT_TYPE, INI_UPDATE_SOAP);
223236
bp.getRequestContext().put(EVENT_DATE, startingDate);
224237
return documentRegistryPort.documentRegistryRegisterDocumentSetB(submitObjectsRequest);
238+
// return sendUpdateData(submitObjectsRequest,jwtTokenDTO,workflowInstanceId,startingDate,ActionEnumType.UPDATE);
225239
}
226-
240+
227241
@Override
228242
public RegistryResponseType sendReplaceData(final DocumentEntryDTO documentEntryDTO, final SubmissionSetEntryDTO submissionSetEntryDTO,
229243
final JWTTokenDTO jwtTokenDTO, final String uuid,String workflowInstanceId,Date startingDate) {
@@ -291,13 +305,9 @@ public AdhocQueryResponse getReferenceMetadata(String uuid, String tipoRicerca,
291305

292306
StringBuilder sb = new StringBuilder();
293307
if (response.getRegistryErrorList() != null && !CollectionUtils.isEmpty(response.getRegistryErrorList().getRegistryError())) {
294-
// for(RegistryError error : response.getRegistryErrorList().getRegistryError()) {
295-
// if (error.getCodeContext().equals("No results from the query")) {
296-
// throw new IdDocumentNotFoundException("Non è stato possibile recuperare i riferimenti con i dati forniti in input");
297-
// } else {
298-
// sb.append(error.getCodeContext());
299-
// }
300-
// }
308+
for(RegistryError error : response.getRegistryErrorList().getRegistryError()) {
309+
sb.append("ERROR_CODE: "+error.getErrorCode() + " ERROR_CONTEXT: " + error.getCodeContext());
310+
}
301311
throw new BusinessException(sb.toString());
302312
}
303313
return response;

src/main/java/it/finanze/sanita/fse2/ms/iniclient/config/IniCFG.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ public class IniCFG {
2121

2222
@Value("${ini.client.document-registry-service}")
2323
private String urlWsdlDocumentRegistryService;
24+
25+
@Value("${ini.client.update-document-registry-service}")
26+
private String urlWsdlUpdateDocumentRegistryService;
2427

2528
@Value("${ini.client.delete-service}")
2629
private String urlWsdlDeletetService;

0 commit comments

Comments
 (0)