-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ljvis to version 6 and fix for formatted response (#13)
* migrate ljvis to version 6 * Use correct Instance for check, fix issue #12 * Use correct Instance for check, fix issue #12 * Use correct Instance for check, fix issue #12 * Add jvis xroad client * emta-v6 new wsdl
- Loading branch information
1 parent
bfa2cc3
commit 4f89d1a
Showing
20 changed files
with
3,157 additions
and
491 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
import org.junit.Test; | ||
|
||
import com.nortal.jroad.client.emtav6.types.eu.x_road.emta_v6.ArisApplicationType; | ||
import com.nortal.jroad.client.emtav6.types.eu.x_road.emta_v6.PreRegCheck; | ||
import com.nortal.jroad.client.emtav6.types.eu.x_road.emta_v6.PreRegCheckDocument.PreRegCheck; | ||
import com.nortal.jroad.client.emtav6.types.eu.x_road.emta_v6.PreRegCheckRequestItemType; | ||
import com.nortal.jroad.client.emtav6.types.eu.x_road.emta_v6.PreRegCheckResponseItemType; | ||
import com.nortal.jroad.client.exception.XRoadServiceConsumptionException; | ||
|
@@ -21,13 +21,13 @@ public class EmtaV6XRoadServiceImplTest extends BaseXRoadServiceImplTest { | |
@Resource | ||
private EmtaV6XRoadServiceImpl emtav6xTeeServiceImpl; | ||
|
||
// Need to mock soapUI service with preRegCheckV1Response.xml | ||
@Test | ||
public void preRegCheckV1() throws XRoadServiceConsumptionException { | ||
PreRegCheck preRegCheck = PreRegCheck.Factory.newInstance(); | ||
PreRegCheckRequestItemType itemType = preRegCheck.addNewItem(); | ||
ArisApplicationType applicationType = itemType.addNewApplication(); | ||
applicationType.setApplicantEmail("[email protected]"); | ||
applicationType.setArisId(arisId); | ||
applicationType.setApplicantEmail("[email protected]"); | ||
applicationType.setApplicantPhone("12335465"); | ||
List<PreRegCheckResponseItemType> itemList = emtav6xTeeServiceImpl.preRegCheckV1(preRegCheck); | ||
Assert.assertEquals(arisId, itemList.get(0).getArisId()); | ||
|
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,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>xtee-client-jvis</artifactId> | ||
<name>Jvis client services</name> | ||
|
||
<parent> | ||
<groupId>com.nortal.jroad</groupId> | ||
<artifactId>xtee-client-service</artifactId> | ||
<version>4.2.0</version> | ||
</parent> | ||
|
||
<properties> | ||
<package>jvis</package> | ||
</properties> | ||
|
||
</project> |
19 changes: 19 additions & 0 deletions
19
client-service/jvis/src/main/java/com/nortal/jroad/client/jvis/Jvisv6XRoadService.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,19 @@ | ||
package com.nortal.jroad.client.jvis; | ||
|
||
import java.util.Date; | ||
|
||
import com.nortal.jroad.client.exception.XRoadServiceConsumptionException; | ||
import com.nortal.jroad.client.jvis.types.eu.x_road.jvisv6.producer.IsikuVedurijuhilubaVastusDocument.IsikuVedurijuhilubaVastus; | ||
import com.nortal.jroad.client.jvis.types.eu.x_road.jvisv6.producer.VedurijuhiloaTaotlusParingDocument.VedurijuhiloaTaotlusParing; | ||
|
||
public interface Jvisv6XRoadService { | ||
|
||
IsikuVedurijuhilubaVastus getIsikuVedurijuhiluba(String isikukood) throws XRoadServiceConsumptionException; | ||
|
||
String sendIsikuVedurijuhilubaTaotlus(VedurijuhiloaTaotlusParing paring) throws XRoadServiceConsumptionException; | ||
|
||
String sendVedurijuhiloaEksam(String isikukood, long sooritatud, Date kuupaev) throws XRoadServiceConsumptionException; | ||
|
||
String sendVedurijuhiloaKatteandmine(String isikukood, String loaNumber, Date kattesaamiseKuupaev) throws XRoadServiceConsumptionException; | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
client-service/jvis/src/main/java/com/nortal/jroad/client/jvis/Jvisv6XRoadServiceImpl.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,68 @@ | ||
package com.nortal.jroad.client.jvis; | ||
|
||
import java.math.BigInteger; | ||
import java.util.Calendar; | ||
import java.util.Date; | ||
|
||
import javax.annotation.Resource; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
import com.nortal.jroad.client.exception.XRoadServiceConsumptionException; | ||
import com.nortal.jroad.client.jvis.database.Jvisv6XRoadDatabase; | ||
import com.nortal.jroad.client.jvis.types.eu.x_road.jvisv6.producer.IsikuVedurijuhilubaParingDocument.IsikuVedurijuhilubaParing; | ||
import com.nortal.jroad.client.jvis.types.eu.x_road.jvisv6.producer.IsikuVedurijuhilubaVastusDocument.IsikuVedurijuhilubaVastus; | ||
import com.nortal.jroad.client.jvis.types.eu.x_road.jvisv6.producer.VedurijuhiloaEksamParingDocument.VedurijuhiloaEksamParing; | ||
import com.nortal.jroad.client.jvis.types.eu.x_road.jvisv6.producer.VedurijuhiloaEksamVastusDocument.VedurijuhiloaEksamVastus; | ||
import com.nortal.jroad.client.jvis.types.eu.x_road.jvisv6.producer.VedurijuhiloaKatteandmineParingDocument.VedurijuhiloaKatteandmineParing; | ||
import com.nortal.jroad.client.jvis.types.eu.x_road.jvisv6.producer.VedurijuhiloaKatteandmineVastusDocument.VedurijuhiloaKatteandmineVastus; | ||
import com.nortal.jroad.client.jvis.types.eu.x_road.jvisv6.producer.VedurijuhiloaTaotlusParingDocument.VedurijuhiloaTaotlusParing; | ||
import com.nortal.jroad.client.jvis.types.eu.x_road.jvisv6.producer.VedurijuhiloaTaotlusVastusDocument.VedurijuhiloaTaotlusVastus; | ||
|
||
@Service("jvisv6XTeeService") | ||
public class Jvisv6XRoadServiceImpl implements Jvisv6XRoadService { | ||
|
||
@Resource | ||
private Jvisv6XRoadDatabase jvisv6XRoadDatabase; | ||
|
||
public IsikuVedurijuhilubaVastus getIsikuVedurijuhiluba(String isikukood) throws XRoadServiceConsumptionException { | ||
IsikuVedurijuhilubaParing paring = IsikuVedurijuhilubaParing.Factory.newInstance(); | ||
paring.setIsikukood(isikukood); | ||
return jvisv6XRoadDatabase.isikuVedurijuhilubaV1(paring); | ||
} | ||
|
||
public String sendIsikuVedurijuhilubaTaotlus(VedurijuhiloaTaotlusParing paring) throws XRoadServiceConsumptionException { | ||
VedurijuhiloaTaotlusVastus vastus = jvisv6XRoadDatabase.vedurijuhiloaTaotlusV1(paring); | ||
return vastus.getVastuskood(); | ||
} | ||
|
||
public String sendVedurijuhiloaEksam(String isikukood, long sooritatud, Date kuupaev) throws XRoadServiceConsumptionException { | ||
VedurijuhiloaEksamParing paring = getVedurijuhiloaEksamParing(isikukood, sooritatud, kuupaev); | ||
VedurijuhiloaEksamVastus vastus = jvisv6XRoadDatabase.vedurijuhiloaEksamV1(paring); | ||
return vastus.getVastuskood(); | ||
} | ||
|
||
private VedurijuhiloaEksamParing getVedurijuhiloaEksamParing(String isikukood, long sooritatud, Date kuupaev) { | ||
VedurijuhiloaEksamParing paring = VedurijuhiloaEksamParing.Factory.newInstance(); | ||
paring.setIsikukood(isikukood); | ||
paring.setSooritatud(BigInteger.valueOf(sooritatud)); | ||
paring.setKuupaev(getCalendarFromDate(kuupaev)); | ||
return paring; | ||
} | ||
|
||
private Calendar getCalendarFromDate(Date kuupaev) { | ||
Calendar calDate = Calendar.getInstance(); | ||
calDate.setTime(kuupaev); | ||
return calDate; | ||
} | ||
|
||
public String sendVedurijuhiloaKatteandmine(String isikukood, String loaNumber, Date kattesaamiseKuupaev) throws XRoadServiceConsumptionException { | ||
VedurijuhiloaKatteandmineParing paring = VedurijuhiloaKatteandmineParing.Factory.newInstance(); | ||
paring.setIsikukood(isikukood); | ||
paring.setLoaNumber(loaNumber); | ||
paring.setKatteandmiseKuupaev(getCalendarFromDate(kattesaamiseKuupaev)); | ||
VedurijuhiloaKatteandmineVastus vastus = jvisv6XRoadDatabase.vedurijuhiloaKatteandmineV1(paring); | ||
return vastus.getVastuskood(); | ||
} | ||
|
||
} |
Oops, something went wrong.