diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-07-02 16:42:43 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-07-02 16:42:43 +0200 |
commit | 4b6ce58f339d69c70ef746ceecae78bf7ed0f0ba (patch) | |
tree | 7708c40ffdc7e29aa784ee5d26308f18aa1f460b /src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java | |
parent | 030488bb7ff9572f35032d80d4101c06cfc98bf5 (diff) | |
download | moa-zs-4b6ce58f339d69c70ef746ceecae78bf7ed0f0ba.tar.gz moa-zs-4b6ce58f339d69c70ef746ceecae78bf7ed0f0ba.tar.bz2 moa-zs-4b6ce58f339d69c70ef746ceecae78bf7ed0f0ba.zip |
Handle tnvz Query Edge Cases by Improving Validation
TnvzHelper Fixes
- Handle additional edge cases.
- Mzs:Schema Change: Eliminate PreAdviceNote redundancy by removing it
from mzs:DeliveryRequest/TnvzMetaData; PreadviceNote is already in
the Receiver element. Update TnvzHelper accordingly.
- Implement and integrate tnvz completeness check into
DeliveryRequestAugmenter to ensure that, after augmentation, tnvz
can be performed.
Refactor mzs:DeliveryRequest Validation:
- Before: Validating, merging and generatig ConfigType in ConfigUtil.
- Change: Need to add validation of DeliveryRequest (Reason: For
performing Tnvz Requests, the DeliveryRequest needs to be in a
consistent state).
- Problem: DeliveryRequest validation does not fit into ConfigUtil.
- Solution: Put validation of DeliveryRequest and Config into new
Component "MzsValidation".
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java b/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java index 6c9d264..68f833e 100644 --- a/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java +++ b/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java @@ -5,7 +5,6 @@ import at.gv.zustellung.app2mzs.xsd.ClientType; import at.gv.zustellung.app2mzs.xsd.ConfigType; import at.gv.zustellung.app2mzs.xsd.KeyStoreType; import at.gv.zustellung.app2mzs.xsd.SSLType; -import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; import java.math.BigInteger; @@ -215,54 +214,4 @@ public class ConfigUtil { } - /** - * Check if all mandatory fields are set. - * - * @param profile - * @return true if all mandatory fields are set - */ - public boolean isComplete(@Nullable ConfigType profile) { - return profile != null - && profile.isPerformQueryPersonRequest() != null - && isTVNZClientConfigured(profile.getTNVZClient(), profile.isPerformQueryPersonRequest()) - && isMSGClientConfigured(profile.getMSGClient()); - } - - private boolean isTVNZClientConfigured(ClientType tnvzClient, Boolean isPerformQueryPersonRequest) { - return !isPerformQueryPersonRequest || (tnvzClient != null - && tnvzClient.getURL() != null - && tnvzClient.getReceiveTimeout() != null - && tnvzClient.getConnectionTimeout() != null - && isSSLConfigured(tnvzClient)); - } - - private boolean isMSGClientConfigured(ClientType msgClientParams) { - return msgClientParams != null - && msgClientParams.getURL() != null - && isSSLConfigured(msgClientParams) - && msgClientParams.getReceiveTimeout() != null - && msgClientParams.getConnectionTimeout() != null; - } - - private boolean isSSLConfigured(ClientType clientParams) { - return !clientParams.getURL().startsWith("https") || (clientParams.getSSL() != null - && clientParams.getSSL().isTrustAll() != null - && clientParams.getSSL().isLaxHostNameVerification() != null - && isKeyStoreConfigured(clientParams.getSSL().getKeyStore()) - && isTrustStoreConfigured(clientParams.getSSL().getTrustStore())); - } - - private boolean isKeyStoreConfigured(KeyStoreType keyStore) { - return keyStore == null || (keyStore.getPassword() != null - && keyStore.getFileType() != null - && keyStore.getFileName() != null); - } - - private boolean isTrustStoreConfigured(KeyStoreType trustStore) { - return trustStore == null || (trustStore.getPassword() != null - && "JKS".equals(trustStore.getFileType()) - && trustStore.getFileName() != null); - } - - } |