diff options
author | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2020-12-16 11:22:00 +0100 |
---|---|---|
committer | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2021-01-04 14:16:35 +0100 |
commit | 8283887c4f8f1e690b4b214f6779821b9f21ef0a (patch) | |
tree | 0950f4123f97641f7b9be7e9d418dfb884394d4b /eidas_modules | |
parent | cbbd53e6b88682045e5b8789c46a94035be30827 (diff) | |
download | National_eIDAS_Gateway-8283887c4f8f1e690b4b214f6779821b9f21ef0a.tar.gz National_eIDAS_Gateway-8283887c4f8f1e690b4b214f6779821b9f21ef0a.tar.bz2 National_eIDAS_Gateway-8283887c4f8f1e690b4b214f6779821b9f21ef0a.zip |
removed CountrySpecificDetailSearchResult, implemented countryspecific search classes
Diffstat (limited to 'eidas_modules')
9 files changed, 88 insertions, 45 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/CountrySpecificDetailSearchResult.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/CountrySpecificDetailSearchResult.java deleted file mode 100644 index 6e1f8653..00000000 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/CountrySpecificDetailSearchResult.java +++ /dev/null @@ -1,32 +0,0 @@ -package at.asitplus.eidas.specific.modules.auth.eidas.v2.dao; - -import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.WorkflowException; - -import java.util.ArrayList; - -public class CountrySpecificDetailSearchResult { - - //TODO is the result the same as the one from the initial search? - ArrayList<RegisterResult> resultsZmr = new ArrayList<>(); - ArrayList<RegisterResult> resultsErnb = new ArrayList<>(); - - public int getResultCount() { - return resultsZmr.size() + resultsErnb.size(); - } - - /** - * Verfies that there is only one match and retunrs the bpk. - * @return bpk bpk of the match - * @throws WorkflowException if multiple results have been found - */ - public String getBpk() throws WorkflowException { - if (getResultCount() != 1) { - throw new WorkflowException("getResultCount() != 1"); - } - if (resultsZmr.size() == 1) { - return resultsZmr.get(0).getBpk(); - } else { - return resultsErnb.get(0).getBpk(); - } - } -} diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java index 8b2379bf..7e926c8e 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java @@ -26,6 +26,17 @@ public class DummyErnbClient implements IErnbClient { return resultEmpty();//TODO will I only receive matches where all three values match perfectly? } + @Override + public ArrayList<RegisterResult> searchDeSpecific(String givenName, String familyName, String dateOfBirth, + String birthPlace, String birthName) { + return resultEmpty();//TODO + } + + @Override + public ArrayList<RegisterResult> searchItSpecific(String txNumber) { + return resultEmpty();//TODO + } + private ArrayList<RegisterResult> resultEmpty() { return new ArrayList<RegisterResult>();//Nobody found } diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java index 4873b939..f8a41cfe 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java @@ -9,4 +9,10 @@ public interface IErnbClient { ArrayList<RegisterResult> searchWithPersonIdentifer(String personIdentifer); ArrayList<RegisterResult> searchWithMds(String givenName, String familyName, String dateOfBirth); + + ArrayList<RegisterResult> searchDeSpecific(String givenName, String familyName, String dateOfBirth, + String birthPlace, String birthName); + + ArrayList<RegisterResult> searchItSpecific(String txNumber); + } diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/DeSpecificDetailSearchProcessor.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/DeSpecificDetailSearchProcessor.java index 727aa718..9fa13fe8 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/DeSpecificDetailSearchProcessor.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/DeSpecificDetailSearchProcessor.java @@ -1,10 +1,22 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.handler; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.CountrySpecificDetailSearchResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MergedRegisterSearchResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.ernb.IErnbClient; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr.IZmrClient; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; public class DeSpecificDetailSearchProcessor implements ICountrySpecificDetailSearchProcessor { + @Autowired + private IErnbClient ernbClient; + + @Autowired + private IZmrClient zmrClient; + @Override public String getName() { return this.getClass().getName(); @@ -25,8 +37,18 @@ public class DeSpecificDetailSearchProcessor implements ICountrySpecificDetailSe } @Override - public CountrySpecificDetailSearchResult search(SimpleEidasData eidData) { - //TODO - return new CountrySpecificDetailSearchResult(); + public MergedRegisterSearchResult search(SimpleEidasData eidData) { + MergedRegisterSearchResult searchResult = new MergedRegisterSearchResult(); + + ArrayList<RegisterResult> resultsZmr = + zmrClient.searchDeSpecific(eidData.getGivenName(), eidData.getFamilyName(), eidData.getDateOfBirth(), + eidData.getPlaceOfBirth(), eidData.getBirthName()); + searchResult.setResultsZmr(resultsZmr); + + ArrayList<RegisterResult> resultsErnb = + ernbClient.searchDeSpecific(eidData.getGivenName(), eidData.getFamilyName(), eidData.getDateOfBirth(), + eidData.getPlaceOfBirth(), eidData.getBirthName()); + searchResult.setResultsErnb(resultsErnb); + return searchResult; } } diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ICountrySpecificDetailSearchProcessor.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ICountrySpecificDetailSearchProcessor.java index 8ddd79bb..887aef4a 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ICountrySpecificDetailSearchProcessor.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ICountrySpecificDetailSearchProcessor.java @@ -23,7 +23,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.handler; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.CountrySpecificDetailSearchResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MergedRegisterSearchResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; public interface ICountrySpecificDetailSearchProcessor { @@ -44,6 +44,6 @@ public interface ICountrySpecificDetailSearchProcessor { */ boolean canHandle(String countryCode, SimpleEidasData eidData); - CountrySpecificDetailSearchResult search(SimpleEidasData eidData); + MergedRegisterSearchResult search(SimpleEidasData eidData); } diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ItSpecificDetailSearchProcessor.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ItSpecificDetailSearchProcessor.java index bb0a5262..e3b9e702 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ItSpecificDetailSearchProcessor.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ItSpecificDetailSearchProcessor.java @@ -1,10 +1,22 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.handler; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.CountrySpecificDetailSearchResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MergedRegisterSearchResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.ernb.IErnbClient; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr.IZmrClient; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; public class ItSpecificDetailSearchProcessor implements ICountrySpecificDetailSearchProcessor { + @Autowired + private IErnbClient ernbClient; + + @Autowired + private IZmrClient zmrClient; + @Override public String getName() { return this.getClass().getName(); @@ -22,8 +34,16 @@ public class ItSpecificDetailSearchProcessor implements ICountrySpecificDetailSe } @Override - public CountrySpecificDetailSearchResult search(SimpleEidasData eidData) { - //TODO - return new CountrySpecificDetailSearchResult(); + public MergedRegisterSearchResult search(SimpleEidasData eidData) { + MergedRegisterSearchResult searchResult = new MergedRegisterSearchResult(); + + ArrayList<RegisterResult> resultsZmr = + zmrClient.searchItSpecific(eidData.getTaxNumber()); + searchResult.setResultsZmr(resultsZmr); + + ArrayList<RegisterResult> resultsErnb = + ernbClient.searchItSpecific(eidData.getTaxNumber()); + searchResult.setResultsErnb(resultsErnb); + return searchResult; } } diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java index 91edbaef..e9422c56 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java @@ -24,7 +24,6 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.CountrySpecificDetailSearchResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MergedRegisterSearchResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; @@ -246,7 +245,7 @@ public class InitialSearchTask extends AbstractAuthServletTask { MergedRegisterSearchResult initialSearchResult, SimpleEidasData eidData) throws TaskExecutionException { //6 country specific search - CountrySpecificDetailSearchResult countrySpecificDetailSearchResult = + MergedRegisterSearchResult countrySpecificDetailSearchResult = countrySpecificDetailSearchProcessor.search(eidData); switch (countrySpecificDetailSearchResult.getResultCount()) { @@ -261,7 +260,7 @@ public class InitialSearchTask extends AbstractAuthServletTask { } private String step7a(MergedRegisterSearchResult initialSearchResult, - CountrySpecificDetailSearchResult countrySpecificDetailSearchResult, + MergedRegisterSearchResult countrySpecificDetailSearchResult, SimpleEidasData eidData) throws TaskExecutionException { //TODO automerge log.debug("Automerge " + initialSearchResult + " with " + eidData + " " + countrySpecificDetailSearchResult); diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java index 9a7cc9b3..343651f7 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java @@ -26,6 +26,17 @@ public class DummyZmrClient implements IZmrClient { return resultEmpty();//TODO will I only receive matches where all three values match perfectly? } + @Override + public ArrayList<RegisterResult> searchDeSpecific(String givenName, String familyName, String dateOfBirth, + String birthPlace, String birthName) { + return resultEmpty();//TODO + } + + @Override + public ArrayList<RegisterResult> searchItSpecific(String txNumber) { + return resultEmpty();//TODO + } + private ArrayList<RegisterResult> resultEmpty() { return new ArrayList<RegisterResult>();//Nobody found } diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java index 1f7e4949..018122ea 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java @@ -9,4 +9,10 @@ public interface IZmrClient { ArrayList<RegisterResult> searchWithPersonIdentifer(String personIdentifer); ArrayList<RegisterResult> searchWithMds(String givenName, String familyName, String dateOfBirth); + + ArrayList<RegisterResult> searchDeSpecific(String givenName, String familyName, String dateOfBirth, + String birthPlace, String birthName); + + ArrayList<RegisterResult> searchItSpecific(String txNumber); + } |