From 0ed301fe3628f5d646f1fc44e5717ed0e42d90fe Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Thu, 17 Dec 2020 14:58:11 +0100 Subject: added register update method --- .../modules/auth/eidas/v2/ernb/DummyErnbClient.java | 6 ++++++ .../modules/auth/eidas/v2/ernb/IErnbClient.java | 2 ++ .../modules/auth/eidas/v2/tasks/InitialSearchTask.java | 18 ++++++++++++++++-- .../modules/auth/eidas/v2/zmr/DummyZmrClient.java | 6 ++++++ .../specific/modules/auth/eidas/v2/zmr/IZmrClient.java | 2 ++ 5 files changed, 32 insertions(+), 2 deletions(-) (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main') 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 7e926c8e..0c8a2f59 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 @@ -1,6 +1,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.ernb; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -37,6 +38,11 @@ public class DummyErnbClient implements IErnbClient { return resultEmpty();//TODO } + @Override + public void update(RegisterResult registerResult, SimpleEidasData eidData) { + //TODO + } + private ArrayList resultEmpty() { return new ArrayList();//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 f8a41cfe..cda4c426 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 @@ -1,6 +1,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.ernb; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; import java.util.ArrayList; @@ -15,4 +16,5 @@ public interface IErnbClient { ArrayList searchItSpecific(String txNumber); + void update(RegisterResult registerResult, SimpleEidasData eidData); } 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 2ae278dc..5b168c3b 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 @@ -95,7 +95,7 @@ public class InitialSearchTask extends AbstractAuthServletTask { ImmutableMap, ImmutableSet>> aa = eidasResponse.getAttributes().getAttributeMap(); - + final Map simpleAttrMap = convertEidasAttrToSimpleMap( eidasResponse.getAttributes().getAttributeMap()); @@ -232,8 +232,22 @@ public class InitialSearchTask extends AbstractAuthServletTask { SimpleEidasData eidData) throws TaskExecutionException { //TODO automerge log.debug("Automerge " + initialSearchResult + " with " + eidData + " " + countrySpecificDetailSearchResult); - //TODO try { + if (initialSearchResult.getResultCount() != 0) { + throw new WorkflowException("initialSearchResult.getResultCount() != 0"); + } + if (countrySpecificDetailSearchResult.getResultCount() != 1) { + throw new WorkflowException("countrySpecificDetailSearchResult.getResultCount() != 1"); + } + if (countrySpecificDetailSearchResult.getResultsZmr().size() == 1) { + //update ZMR + zmrClient.update(countrySpecificDetailSearchResult.getResultsZmr().get(0), eidData); + } + if (countrySpecificDetailSearchResult.getResultsErnb().size() == 1) { + //update ErnB + ernbClient.update(countrySpecificDetailSearchResult.getResultsErnb().get(0), eidData); + } + String bpK = countrySpecificDetailSearchResult.getBpk(); return bpK; } catch (WorkflowException e) { 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 343651f7..0f3436d8 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 @@ -1,6 +1,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -37,6 +38,11 @@ public class DummyZmrClient implements IZmrClient { return resultEmpty();//TODO } + @Override + public void update(RegisterResult registerResult, SimpleEidasData eidData) { + //TODO + } + private ArrayList resultEmpty() { return new ArrayList();//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 018122ea..4af7bfe9 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 @@ -1,6 +1,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; import java.util.ArrayList; @@ -15,4 +16,5 @@ public interface IZmrClient { ArrayList searchItSpecific(String txNumber); + void update(RegisterResult registerResult, SimpleEidasData eidData); } -- cgit v1.2.3